Back to Home
golf-mcp icon

golf

by golf-mcp

Overview

Golf is a Python framework for building MCP (Model Context Protocol) servers, allowing developers to define tools, resources, and prompts as Python files to create runnable AI agent backends.

Installation

Run Command
golf run

Environment Variables

  • JWT_PUBLIC_KEY
  • JWKS_URI
  • JWT_ISSUER
  • JWT_AUDIENCE
  • OAUTH_BASE_URL
  • OAUTH_AUTH_ENDPOINT
  • OAUTH_TOKEN_ENDPOINT
  • OAUTH_CLIENT_ID
  • OAUTH_CLIENT_SECRET
  • AUTH_SERVERS
  • RESOURCE_URL
  • API_KEY
  • WEATHER_API_KEY
  • WEATHER_API_URL
  • WEATHER_TEMP_UNIT
  • HOST
  • PORT
  • GOLF_TELEMETRY
  • OTEL_TRACES_EXPORTER
  • OTEL_EXPORTER_OTLP_ENDPOINT

Security Notes

The `src/golf/examples/basic/tools/calculator.py` tool uses `eval()` to evaluate mathematical expressions. While it attempts to sanitize input with a character whitelist, `eval()` is inherently dangerous when processing untrusted input as it can lead to arbitrary code execution if not handled with extreme care and robust sanitization. The framework dynamically loads and executes user-provided `startup.py`, `middleware.py`, `health.py`, and `readiness.py` files, which means the overall security of a deployed server heavily depends on the security practices within the user's own project code. A default PostHog API key for anonymous telemetry is hardcoded in `src/golf/core/telemetry.py`, though it's a public client-side key and can be overridden by an environment variable. OAuth configurations include robust URL validation to mitigate SSRF and enforce HTTPS in production, which is a good security practice.

Similar Servers

Stats

Interest Score99
Security Score4
Cost ClassMedium
Avg Tokens750
Stars800
Forks63
Last Update2025-11-24

Tags

FrameworkMCP ServerAI AgentsPythonAPI Development