CW

cloudflare/workers-mcp

Developer tools공식

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

647 stars 67 forks 품질 76 트렌드 21Apache-2.0

Claude Desktop의 Cloudflare 작업자와 상담해 보세요!

개요

여기서 시작해 MCP 서버를 구축하세요. Claude Desktop, Cursor 및 다른 클라이언트에서 MCP 원격 서버에 연결할 수 있습니다. 이 패키지는 CLI 도구와 Worker 내 로직을 제공하여 Claude Desktop(또는 모든 MCP 클라이언트)을 계정 내 Cloudflare Worker에 연결할 수 있어, 필요에 맞게 맞춤화할 수 있습니다. Worker의 TypeScript 메서드를 다음과 같이 변환하는 빌드 단계를 통해 작동합니다: ... 로컬 Node.js 서버가 MCP 클라이언트에 노출할 수 있는 MCP 도구로 전환합니다. Node.js 서버는 프록시 역할을 하며, 로컬에서 stdio 전송을 처리하고 Cloudflare에서 실행 중인 워커의 관련 메서드를 호출합니다. 이를 통해 앱이나 Cloudflare 개발자 플랫폼의 모든 함수나 API를 코딩 에이전트, Claude Desktop 또는 다른 MCP 클라이언트의 LLM으로 노출할 수 있습니다. 네, 그 수학은 알고 있습니다.

개요(AI 번역)

Claude Desktop의 Cloudflare 작업자와 상담하세요!

[! 경고] 여기서 시작해 원격 MCP 서버를 구축하는 게 좋겠습니다

Claude Desktop, Cursor 및 기타 클라이언트에서 MCP 원격 서버에 mcp-remote를 사용할 수 있습니다.

workers-mcp가 뭐야?

이 패키지는 CLI 도구와 Worker 내 로직을 제공하여 Claude Desktop(또는 모든 MCP 클라이언트)을 계정 내 Cloudflare Worker에 연결할 수 있어, 필요에 맞게 맞춤화할 수 있습니다. Worker의 TypeScript 메서드를 다음과 같이 변환하는 빌드 단계를 통해 작동합니다:

… 로컬 Node.js 서버가 MCP 클라이언트에 노출할 수 있는 MCP 도구로 전환합니다. Node.js 서버는 프록시 역할을 하며, 로컬에서 stdio 전송을 처리하고 Cloudflare에서 실행 중인 워커의 관련 메서드를 호출합니다. 이를 통해 앱이나 Cloudflare 개발자 플랫폼의 모든 함수나 API를 코딩 에이전트, Claude Desktop 또는 다른 MCP 클라이언트의 LLM으로 노출할 수 있습니다.

네, Math.random()가 워커에서 로컬 머신에서 작동하는 것과 동일하다는 것은 알고 있지만, 클로드🤫에게는 말하지 마세요

사용

1단계: 새로운 워커 생성

create-cloudflare를 사용해 새로운 워커를 생성하세요.

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

workers-mcp

Talk to a Cloudflare Worker from Claude Desktop!

[!WARNING]
You should start here instead — and build a remote MCP server

You can connect to remote MCP servers from Claude Desktop, Cursor, and other clients using mcp-remote.

What is workers-mcp?

This package provides both the CLI tooling and the in-Worker logic to connect Claude Desktop (or any MCP Client) to a Cloudflare Worker on your account, so you can customise it to suit your needs. It works via a build step that can translate TypeScript methods of your Worker like this:

export class ExampleWorkerMCP extends WorkerEntrypoint {
  /**
   * 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
}

…into MCP tools that a local Node.js server can expose to MCP clients. The Node.js server acts as a proxy, handling stdio transport locally, and calling the relevant method of your Worker running on Cloudflare. This allows you to expose any function or API in your app, or any service in Cloudflare’s developer platform, back to a LLM in your coding agent, Claude Desktop or other MCP client.

Yes, I know that Math.random() works the same on a Worker as it does on your local machine, but don’t tell Claude 🤫

Usage

Step 1: Generate a new Worker

Use create-cloudflare to generate a new Worker.

npx create-cloudflare@latest my-new-worker

I suggest choosing a Hello World worker.

Step 2: Install workers-mcp

cd my-new-worker # I always forget this bit
npm install workers-mcp

Step 3: Run the setup command

npx workers-mcp setup

Note: if something goes wrong, run npx workers-mcp help

Step 4…♾️: Iterating

After changing your Worker code, you only need to run npm run deploy to update both Claude’s metadata about your function and your live Worker instance.

However, if you change the names of your methods, or their parameters, or add or remove methods, Claude will not see the updates until you restart it.

You shouldn’t ever need to rerun npx workers-mcp install:claude, but it’s safe to do so if you want to rule out Claude config as a source of errors.

Using with Other MCP Clients

Cursor

GitHub에서 전체 README 보기

설치

npx create-cloudflare@latest my-new-worker
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "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": {} } } }