Workers MCP
Officialworkers-mcp
Claude Desktop の Cloudflare ワーカーにご相談ください。
[!警告]
代わりにここから始め、リモートMCPサーバーを構築してください。mcp-remote を使用して、 Claude Desktop、Cursor、およびその他のクライアントからリモート MCP サーバーに接続できます。
workers-mcpとは何ですか?
このパッケージは、Claude Desktop(または任意のMCPクライアント)をアカウント上のCloudflare Workerに接続するためのCLIツールとWorker内ロジックの両方を提供するため、ニーズに合わせてカスタマイズできます。このパッケージは、WorkerのTypeScriptメソッドを次のように変換できるビルドステップを介して動作します。
export class ExampleWorkerMCP extends WorkerEntrypoint<Env> {
/**
* Generates a random number. This is extra random because it had to travel all the way to
* your nearest Cloudflare PoP to be calculated which... something something lava lamps?
*
* @return {string} A message containing a super duper random number
* */
async getRandomNumber() {
return `Your random number is ${Math.random()}`
}
// ...etc
}ローカルNode.jsサーバーがMCPクライアントに公開できるMCPツールに変換します。Node.jsサーバーはプロキシとして機能し、stdioトランスポートをローカルで処理し、Cloudflare上で実行されているWorkerの関連メソッドを呼び出します。これにより、アプリ内の任意の関数やAPI、あるいはCloudflare開発者プラットフォーム内の任意のサービスを、コーディングエージェント、Claude Desktop、またはその他のMCPクライアントのLLMに公開できます。
はい、
Math.random()が Worker でもローカルマシンと同じように動作することはわかっていますが、Claude には言わないでください 🤫
使用法
ステップ1: 新しいワーカーを生成する
create-cloudflareを使用して新しい Worker を生成します。
npx create-cloudflare@latest my-new-workerHello Worldワーカーを選択することをお勧めします。
ステップ2: workers-mcpをインストールする
cd my-new-worker # I always forget this bit
npm install workers-mcpステップ3: setupコマンドを実行する
npx workers-mcp setup注: 何か問題が発生した場合は、 npx workers-mcp helpを実行してください。
ステップ4..♾️: 反復
Worker コードを変更した後は、 npm run deployを実行して、関数に関する Claude のメタデータとライブ Worker インスタンスの両方を更新するだけです。
ただし、メソッドの名前やパラメータを変更したり、メソッドを追加または削除したりした場合は、Claude を再起動するまで更新は表示されません。
npx workers-mcp install:claudeを再実行する必要はありませんが、Claude 構成がエラーの原因ではないことを確認したい場合は、再実行しても安全です。
Related MCP server: Remote MCP Server Authless
他のMCPクライアントとの使用
カーソル
Cloudflare MCP サーバーを Cursor で動作させるには、構成ファイルの「command」と「args」を 1 つの文字列に結合し、「command」タイプを使用する必要があります。
たとえば、設定ファイルは次のようになります。
{
"mcpServers": {
"your-mcp-server-name": {
"command": "/path/to/workers-mcp",
"args": [
"run",
"your-mcp-server-name",
"https://your-server-url.workers.dev",
"/path/to/your/project"
],
"env": {}
}
}
}カーソルで、次の MCP サーバー エントリを作成します。
タイプ:
commandコマンド:
/path/to/workers-mcp run your-mcp-server-name https://your-server-url.workers.dev /path/to/your/project
その他のMCPクライアント
Windsurf やその他の MCP クライアントの場合は、クライアントから直接ツールを使用できるように、構成ファイルを更新してワーカーを含めます。
{
"mcpServers": {
"your-mcp-server-name": {
"command": "/path/to/workers-mcp",
"args": [
"run",
"your-mcp-server-name",
"https://your-server-url.workers.dev",
"/path/to/your/project"
],
"env": {}
}
}
}プレースホルダーを実際のサーバー名、URL、プロジェクト パスに置き換えてください。
例
これを何に使用するかについてのアイデアをいくつか確認するには、 examplesディレクトリを参照してください。
examples/01-hello-world上記のインストール手順の後に作成されたスナップショットです。examples/02-image-generationWorkers AI を使用して Flux 画像生成モデルを実行します。Claude はプロンプトの提案が非常に得意で、結果を解釈し、望ましい結果を達成するためにどのような新しいプロンプトを試みるべきかを決定します。TODO ブラウザレンダリング
TODO 耐久性のあるオブジェクト
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
AlicenseAqualityAmaintenanceLets you use Claude Desktop, or any MCP Client, to use natural language to accomplish things on your Cloudflare account.25,6604,060Apache 2.0- FlicenseNot gradedqualityCmaintenanceA deployable authentication-free MCP (Model Context Protocol) server on Cloudflare Workers that allows you to add custom tools and connect to AI clients like Claude Desktop or Cloudflare AI Playground.
- FlicenseNot gradedqualityCmaintenanceA serverless implementation of Model Context Protocol on Cloudflare Workers that enables connecting AI assistants like Claude to custom tools without authentication.
- FlicenseNot gradedqualityCmaintenanceA serverless MCP (Model Context Protocol) implementation that can be deployed on Cloudflare Workers without authentication, allowing clients like Claude Desktop to connect to custom AI tools.
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cloudflare/workers-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server