/ Verzeichnis / Playground / golf
● Community golf-mcp ⚡ Sofort

golf

von golf-mcp · golf-mcp/golf

Python framework for shipping production-grade MCP servers — auto-discovery of tool files, built-in auth (JWT/OAuth/API key), and OpenTelemetry out of the box.

Golf (golf-mcp) lets you define MCP tools as plain Python files in conventional directories; the framework compiles them into a production server with auth, telemetry, and logging handled. Aimed at teams that need an internal MCP platform, not a one-off script.

Warum nutzen

Hauptfunktionen

Live-Demo

In der Praxis

golf.replay ▶ bereit
0/0

Installieren

Wählen Sie Ihren Client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "golf": {
      "command": "uvx",
      "args": [
        "golf"
      ],
      "_inferred": true
    }
  }
}

Öffne Claude Desktop → Settings → Developer → Edit Config. Nach dem Speichern neu starten.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "golf": {
      "command": "uvx",
      "args": [
        "golf"
      ],
      "_inferred": true
    }
  }
}

Cursor nutzt das gleiche mcpServers-Schema wie Claude Desktop. Projektkonfiguration schlägt die globale.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "golf": {
      "command": "uvx",
      "args": [
        "golf"
      ],
      "_inferred": true
    }
  }
}

Klicken Sie auf das MCP-Servers-Symbol in der Cline-Seitenleiste, dann "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "golf": {
      "command": "uvx",
      "args": [
        "golf"
      ],
      "_inferred": true
    }
  }
}

Gleiche Struktur wie Claude Desktop. Windsurf neu starten zum Übernehmen.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "golf",
      "command": "uvx",
      "args": [
        "golf"
      ]
    }
  ]
}

Continue nutzt ein Array von Serverobjekten statt einer Map.

~/.config/zed/settings.json
{
  "context_servers": {
    "golf": {
      "command": {
        "path": "uvx",
        "args": [
          "golf"
        ]
      }
    }
  }
}

In context_servers hinzufügen. Zed lädt beim Speichern neu.

claude mcp add golf -- uvx golf

Einzeiler. Prüfen mit claude mcp list. Entfernen mit claude mcp remove.

Anwendungsfälle

Praxisnahe Nutzung: golf

Build an internal company MCP with Golf

👤 Platform engineers ⏱ ~60 min advanced

Wann einsetzen: You want a single authenticated MCP exposing 20+ internal tools (Jira, Grafana, ticketing) to employees via Claude.

Voraussetzungen
  • Python 3.11+, uv — astral.sh/uv
Ablauf
  1. Scaffold
    Run uvx golf new acme-mcp and cd in.✓ Kopiert
    → Project with tools/, prompts/, resources/ dirs
  2. Drop in tool files
    Create tools/list_tickets.py exporting an async function. Golf wires the schema automatically.✓ Kopiert
    → Tool visible at /tools list
  3. Enable JWT auth tied to your IdP
    Configure golf.yaml auth: jwt with your IdP's JWKS URL. Require mcp:use scope.✓ Kopiert
    → Unauthenticated calls rejected

Ergebnis: A deployable MCP that only authorized employees can call, with traces flowing to your APM.

Fallstricke
  • Each tool import failure breaks server startup — Golf loads tools eagerly — fix import errors or move heavy deps inside the function

Ship an MCP with OpenTelemetry from day one

👤 SREs, observability engineers ⏱ ~30 min advanced

Wann einsetzen: You already run OTel collectors and want agent tool calls to appear in traces.

Ablauf
  1. Enable telemetry
    In golf.yaml, enable telemetry.otlp with your collector endpoint.✓ Kopiert
    → Tool calls appear as spans in your OTel backend
  2. Tag traces with user id from auth
    Add a middleware that sets user.id on each span from the JWT sub.✓ Kopiert
    → Per-user call graphs

Ergebnis: MCP usage is a first-class citizen in your existing observability.

Kombinieren mit: prometheus

Version prompts alongside code with Golf

👤 Prompt engineers ⏱ ~25 min intermediate

Wann einsetzen: Your prompts live in a Notion and drift from what's actually deployed.

Ablauf
  1. Move prompts into prompts/ dir
    Create prompts/triage.py with a prompt template and variables.✓ Kopiert
    → Prompt appears in MCP /prompts/list
  2. CI-verify on every commit
    Add a test that renders each prompt with sample inputs to catch breaking changes✓ Kopiert
    → Regression safety for prompt edits

Ergebnis: Prompts ship through the same PR process as code.

Kombinationen

Mit anderen MCPs für 10-fache Wirkung

golf + hyper

Compare a Python-based Golf server against a WASM hyper-mcp plugin model

I have the same tool in Golf and hyper-mcp. Run latency & memory comparison across 100 calls each.✓ Kopiert
golf + prometheus

Scrape Golf's metrics endpoint into Prometheus

Point my Prometheus at golf's /metrics, then query p99 tool latency with prometheus-mcp.✓ Kopiert

Werkzeuge

Was dieses MCP bereitstellt

WerkzeugEingabenWann aufrufenKosten
golf new <name> project_name: str Start a new server 0
golf build Compile tool directories into a server binary/image 0
golf run --transport stdio|http Local dev or production launch 0

Kosten & Limits

Was der Betrieb kostet

API-Kontingent
None — framework runs wherever you host it
Tokens pro Aufruf
Depends on tools
Kosten in €
Free, open source
Tipp
Enable telemetry sampling in production (e.g. 10% of tool calls) to control OTel ingest cost

Sicherheit

Rechte, Secrets, Reichweite

Credential-Speicherung: JWT/OAuth secrets via env; Golf never logs them by default
Datenabfluss: Wherever your tools call

Fehlerbehebung

Häufige Fehler und Lösungen

Tool not showing in tools list

Check the file exports the async function with the exact name Golf expects (see framework docs); missing __tool__ metadata is the most common cause

Prüfen: golf run --debug shows discovery log
JWT validation fails with valid token

JWKS URL unreachable or wrong issuer. Verify with curl; check clock skew on host

Traces not appearing in OTel backend

Golf uses OTLP/HTTP — ensure collector has that receiver enabled, not just gRPC

Prüfen: curl -v $OTLP_ENDPOINT/v1/traces

Alternativen

golf vs. andere

AlternativeWann stattdessenKompromiss
FastMCPYou want something simpler without auth/telemetry featuresBYO production concerns
MCP-Nest (NestJS)Your team is a NestJS shopTypeScript only
ArcadeFocus on distribution/sharing as much as buildingSlightly different target audience

Mehr

Ressourcen

📖 Offizielle README auf GitHub lesen

🐙 Offene Issues ansehen

🔍 Alle 400+ MCP-Server und Skills durchsuchen