Skip to main content

Module mcp

Module mcp 

Source
Expand description

Mcp command - proxy stdio JSON-RPC to Materialize’s developer MCP server.

Materialize exposes a developer MCP server at POST /api/mcp/developer over HTTP with HTTP Basic auth. Most MCP clients (Claude Desktop, Claude Code, Cursor) launch their MCP servers as subprocesses speaking JSON-RPC over stdio. This command bridges the two: read newline-delimited JSON-RPC from stdin, POST each message to the developer endpoint with the active profile’s credentials, and write each response back to stdout.

Constants§

LOCAL_HTTP_PORT 🔒
Default HTTP port for a local Materialize.
MCP_DEVELOPER_PATH 🔒
Path of the developer MCP endpoint on the Materialize HTTP listener.

Functions§

developer_url 🔒
Build the developer MCP URL from the profile’s http_host.
resolve_profile 🔒
Resolve the active profile without going through Settings::load, so the MCP proxy works outside an mz-deploy project directory.
run
Proxy stdio JSON-RPC to the developer MCP HTTP endpoint.
synthesize_error 🔒
Build a JSON-RPC error response so the MCP client gets a structured error instead of a hang when the HTTP layer fails before the server can respond.