Golf
Enables automatic OpenTelemetry tracing for the MCP server, with configurable OTLP export and optional detailed input/output tracing.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Golfscaffold a new project called my-server"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Overview
Golf is a framework designed to streamline the creation of MCP server applications. It allows developers to define server's capabilities—tools, prompts, and resources—as simple Python files within a conventional directory structure. Golf then automatically discovers, parses, and compiles these components into a runnable MCP server, minimizing boilerplate and accelerating development.
Golf targets FastMCP 4.0.0 and the current MCP 2026-07-28 protocol. FastMCP also negotiates legacy MCP clients through its compatibility mode.
With Golf v0.2.0, you get enterprise-grade authentication (JWT, OAuth Server, development tokens), built-in utilities for LLM interactions, and automatic telemetry integration. Focus on implementing your agent's logic while Golf handles authentication, monitoring, and server infrastructure.
Related MCP server: mcp-starter-kit
Quick Start
Get your Golf project up and running in a few simple steps:
1. Install Golf
Golf requires Python 3.10 or newer. Then, install Golf using pip:
pip install golf-mcp2. Initialize Your Project
Use the Golf CLI to scaffold a new project:
golf init your-project-nameThis command creates a new directory (your-project-name) with a basic project structure, including example tools, resources, and a golf.json configuration file.
3. Run the Development Server
Navigate into your new project directory and start the development server:
cd your-project-name
golf build dev
golf runThis will start the MCP server, typically on http://localhost:3000 (configurable in golf.json).
That's it! Your Golf server is running and ready for integration.
Basic Project Structure
A Golf project initialized with golf init will have a structure similar to this:
<your-project-name>/
│
├─ golf.json # Main project configuration
│
├─ tools/ # Directory for tool implementations
│ └─ hello.py # Example tool
│
├─ resources/ # Directory for resource implementations
│ └─ info.py # Example resource
│
├─ prompts/ # Directory for prompt templates
│ └─ welcome.py # Example prompt
│
├─ .env # Environment variables (e.g., API keys, server port)
└─ auth.py # Authentication configuration (JWT, OAuth Server, API key, dev tokens)golf.json: Configures server name, port, transport, telemetry, and other build settings.auth.py: Dedicated authentication configuration file (new in v0.2.0, breaking change from v0.1.x authentication API) for JWT, OAuth Server, API key, or development authentication.tools/,resources/,prompts/: Contain your Python files, each defining a single component. These directories can also contain nested subdirectories to further organize your components (e.g.,tools/payments/charge.py). The module docstring of each file serves as the component's description.Component IDs are automatically derived from their file path. For example,
tools/hello.pybecomeshello, and a nested file liketools/payments/submit.pywould becomesubmit_payments(filename, followed by reversed parent directories under the main category, joined by underscores).
Example: Defining a Tool
Creating a new tool is as simple as adding a Python file to the tools/ directory. The example tools/hello.py in the boilerplate looks like this:
# tools/hello.py
"""Hello World tool {{project_name}}."""
from typing import Annotated
from pydantic import BaseModel, Field
class Output(BaseModel):
"""Response from the hello tool."""
message: str
async def hello(
name: Annotated[str, Field(description="The name of the person to greet")] = "World",
greeting: Annotated[str, Field(description="The greeting phrase to use")] = "Hello"
) -> Output:
"""Say hello to the given name.
This is a simple example tool that demonstrates the basic structure
of a tool implementation in Golf.
"""
print(f"{greeting} {name}...")
return Output(message=f"{greeting}, {name}!")
# Designate the entry point function
export = helloGolf will automatically discover this file. The module docstring """Hello World tool {{project_name}}.""" is used as the tool's description. It infers parameters from the hello function's signature and uses the Output Pydantic model for the output schema. The tool will be registered with the ID hello.
Authentication & Features
Golf includes enterprise-grade authentication, built-in utilities, and automatic telemetry:
# auth.py - Configure authentication
from golf.auth import configure_auth, JWTAuthConfig, StaticTokenConfig, OAuthServerConfig
# JWT authentication (production)
configure_auth(JWTAuthConfig(
jwks_uri_env_var="JWKS_URI",
issuer_env_var="JWT_ISSUER",
audience_env_var="JWT_AUDIENCE",
required_scopes=["read", "write"]
))
# OAuth Server mode (Golf acts as OAuth 2.0 server)
# configure_auth(OAuthServerConfig(
# base_url="https://your-golf-server.com",
# valid_scopes=["read", "write", "admin"]
# ))
# Static tokens (development only)
# configure_auth(StaticTokenConfig(
# tokens={"dev-token": {"client_id": "dev", "scopes": ["read"]}}
# ))
# Built-in utilities available in all tools
from golf.utilities import elicit, sample, get_current_contextOn MCP 2026-07-28, elicitation and sampling use caller-owned multi-round-trip
control flow. A nested helper cannot transparently continue the containing
tool: declare InputRequiredResult in the tool's return type and return any
such result unchanged. The tool is then re-entered with the answer. Legacy
connections continue to use imperative requests.
from mcp_types import InputRequiredResult
from golf.utilities import sample
async def explain(topic: str) -> str | InputRequiredResult:
result = await sample(f"Explain {topic}")
if isinstance(result, InputRequiredResult):
return result
return resultJWT authentication requires an audience so tokens are bound to this MCP resource. Inbound MCP JWT/OAuth bearer tokens must never be forwarded to an upstream API; use a separate upstream credential or a standards-based token exchange/delegation flow.
# Enable OpenTelemetry tracing
export OTEL_TRACES_EXPORTER="otlp_http"
export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318/v1/traces"
golf run # ✅ Telemetry enabledConfiguration
Basic configuration in golf.json:
{
"name": "My Golf Server",
"host": "localhost",
"port": 3000,
"transport": "streamable-http",
"opentelemetry_enabled": false,
"detailed_tracing": false
}transport: Use"streamable-http"or"stdio". SSE remains available only as a deprecated legacy transport.stateless_http: Optional legacy Streamable HTTP behavior. MCP 2026-07-28 is intrinsically sessionless and does not depend on this setting.opentelemetry_enabled: Enable OpenTelemetry tracingdetailed_tracing: Capture input/output (use carefully with sensitive data)
Privacy & Telemetry
Golf collects anonymous usage data on the CLI to help us understand how the framework is being used and improve it over time. The data collected includes:
Commands run (init, build, run)
Success/failure status (no error details)
Golf version, Python version (major.minor only), and OS type
Template name (for init command only)
Build environment (dev/prod for build commands only)
No personal information, project names, code content, or error messages are ever collected.
Opting Out
You can disable telemetry in several ways:
Using the telemetry command (recommended):
golf telemetry disableThis saves your preference permanently. To re-enable:
golf telemetry enableDuring any command: Add
--no-telemetryto save your preference:golf init my-project --no-telemetry
Your telemetry preference is stored in ~/.golf/telemetry.json and persists across all Golf commands.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
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 building and testing AI agents with multi-model experimentation and insights.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
MCP-first toolbox for agents: KV storage, auth, queue, and utility tools. Free in early access.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceA production-ready framework for building enterprise-grade MCP servers featuring integrated OAuth 2.0 authentication and modular architectural patterns. It simplifies the creation of secure, standardized tools that allow AI assistants to interact with complex upstream platforms like Salesforce and NetSuite.81MIT
- AlicenseAqualityCmaintenanceA production-ready foundation for building secure, observable MCP servers with built-in authentication, rate limiting, and reference tools like database-query and semantic-search.1537MIT
- FlicenseNot gradedqualityCmaintenanceA MCP server framework with zero-config auto-discovery, type-safe decorators, and HTTP transport, enabling easy creation and deployment of tools, prompts, and resources to LeanMCP Cloud.-
- AlicenseNot gradedqualityAmaintenanceA TypeScript framework for building MCP servers with declarative tool, resource, and prompt definitions, built-in auth, multi-backend storage, and observability.13,671150Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/golf-mcp/golf'
If you have feedback or need assistance with the MCP directory API, please join our Discord server