Skip to main content
Glama
puspoaditya

Cloudflare Workers AI MCP Server

Cloudflare Workers AI MCP 服务器

模型上下文协议(MCP)服务器,让 AI 代理能够访问 Cloudflare Workers AI —— 提供无服务器 LLM 推理、嵌入和图像生成,并带有慷慨的免费额度。

工具

工具

描述

list_models

列出支持的聊天、嵌入和图像模型

chat_completion

LLM 聊天补全(Llama 3.3 70B、Llama 3.1 8B、Llama 4 Scout、Qwen Coder 32B、DeepSeek R1 Distill)

embed_text

文本嵌入(BGE small/base)

generate_image

图像生成(Flux 1 Schnell)→ base64 图像(PNG/JPEG)

Related MCP server: Remote MCP Server Authless

设置

  1. 创建一个具有 Workers AI 权限的 Cloudflare API 令牌: https://dash.cloudflare.com/profile/api-tokens

  2. 获取你的 账户 ID(Cloudflare 仪表盘右侧边栏,或任何仪表盘 URL 中的 /accounts/{id} 段)

  3. 导出环境变量:

export CLOUDFLARE_ACCOUNT_ID="your-account-id"
export CLOUDFLARE_API_TOKEN="your-api-token"

运行

npm install && npm run build
npm start   # stdio MCP server

Claude Desktop

添加到 claude_desktop_config.json

{
  "mcpServers": {
    "cloudflare-workers-ai": {
      "command": "node",
      "args": ["/absolute/path/to/cloudflare-workers-ai-mcp/dist/index.js"],
      "env": {
        "CLOUDFLARE_ACCOUNT_ID": "your-account-id",
        "CLOUDFLARE_API_TOKEN": "your-api-token"
      }
    }
  }
}

Cursor / VS Code / 其他 MCP 客户端

将客户端指向同一命令(node dist/index.js 及两个环境变量)。

OpenClaw

OpenClaw 支持 MCP 服务器 —— 将相同命令添加到其 MCP 配置中。

示例提示

  • “使用 Cloudflare Workers AI 上的 Llama 3.3 70B 模型总结这段文本”

  • “生成一张暴风雪中赤狐的图片”

  • “将这 3 个句子嵌入以进行相似度搜索”

模型(已实时验证)

聊天:POST /ai/v1/chat/completions(兼容 OpenAI)· 嵌入和图像:POST /ai/run/{model}(原生)

模型 — 聊天:@cf/meta/llama-3.3-70b-instruct-fp8-fast · @cf/meta/infire-llama-3.1-8b-instruct · @cf/meta/llama-4-scout-17b-16e-instruct · @cf/qwen/qwen2.5-coder-32b-instruct · @cf/deepseek-ai/deepseek-r1-distill-qwen-32b

嵌入:@cf/baai/bge-small-en-v1.5 · @cf/baai/bge-base-en-v1.5

图像:@cf/black-forest-labs/flux-1-schnell

注意:@cf/meta/llama-3.1-8b-instruct 已被 Cloudflare 弃用(2026-05-30)—— 请使用 @cf/meta/infire-llama-3.1-8b-instruct

测试

npm test   # unit tests (mocked fetch) + protocol test

许可证

MIT — 由 puspoaditya 构建。

Install Server
F
license - not found
A
quality
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (12mo)
Commit activity

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

  • Free public MCP for AI agents — 193 tools, 44 workflows. No API key.

  • OCR, transcription, file extraction, and image generation for AI agents via MCP.

View all MCP Connectors

Latest Blog Posts

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/puspoaditya/cloudflare-workers-ai-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server