# puspoaditya/cloudflare-workers-ai-mcp [Health: Active]

**Category:** 🗣️ Conversational AI  
**Repository:** https://github.com/puspoaditya/cloudflare-workers-ai-mcp  
**GitHub Stars:** 0  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/puspoaditya-cloudflare-workers-ai-mcp

## Description
Cloudflare Workers AI inference for AI agents: LLM chat completions (Llama 3.3 70B, Llama 3.1 8B, Llama 4 Scout, Qwen Coder 32B, DeepSeek R1 Distill), text embeddings (BGE small/base), and image generation (Flux 1 Schnell) — generous free tier, no infrastructure to run. npx -y @puspoaditya/cloudflare-workers-ai-mcp.

## Tools
Capabilities this server exposes over MCP:

- **list_models** — List supported chat, embedding, and image models
- **chat_completion** — LLM chat completion (Llama 3.3 70B, Llama 3.1 8B, Llama 4 Scout, Qwen Coder 32B, DeepSeek R1 Distill)
- **embed_text** — Text embeddings (BGE small/base)
- **generate_image** — Image generation (Flux 1 Schnell) → base64 image (PNG/JPEG)

## Claude Desktop Quick Installation
Remote MCP endpoint (confidence: high). Install path detected from listing signals. Add as a URL/SSE server in your client:

```json
"mcpServers": {
  "cloudflare-workers-ai-mcp": {
    "url": "https://dash.cloudflare.com/profile/api-tokens"
  }
}
```

## Documentation & README

# Cloudflare Workers AI MCP Server

Model Context Protocol (MCP) server that gives AI agents access to **Cloudflare Workers AI** — serverless LLM inference, embeddings, and image generation with a generous free tier.

## Tools

| Tool | Description |
|---|---|
| `list_models` | List supported chat, embedding, and image models |
| `chat_completion` | LLM chat completion (Llama 3.3 70B, Llama 3.1 8B, Llama 4 Scout, Qwen Coder 32B, DeepSeek R1 Distill) |
| `embed_text` | Text embeddings (BGE small/base) |
| `generate_image` | Image generation (Flux 1 Schnell) → base64 image (PNG/JPEG) |

## Setup

1. Create a Cloudflare API token with the **Workers AI** permission:
   https://dash.cloudflare.com/profile/api-tokens
2. Get your **Account ID** (right sidebar of the Cloudflare dashboard, or the `/accounts/{id}` segment of any dashboard URL)
3. Export the env vars:

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

## Run

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

### Claude Desktop

Add to `claude_desktop_config.json`:

```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 / other MCP clients

Point the client at the same command (`node dist/index.js` with the two env vars).

### OpenClaw

OpenClaw supports MCP servers — add the same command to its MCP configuration.

## Example prompts

- "Summarize this text using the Llama 3.3 70B model on Cloudflare Workers AI"
- "Generate an image of a red fox in a snowstorm"
- "Embed these 3 sentences for a similarity search"

## Models (verified live)

Chat: `POST /ai/v1/chat/completions` (OpenAI-compatible) · Embeddings & images: `POST /ai/run/{model}` (native)

Models — chat: `@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`

Embeddings: `@cf/baai/bge-small-en-v1.5` · `@cf/baai/bge-base-en-v1.5`

Images: `@cf/black-forest-labs/flux-1-schnell`

> Note: `@cf/meta/llama-3.1-8b-instruct` was deprecated by Cloudflare (2026-05-30) — use `@cf/meta/infire-llama-3.1-8b-instruct`.

## Test

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

## License

MIT — built by [puspoaditya](https://github.com/puspoaditya).

