docs/2.developers/4.user-guide/50.llm-xpack/41.pathway-mcp-claude-desktop.md
The Model Context Protocol (MCP) enables AI applications to interact with external data sources and tools in a standardized way. By connecting Pathway MCP Server to Claude Desktop, you can provide Claude with all Pathway data processing capabilities, including real-time access to statistics and document stores.
This tutorial explains how to set up and use Pathway MCP Server with Claude Desktop, allowing Claude to retrieve real-time data, perform computations, and interact with your document store.
Before starting, ensure you have the following:
pip install pathway[xpack-llm], learn more here).::note Important: Pathway MCP Server requires a Pathway license key. You can obtain a free license key here. ::
MCP servers act as intermediaries between AI applications (like Claude Desktop) and data sources and tools. Pathway's MCP Server provides the real-time data processing capabilities of the Pathway engine to your AI applications, such as:
Each tool is explicit exposed, ensuring you maintain control over what Claude can access and modify.
You can learn more about Pathway MCP server in the associated article.
Start by creating a simple MCP server that exposes a tool for Claude to interact with.
For example, let's expose a tool that returns a constant value.
Create the server in a Python file pathway_mcp_server.py:
import pathway as pw
from pathway.xpacks.llm.mcp_server import McpServable, McpServer, PathwayMcp
pw.set_license_key("demo-license-key-with-telemetry")
class EmptyRequestSchema(pw.Schema):
pass
class ConstantValueTool(McpServable):
def get_constant_value(self, input_from_client: pw.Table) -> pw.Table:
return input_from_client.select(result=1)
def register_mcp(self, server: McpServer):
server.tool(
"get_constant_value",
request_handler=self.get_constant_value,
schema=EmptyRequestSchema,
)
function_to_serve = ConstantValueTool()
pathway_mcp_server = PathwayMcp(
name="Pathway MCP Server",
transport="streamable-http",
host="localhost",
port=8123,
serve=[function_to_serve],
)
pw.run()
Other Pathway MCP server examples are available here.
Execute the script to start the MCP server:
python pathway_mcp_server.py
The server will be available at http://localhost:8123/mcp/.
To be able to use your Pathway MCP Server in Claude Desktop do as follows:
::
::
claude_desktop_config.json and edit it as follows:{
"mcpServers": {
"pathway": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:8123/mcp/",
"--transport",
"http-first"
]
}
}
}
Reload Claude Desktop configuration with Ctrl+R and Claude Desktop will connect to your Pathway MCP Server.
If it doesn't work, check that Node.js appears in the "Detected Tools" section in "Extensions", "Advanced Settings". If not, then you need to (re)install npm and npx. You may need to restart your computer and Claude Desktop once it is done, especially on Windows.
::
::
Once this is done, the server should appear below "Local MCP Server" when in the "Developer" section.
::
You can now ask Claude to use the tools exposed by the Pathway MCP Server. For example:
get_constant_value tool and return the result.Claude Desktop will ask you to validate the use of tools, ensuring that you control the usage. It is useful for expensive tools, such as tools relying on LLMs.
Pathway should be listed as a tool in the chat:
::
To use other tools, you can implement some presented in the Pathway MCP article. Restart your MCP server, and reload Claude Desktop: the configuration stay the same, you have nothing else to do!
By connecting Pathway MCP Server to Claude Desktop, you enable Claude to access real-time data, perform computations, and interact with your Pathway tables. You can easily set up a RAG pipeline by exposing Pathway Document Store. This integration enhances Claude's capabilities, allowing it to provide accurate, context-aware responses based on up-to-date information. As real-time data processing becomes increasingly important, tools like Pathway MCP Server will be essential for effective data handling and decision-making in AI applications.