|
| 1 | +--- |
| 2 | +pcx_content_type: concept |
| 3 | +title: Testing your remote MCP Server |
| 4 | +sidebar: |
| 5 | + order: 6 |
| 6 | +--- |
| 7 | + |
| 8 | +import { Render } from "~/components"; |
| 9 | + |
| 10 | +Remote, authorized connections are an evolving part of the [Model Context Protocol (MCP) specification](https://spec.modelcontextprotocol.io/specification/draft/basic/authorization/). Not all MCP clients support remote connections yet. |
| 11 | + |
| 12 | +This guide will show you options for how to start using your remote MCP server with MCP clients that support remote connections. |
| 13 | + |
| 14 | +## The Model Context Protocol (MCP) inspector |
| 15 | + |
| 16 | +The [`@modelcontextprotocol/inspector` package](https://github.com/modelcontextprotocol/inspector) is a visual testing tool for MCP servers. |
| 17 | + |
| 18 | +You can run it locally by running the following command: |
| 19 | + |
| 20 | +```bash |
| 21 | +npx @modelcontextprotocol/inspector |
| 22 | +``` |
| 23 | + |
| 24 | +Then, enter the URL of your remote MCP server. You can use an MCP server running on your local machine on localhost, or you can use a remote MCP server running on Cloudflare. |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +Once you have authenticated, you will be redirected back to the inspector. You should see the "List Tools" button, which will list the tools that your MCP server exposes. |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +## Connect your remote MCP server to Claude Desktop via a local proxy |
| 33 | + |
| 34 | +Even though [Claude Desktop](https://claude.ai/download) doesn't yet support remote MCP clients, you can use the [`mcp-remote` local proxy](https://www.npmjs.com/package/mcp-remote) to connect it to your remote MCP server. This lets you to test what an interaction with your remote MCP server will be like with a real-world MCP client. |
| 35 | + |
| 36 | +1. Open Claude Desktop and navigate to Settings -> Developer -> Edit Config. This opens the configuration file that controls which MCP servers Claude can access. |
| 37 | +2. Replace the content with a configuration like this: |
| 38 | + |
| 39 | +```json |
| 40 | +{ |
| 41 | + "mcpServers": { |
| 42 | + "math": { |
| 43 | + "command": "npx", |
| 44 | + "args": ["mcp-remote", "http://my-mcp-server.my-account.workers.dev/sse"] |
| 45 | + } |
| 46 | + } |
| 47 | +} |
| 48 | +``` |
| 49 | + |
| 50 | +This tells Claude to communicate with your MCP server running at `http://localhost:8787/sse`. |
| 51 | + |
| 52 | +3. Save the file and restart Claude Desktop (command/ctrl + R). When Claude restarts, a browser window will open showing your OAuth login page. Complete the authorization flow to grant Claude access to your MCP server. |
| 53 | + |
| 54 | +Once authenticated, you'll be able to see your tools by clicking the tools icon in the bottom right corner of Claude's interface. |
| 55 | + |
| 56 | +## Connect your remote MCP server to Cursor |
| 57 | + |
| 58 | +To connect [Cursor](https://www.cursor.com/) with your remote MCP server, choose `Type`: "Command" and in the `Command` field, combine the command and args fields into one (e.g.`npx mcp-remote https://your-worker-name.your-account.workers.dev/sse`). |
| 59 | + |
| 60 | +## Connect your remote MCP server to Windsurf |
| 61 | + |
| 62 | +You can connect your remote MCP server to [Windsurf](https://codeium.com/windsurf) by editing the [`mcp_config.json` file](https://docs.codeium.com/windsurf/mcp), and adding the following configuration: |
| 63 | + |
| 64 | +```json |
| 65 | +{ |
| 66 | + "mcpServers": { |
| 67 | + "math": { |
| 68 | + "command": "npx", |
| 69 | + "args": ["mcp-remote", "http://my-mcp-server.my-account.workers.dev/sse"] |
| 70 | + } |
| 71 | + } |
| 72 | +} |
| 73 | +``` |
0 commit comments