Remote MCP (Model Context Protocol) servers enable AI clients like Claude Desktop or VSCode extensions to securely interact with external tools via standardized SSE endpoints, deployable in minutes on Cloudflare Workers.
What is MCP?
MCP standardizes how large language models connect to services, acting like a universal interface for tools, resources, and prompts. Cloudflare simplifies remote servers with built-in OAuth, Durable Objects for state, and SSE transport, eliminating manual serialization or routing code. Clients connect via URLs like https://your-mcp.workers.dev/sse, supporting authentication flows.
Quickstart Deployment
Create a public authless server using Cloudflare's template: run npm create cloudflare@latest -- my-mcp-server --template=cloudflare/ai/demos/remote-mcp-authless in your terminal. This generates a Worker exposing basic tools; deploy with npx wrangler deploy after logging in via npx wrangler login. The server runs at remote-mcp-server-authless..workers.dev/sse, ready for Claude or VSCode connection without custom code.
For authenticated setups, wrap your MCP logic in Cloudflare's OAuthProvider: import libraries like @modelcontextprotocol/sdk/server/mcp.js and define tools with Zod schemas, e.g., a counter tool persisting state via Durable Objects.
Public Example Repository
Deploy Google's Cloud Run MCP server from https://github.com/GoogleCloudPlatform/cloud-run-mcp, which provides tools like deploy-local-folder for app deployments. Configure in VSCode with "command": "npx", "args": ["-y", "@google-cloud/cloud-run-mcp"] after GCP auth, or connect Claude Desktop to its SSE endpoint. Test by listing services: the repo includes full setup for production use.
Connecting Clients
In Claude Desktop, add the SSE URL under MCP settings and authenticate if needed; VSCode uses extensions like Cline with mcp-remote adapter for legacy support. Tools appear as callable functions, e.g., incrementing counters or generating images via @cf/black-forest-labs/flux-1-schnell. Sessions maintain state across calls, enabling agentic workflows like persistent todos.
Top comments (0)