/ Каталог / Песочница / golf
● Сообщество golf-mcp ⚡ Сразу

golf

автор 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.

Зачем использовать

Ключевые функции

Живое демо

Как выглядит на практике

golf.replay ▶ готово
0/0

Установка

Выберите клиент

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

Откройте Claude Desktop → Settings → Developer → Edit Config. Перезапустите после сохранения.

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

Cursor использует ту же схему mcpServers, что и Claude Desktop. Конфиг проекта приоритетнее глобального.

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

Щёлкните значок MCP Servers на боковой панели Cline, затем "Edit Configuration".

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

Тот же формат, что и Claude Desktop. Перезапустите Windsurf для применения.

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

Continue использует массив объектов серверов, а не map.

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

Добавьте в context_servers. Zed перезагружается автоматически.

claude mcp add golf -- uvx golf

Однострочная команда. Проверить: claude mcp list. Удалить: claude mcp remove.

Сценарии использования

Реальные сценарии: golf

Build an internal company MCP with Golf

👤 Platform engineers ⏱ ~60 min advanced

Когда использовать: You want a single authenticated MCP exposing 20+ internal tools (Jira, Grafana, ticketing) to employees via Claude.

Предварительные требования
  • Python 3.11+, uv — astral.sh/uv
Поток
  1. Scaffold
    Run uvx golf new acme-mcp and cd in.✓ Скопировано
    → 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.✓ Скопировано
    → 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.✓ Скопировано
    → Unauthenticated calls rejected

Итог: A deployable MCP that only authorized employees can call, with traces flowing to your APM.

Подводные камни
  • 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

Когда использовать: You already run OTel collectors and want agent tool calls to appear in traces.

Поток
  1. Enable telemetry
    In golf.yaml, enable telemetry.otlp with your collector endpoint.✓ Скопировано
    → 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.✓ Скопировано
    → Per-user call graphs

Итог: MCP usage is a first-class citizen in your existing observability.

Сочетать с: prometheus

Version prompts alongside code with Golf

👤 Prompt engineers ⏱ ~25 min intermediate

Когда использовать: Your prompts live in a Notion and drift from what's actually deployed.

Поток
  1. Move prompts into prompts/ dir
    Create prompts/triage.py with a prompt template and variables.✓ Скопировано
    → 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✓ Скопировано
    → Regression safety for prompt edits

Итог: Prompts ship through the same PR process as code.

Комбинации

Сочетайте с другими MCP — эффект 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.✓ Скопировано
golf + prometheus

Scrape Golf's metrics endpoint into Prometheus

Point my Prometheus at golf's /metrics, then query p99 tool latency with prometheus-mcp.✓ Скопировано

Инструменты

Что предоставляет этот MCP

ИнструментВходные данныеКогда вызыватьСтоимость
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

Стоимость и лимиты

Во что обходится

Квота API
None — framework runs wherever you host it
Токенов на вызов
Depends on tools
Деньги
Free, open source
Совет
Enable telemetry sampling in production (e.g. 10% of tool calls) to control OTel ingest cost

Безопасность

Права, секреты, радиус поражения

Хранение учётных данных: JWT/OAuth secrets via env; Golf never logs them by default
Исходящий трафик: Wherever your tools call

Устранение неполадок

Частые ошибки и исправления

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

Проверить: 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

Проверить: curl -v $OTLP_ENDPOINT/v1/traces

Альтернативы

golf в сравнении

АльтернативаКогда использоватьКомпромисс
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

Ещё

Ресурсы

📖 Читать официальный README на GitHub

🐙 Открытые задачи

🔍 Все 400+ MCP-серверов и Skills