/ Annuaire / Playground / golf
● Communauté golf-mcp ⚡ Instantané

golf

par 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.

Pourquoi l'utiliser

Fonctionnalités clés

Démo en direct

Aperçu en pratique

golf.replay ▶ prêt
0/0

Installer

Choisissez votre client

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

Ouvrez Claude Desktop → Settings → Developer → Edit Config. Redémarrez après avoir enregistré.

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

Cursor utilise le même schéma mcpServers que Claude Desktop. La config projet l'emporte sur la globale.

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

Cliquez sur l'icône MCP Servers dans la barre latérale Cline, puis "Edit Configuration".

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

Même format que Claude Desktop. Redémarrez Windsurf pour appliquer.

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

Continue utilise un tableau d'objets serveur plutôt qu'une map.

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

Ajoutez dans context_servers. Zed recharge à chaud à la sauvegarde.

claude mcp add golf -- uvx golf

Une seule ligne. Vérifiez avec claude mcp list. Supprimez avec claude mcp remove.

Cas d'usage

Usages concrets : golf

Build an internal company MCP with Golf

👤 Platform engineers ⏱ ~60 min advanced

Quand l'utiliser : You want a single authenticated MCP exposing 20+ internal tools (Jira, Grafana, ticketing) to employees via Claude.

Prérequis
  • Python 3.11+, uv — astral.sh/uv
Déroulement
  1. Scaffold
    Run uvx golf new acme-mcp and cd in.✓ Copié
    → 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.✓ Copié
    → 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.✓ Copié
    → Unauthenticated calls rejected

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

Pièges
  • 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

Quand l'utiliser : You already run OTel collectors and want agent tool calls to appear in traces.

Déroulement
  1. Enable telemetry
    In golf.yaml, enable telemetry.otlp with your collector endpoint.✓ Copié
    → 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.✓ Copié
    → Per-user call graphs

Résultat : MCP usage is a first-class citizen in your existing observability.

Combiner avec : prometheus

Version prompts alongside code with Golf

👤 Prompt engineers ⏱ ~25 min intermediate

Quand l'utiliser : Your prompts live in a Notion and drift from what's actually deployed.

Déroulement
  1. Move prompts into prompts/ dir
    Create prompts/triage.py with a prompt template and variables.✓ Copié
    → 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✓ Copié
    → Regression safety for prompt edits

Résultat : Prompts ship through the same PR process as code.

Combinaisons

Associez-le à d'autres MCPs pour un effet X10

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.✓ Copié
golf + prometheus

Scrape Golf's metrics endpoint into Prometheus

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

Outils

Ce que ce MCP expose

OutilEntréesQuand appelerCoût
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

Coût et limites

Coût d'exécution

Quota d'API
None — framework runs wherever you host it
Tokens par appel
Depends on tools
Monétaire
Free, open source
Astuce
Enable telemetry sampling in production (e.g. 10% of tool calls) to control OTel ingest cost

Sécurité

Permissions, secrets, portée

Stockage des identifiants : JWT/OAuth secrets via env; Golf never logs them by default
Sortie de données : Wherever your tools call

Dépannage

Erreurs courantes et correctifs

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

Vérifier : 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

Vérifier : curl -v $OTLP_ENDPOINT/v1/traces

Alternatives

golf vs autres

AlternativeQuand l'utiliserCompromis
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

Plus

Ressources

📖 Lire le README officiel sur GitHub

🐙 Voir les issues ouvertes

🔍 Parcourir les 400+ serveurs MCP et Skills