Endpoint and key
The server speaks the Model Context Protocol (MCP) over Streamable HTTP at:
https://mcp.golfdata.io/mcp
Send your API key in the Authorization header as Bearer <key>, the same key as for the REST API. No key yet? Create an account and make one on your account page; the free trial works here too. A separate key for the assistant lets you turn it off on its own.
The key goes in the client's settings, not in the chat: the assistant never sees it. Keep it in an environment variable or let the client ask for it, as in the examples below.
Add it to your assistant
Claude Code
With your key in GOLFDATA_KEY:
claude mcp add --transport http golfdata https://mcp.golfdata.io/mcp \
--header "Authorization: Bearer $GOLFDATA_KEY"Cursor
In .cursor/mcp.json in your project, or ~/.cursor/mcp.json for every project. Cursor fills in GOLFDATA_KEY from your environment.
{
"mcpServers": {
"golfdata": {
"url": "https://mcp.golfdata.io/mcp",
"headers": { "Authorization": "Bearer ${env:GOLFDATA_KEY}" }
}
}
}VS Code
In .vscode/mcp.json. VS Code asks for the key the first time and keeps it in its own secret storage.
{
"inputs": [
{
"type": "promptString",
"id": "golfdata-key",
"description": "golfdata.io API key",
"password": true
}
],
"servers": {
"golfdata": {
"type": "http",
"url": "https://mcp.golfdata.io/mcp",
"headers": { "Authorization": "Bearer ${input:golfdata-key}" }
}
}
}Claude Desktop
Through mcp-remote, which runs with Node and passes the header on. Replace your-key with your key.
{
"mcpServers": {
"golfdata": {
"command": "npx",
"args": [
"-y", "mcp-remote", "https://mcp.golfdata.io/mcp",
"--header", "Authorization:${GOLFDATA_AUTH}"
],
"env": { "GOLFDATA_AUTH": "Bearer your-key" }
}
}
}Any other client that speaks Streamable HTTP and lets you set a header works the same way. Connectors that only offer a sign-in with OAuth, and no header, cannot use the server yet.
Tools
Every tool only reads, and answers with the same JSON as the REST endpoint next to it.
| Tool | What it answers | Counts |
|---|---|---|
search_clubs | Clubs by name, town or region, or near a point, with their courses. Same as GET /v1/clubs. | Free |
get_club | One club with its courses, position, address and website. | Free |
search_courses | Course summaries by name, or all courses of a country. Same as GET /v1/courses. | Free |
get_course | The whole scorecard: par and stroke index per hole, every tee with its lengths, course rating and slope. | 1 course request |
get_courses | Up to 25 scorecards in one call. Same as GET /v1/courses/batch. | 1 per course found |
get_green_positions | The middle of each green, where the course has them. | 1 more course request, when there are any |
list_countries | Every country code with its number of courses and clubs. | Free |
list_changes | What was added, changed and removed since a release. | Free |
list_releases | The release history with each data_version. | Free |
get_usage | Your plan and how many course requests are left. | Free |
The counting is the same as for the REST API: only course data counts, and searching never does. The server tells the assistant to search first and fetch only the courses you ask for, and each answer that counts says how many course requests are left. See pricing for the plans.
Things to ask
- What is the course rating and slope from the blue tees at Kilmacolm, for men and for women?
- Find the golf clubs within 20 km of Málaga and list their 18-hole courses with par.
- Give me the scorecard of the Old Course at St Andrews in yards, as a table.
- Which holes at this course are par 5, and what is their stroke index?
- Build a handicap calculator for my app that uses the golfdata.io API, and test it against a real course.
The last one is where the server helps most when you write code: the assistant can look at real answers while it builds against the API reference.
When something goes wrong
An error from the API comes back to the assistant as a tool error with the status, the error code and what to do: a missing or wrong key, an id that does not exist or has been withdrawn, or a quota that is used up. A replaced id is followed to its new id, and the answer says so. Missing values are null, never 0 and never estimated, the same as in the REST API.