# OpenGolfAPI MCP server

> Provides an open data layer for golf, allowing AI agents to search US courses, log shots, manage tournaments, and handle player identities.

- Repository: https://github.com/opengolfapi/mcp-server
- Page: https://hostedmcp.org/servers/opengolfapi/mcp-server
- Transport: stdio
- Stars: 4
- License: MIT
- Latest version: 3.5.1

## Install

### Claude Code

```sh
claude mcp add --env 'OPENGOLFAPI_KEY=<YOUR_OPENGOLFAPI_KEY>' mcp-server -- npx -y @opengolfapi/mcp-server
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@opengolfapi/mcp-server"
      ],
      "env": {
        "OPENGOLFAPI_KEY": "<YOUR_OPENGOLFAPI_KEY>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@opengolfapi/mcp-server"
      ],
      "env": {
        "OPENGOLFAPI_KEY": "<YOUR_OPENGOLFAPI_KEY>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"mcp-server","type":"stdio","command":"npx","args":["-y","@opengolfapi/mcp-server"],"env":{"OPENGOLFAPI_KEY":"<YOUR_OPENGOLFAPI_KEY>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@opengolfapi/mcp-server"
      ],
      "env": {
        "OPENGOLFAPI_KEY": "<YOUR_OPENGOLFAPI_KEY>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add mcp-server --env 'OPENGOLFAPI_KEY=<YOUR_OPENGOLFAPI_KEY>' -- npx -y @opengolfapi/mcp-server
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.mcp-server]
command = "npx"
args = ["-y", "@opengolfapi/mcp-server"]

[mcp_servers.mcp-server.env]
OPENGOLFAPI_KEY = "<YOUR_OPENGOLFAPI_KEY>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'OPENGOLFAPI_KEY=<YOUR_OPENGOLFAPI_KEY>' mcp-server npx -- -y @opengolfapi/mcp-server
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@opengolfapi/mcp-server"
      ],
      "env": {
        "OPENGOLFAPI_KEY": "<YOUR_OPENGOLFAPI_KEY>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `OPENGOLFAPI_KEY` | no | yes | Free key (courses.opengolfapi.org/api-keys). Optional — only for contributing/identity. |

## Tools (56)

- `search_courses`
- `get_course`
- `get_tees`
- `get_weather`
- `get_climate`
- `get_nearby`
- `log_shot`
- `submit_moment`
- `get_my_shots`
- `get_my_moments`
- `propose_correction`
- `respond_to_review`
- `get_correction`
- `how_to_build`
- `get_passport`
- `record_referral`
- `get_referrals`
- `about`
- `request_sign_in_code`
- `complete_sign_in`
- `create_dev_key`
- `sign_in_with_opengolf`
- `register_webhook`
- `create_tournament_invite`
- `join_tournament`
- `list_game_formats`
- `score_round`
- `plays_like`
- `get_conditions`
- `link_dev_key`
- `list_dev_keys`
- `get_profile`
- `update_profile`
- `get_awards`
- `set_beacon`
- `find_beacons`
- `record_consent`
- `create_competition`
- `list_competitions`
- `get_competition`
- `record_attempt`
- `finalize_competition`
- `broadcast_feed`
- `get_handicap`
- `get_showcase`
- `verify_record`
- `list_webhooks`
- `remove_webhook`
- `list_orgs`
- `mint_asset`
- `file_claim`
- `list_claims`
- `post_beta`
- `get_beta`
- `get_my_chain`
- `verify_chain`

## FAQ

### Do I need an API key to search for golf courses?

No, read tools like searching and comparing courses are free and work without a key.

### What can I do with an OPENGOLFAPI_KEY?

An API key enables contributing data like shots and moments, managing player identities, and running tournaments.

### How do I install the server for Claude Desktop?

You can add it to your `claude_desktop_config.json` file using the npx command provided in the configuration block.
