feat: convert sse to http transport
This commit is contained in:
parent
504aa26761
commit
4cc46bf8d1
6 changed files with 60 additions and 65 deletions
49
README.md
49
README.md
|
@ -23,10 +23,7 @@ All the most popular MCP clients (Claude Desktop, Cursor & Windsurf) use the fol
|
|||
"mcpServers": {
|
||||
"remote-example": {
|
||||
"command": "npx",
|
||||
"args": [
|
||||
"mcp-remote",
|
||||
"https://remote.mcp.server/sse"
|
||||
]
|
||||
"args": ["mcp-remote", "https://remote.mcp.server/sse"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,12 +38,7 @@ To bypass authentication, or to emit custom headers on all requests to your remo
|
|||
"mcpServers": {
|
||||
"remote-example": {
|
||||
"command": "npx",
|
||||
"args": [
|
||||
"mcp-remote",
|
||||
"https://remote.mcp.server/sse",
|
||||
"--header",
|
||||
"Authorization: Bearer ${AUTH_TOKEN}"
|
||||
]
|
||||
"args": ["mcp-remote", "https://remote.mcp.server/sse", "--header", "Authorization: Bearer ${AUTH_TOKEN}"]
|
||||
},
|
||||
"env": {
|
||||
"AUTH_TOKEN": "..."
|
||||
|
@ -74,7 +66,7 @@ To bypass authentication, or to emit custom headers on all requests to your remo
|
|||
|
||||
### Flags
|
||||
|
||||
* If `npx` is producing errors, consider adding `-y` as the first argument to auto-accept the installation of the `mcp-remote` package.
|
||||
- If `npx` is producing errors, consider adding `-y` as the first argument to auto-accept the installation of the `mcp-remote` package.
|
||||
|
||||
```json
|
||||
"command": "npx",
|
||||
|
@ -85,7 +77,7 @@ To bypass authentication, or to emit custom headers on all requests to your remo
|
|||
]
|
||||
```
|
||||
|
||||
* To force `npx` to always check for an updated version of `mcp-remote`, add the `@latest` flag:
|
||||
- To force `npx` to always check for an updated version of `mcp-remote`, add the `@latest` flag:
|
||||
|
||||
```json
|
||||
"args": [
|
||||
|
@ -94,7 +86,7 @@ To bypass authentication, or to emit custom headers on all requests to your remo
|
|||
]
|
||||
```
|
||||
|
||||
* To change which port `mcp-remote` listens for an OAuth redirect (by default `3334`), add an additional argument after the server URL. Note that whatever port you specify, if it is unavailable an open port will be chosen at random.
|
||||
- To change which port `mcp-remote` listens for an OAuth redirect (by default `3334`), add an additional argument after the server URL. Note that whatever port you specify, if it is unavailable an open port will be chosen at random.
|
||||
|
||||
```json
|
||||
"args": [
|
||||
|
@ -104,7 +96,7 @@ To bypass authentication, or to emit custom headers on all requests to your remo
|
|||
]
|
||||
```
|
||||
|
||||
* To allow HTTP connections in trusted private networks, add the `--allow-http` flag. Note: This should only be used in secure private networks where traffic cannot be intercepted.
|
||||
- To allow HTTP connections in trusted private networks, add the `--allow-http` flag. Note: This should only be used in secure private networks where traffic cannot be intercepted.
|
||||
|
||||
```json
|
||||
"args": [
|
||||
|
@ -120,8 +112,8 @@ To bypass authentication, or to emit custom headers on all requests to your remo
|
|||
|
||||
In order to add an MCP server to Claude Desktop you need to edit the configuration file located at:
|
||||
|
||||
* macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
||||
* Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
||||
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
||||
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
||||
|
||||
If it does not exist yet, [you may need to enable it under Settings > Developer](https://modelcontextprotocol.io/quickstart/user#2-add-the-filesystem-mcp-server).
|
||||
|
||||
|
@ -143,16 +135,16 @@ As of version `0.48.0`, Cursor supports unauthed SSE servers directly. If your M
|
|||
|
||||
For instructions on building & deploying remote MCP servers, including acting as a valid OAuth client, see the following resources:
|
||||
|
||||
* https://developers.cloudflare.com/agents/guides/remote-mcp-server/
|
||||
- https://developers.cloudflare.com/agents/guides/remote-mcp-server/
|
||||
|
||||
In particular, see:
|
||||
|
||||
* https://github.com/cloudflare/workers-oauth-provider for defining an MCP-comlpiant OAuth server in Cloudflare Workers
|
||||
* https://github.com/cloudflare/agents/tree/main/examples/mcp for defining an `McpAgent` using the [`agents`](https://npmjs.com/package/agents) framework.
|
||||
- https://github.com/cloudflare/workers-oauth-provider for defining an MCP-comlpiant OAuth server in Cloudflare Workers
|
||||
- https://github.com/cloudflare/agents/tree/main/examples/mcp for defining an `McpAgent` using the [`agents`](https://npmjs.com/package/agents) framework.
|
||||
|
||||
For more information about testing these servers, see also:
|
||||
|
||||
* https://developers.cloudflare.com/agents/guides/test-remote-mcp-server/
|
||||
- https://developers.cloudflare.com/agents/guides/test-remote-mcp-server/
|
||||
|
||||
Know of more resources you'd like to share? Please add them to this Readme and send a PR!
|
||||
|
||||
|
@ -170,7 +162,7 @@ Then restarting your MCP client.
|
|||
|
||||
### Check your Node version
|
||||
|
||||
Make sure that the version of Node you have installed is [18 or
|
||||
Make sure that the version of Node you have installed is [18 or
|
||||
higher](https://modelcontextprotocol.io/quickstart/server). Claude
|
||||
Desktop will use your system version of Node, even if you have a newer
|
||||
version installed elsewhere.
|
||||
|
@ -187,13 +179,10 @@ this might look like:
|
|||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"mcpServers": {
|
||||
"remote-example": {
|
||||
"command": "npx",
|
||||
"args": [
|
||||
"mcp-remote",
|
||||
"https://remote.mcp.server/sse"
|
||||
],
|
||||
"args": ["mcp-remote", "https://remote.mcp.server/sse"],
|
||||
"env": {
|
||||
"NODE_EXTRA_CA_CERTS": "{your CA certificate file path}.pem"
|
||||
}
|
||||
|
@ -204,10 +193,10 @@ this might look like:
|
|||
|
||||
### Check the logs
|
||||
|
||||
* [Follow Claude Desktop logs in real-time](https://modelcontextprotocol.io/docs/tools/debugging#debugging-in-claude-desktop)
|
||||
* MacOS / Linux:<br/>`tail -n 20 -F ~/Library/Logs/Claude/mcp*.log`
|
||||
* For bash on WSL:<br/>`tail -n 20 -f "C:\Users\YourUsername\AppData\Local\Claude\Logs\mcp.log"`
|
||||
* Powershell: <br/>`Get-Content "C:\Users\YourUsername\AppData\Local\Claude\Logs\mcp.log" -Wait -Tail 20`
|
||||
- [Follow Claude Desktop logs in real-time](https://modelcontextprotocol.io/docs/tools/debugging#debugging-in-claude-desktop)
|
||||
- MacOS / Linux:<br/>`tail -n 20 -F ~/Library/Logs/Claude/mcp*.log`
|
||||
- For bash on WSL:<br/>`tail -n 20 -f "C:\Users\YourUsername\AppData\Local\Claude\Logs\mcp.log"`
|
||||
- Powershell: <br/>`Get-Content "C:\Users\YourUsername\AppData\Local\Claude\Logs\mcp.log" -Wait -Tail 20`
|
||||
|
||||
## Debugging
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue