Guide for connecting to your MCP server from various clients.
If your client supports Streamable HTTP, connect directly:
{
"remote-example": {
"url": "http://localhost:3000/api/mcp"
}
}For clients that only support stdio, use mcp-remote to proxy Streamable HTTP:
{
"remote-example": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:3000/api/mcp"]
}
}Edit the configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
If the file doesn't exist, enable it under Settings > Developer.
{
"remote-example": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:3000/api/mcp"]
}
}Restart Claude Desktop to pick up changes. You should see a hammer icon in the bottom right corner of the input box.
Edit ~/.cursor/mcp.json.
Cursor supports Streamable HTTP servers directly. If your MCP server uses OAuth authorization, you may still need mcp-remote.
Edit ~/.codeium/windsurf/mcp_config.json.
Use the MCP client directly in your application:
import {
Client,
StreamableHTTPClientTransport,
} from "@modelcontextprotocol/client";
const client = new Client({ name: "my-app", version: "1.0.0" });
await client.connect(
new StreamableHTTPClientTransport(new URL("https://example.com/api/mcp")),
);
const result = await client.callTool({
name: "yourTool",
arguments: { param: "value" },
});