Skip to main content
Glama
tobytoy

cf-mcp-playground

by tobytoy

cf-mcp-playground

Ein Model Context Protocol (MCP)-Dienst für duale Laufzeitumgebungen mit Cloudflare Worker und Docker, mit integrierter MCP-Skills-Wissensdatenbank und Redis-Frage-Cache-Beschleunigungsmechanismus.


🌟 Kernfunktionen

  1. Duale Laufzeitumgebung (Dual Runtime):

    • Cloudflare Workers: Unterstützt globale Edge-Bereitstellung mit extrem schnellem Kaltstart und geringer Latenz.

    • 🐳 Docker & Node.js: Bietet docker-compose.yml für den Ein-Klick-Start des MCP-Dienstes und des Redis-Containers.

  2. MCP-Skills-Wissensdatenbank:

    • Vollständige Einführung in MCP und MCP-Skills.

    • Detaillierter Vergleich der Unterschiede und Kombinationsmuster von Tools, Resources und Prompts.

    • Bietet Konfigurationsanleitungen für gängige Clients (Claude Desktop, Cursor, Zed, Cloudflare).

  3. Redis-Sofortantwort bei wiederholten Fragen (Smart Caching):

    • Wenn ein Benutzer eine Frage stellt, normalisiert das System die Frage automatisch und berechnet einen Cache-Schlüssel.

    • Cache-HIT: Gibt historische Cache-Ergebnisse direkt aus Redis in Millisekunden zurück und spart erheblich Tokens und Latenz.

    • Cache-MISS: Durchsucht die Wissensdatenbank, generiert eine vollständige Antwort und speichert sie automatisch in Redis.

    • Unterstützt automatisches Fallback auf In-Memory-Cache bei Redis-Ausfall (Memory Fallback), um hohe Verfügbarkeit zu gewährleisten.


🛠️ MCP-Tools und Fähigkeiten

Tool-Name

Beschreibung

explain_mcp_skill

Detaillierte Einführung in MCP und MCP-Skills sowie Unterschiede und Beispiele zu Tool/Resource/Prompt.

get_mcp_quickstart

Schnellstartanleitung für MCP in Claude Desktop, Cursor, Docker und Cloudflare.

list_mcp_concepts

Listet alle Kernkonzepte in der Wissensdatenbank auf.

ask_mcp_assistant

Intelligentes Frage-Antwort-Tool mit integriertem Redis-Cache; wiederholte Fragen werden direkt aus dem Cache blitzschnell beantwortet.

get_cache_stats

Zeigt die Anzahl der Cache-Treffer (Hits), Fehltreffer (Misses) und die Gesamtzahl der Einträge in Redis.

clear_mcp_cache

Leert die Cache-Einträge.


🚀 Schnellstart

Methode 1: Start mit Docker (einschließlich Redis)

# 啟動 MCP 服務與 Redis 容器
docker compose up --build -d

# 查看運行日誌
docker compose logs -f

# 停止服務
docker compose down

Nach dem Start des Dienstes:

  • Dienst-Startseite / Dashboard: http://localhost:3000/

  • MCP-Streaming-Kommunikationsendpunkt: http://localhost:3000/mcp oder http://localhost:3000/sse

  • Health-Check-Endpunkt: http://localhost:3000/health

  • REST-Frage-Antwort-API: POST http://localhost:3000/api/ask


Methode 2: Lokaler Entwicklungsmodus (Node.js)

# 安裝依賴
npm install

# 執行單元測試 (驗證 MCP Tools & 快取機制)
npm test

# 啟動本機開發伺服器
npm run dev:node

Methode 3: Bereitstellung auf Cloudflare Workers

1. Bei Cloudflare anmelden

Führen Sie im Terminal aus:

npx wrangler login

Der Browser öffnet sich automatisch zur Autorisierung des Cloudflare-Kontos.

Bei Anmeldung mit CI/CD oder API-Token:

export CLOUDFLARE_API_TOKEN="你的 Cloudflare API Token"
export CLOUDFLARE_ACCOUNT_ID="你的 Cloudflare Account ID"

2. Worker lokal simulieren und testen

npm run dev:worker

3. Auf das globale Cloudflare-Edge-Netzwerk bereitstellen

npm run deploy

Nach erfolgreicher Bereitstellung erhalten Sie eine eigene Worker-URL (z. B. https://cf-mcp-playground.<your-subdomain>.workers.dev/mcp).


🔌 Verwendung in AI-Clients

1. Claude-Desktop-Konfiguration

Bearbeiten Sie claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "cf-mcp-remote": {
      "url": "https://<your-worker>.workers.dev/sse"
    },
    "cf-mcp-docker": {
      "command": "docker",
      "args": ["exec", "-i", "cf-mcp-service", "node", "dist/node-server.js"]
    }
  }
}

2. Cursor-Konfiguration

Navigieren Sie in der Cursor-Oberfläche zu Settings -> Features -> MCP Servers -> Add New MCP Server:

  • Name: cf-mcp-service

  • Type: sse

  • URL: http://localhost:3000/sse (lokales Docker) oder https://<your-worker>.workers.dev/sse (Remote-Worker)


🧪 Test- und Verifizierungsbeispiele

1. REST-API-Frage testen (erste Frage - Cache-MISS)

curl -X POST http://localhost:3000/api/ask \
  -H "Content-Type: application/json" \
  -d '{"question": "什麼是 MCP Skill?"}'

2. Gleiche Frage testen (wiederholte Frage - Cache-HIT ⚡)

curl -X POST http://localhost:3000/api/ask \
  -H "Content-Type: application/json" \
  -d '{"question": "什麼是 MCP Skill?"}'

3. Cache-Statistiken anzeigen

curl http://localhost:3000/api/cache/stats
-
license - not tested
Not graded
quality - not tested
C
maintenance

Maintenance

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

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

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

  • AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.

  • Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.

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/tobytoy/cf-mcp-playground'

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