This NBA MCP server provides access to NBA statistics and live game data through the Model Context Protocol (MCP), serving as a bridge between applications and the NBA's data services.
Clone the repository:
git clone https://github.com/obinopaul/nba-mcp-server.git
cd nba-mcp-server
Install dependencies:
pip install -r requirements.txt
Build the Docker image:
docker build -t nba_mcp_server .
Run the Docker container:
docker run -d -p 5000:5000 --name nba_mcp_server nba_mcp_server
Add this to your claude_desktop_config.json
:
{
"mcpServers": {
"nba_mcp_server": {
"command": "docker",
"args": [
"exec",
"-i",
"nba_mcp_server",
"python",
"nba_server.py"
]
}
}
}
Clone the repository:
git clone https://github.com/obinopaul/nba-mcp-server.git
cd nba-mcp-server
Create a new environment:
conda create --name your_env_name python=3.13
conda activate your_env_name
Install dependencies:
pip install -r requirements.txt
Run the NBA MCP server:
mcp run nba_server.py
Add this to your claude_desktop_config.json
:
{
"mcpServers": {
"nba_mcp_server": {
"command": "/path/to/your/python",
"args": [
"/path/to/nba_server.py"
]
}
}
}
After configuration, restart Claude Desktop to load the NBA server.
Start the server:
python nba_server.py
# or
mcp run nba_server.py
The server runs with a 30-second timeout for more reliable operation and includes signal handlers for graceful shutdown (Ctrl+C).
Once configured and running, you can use all the NBA data tools in your conversations with Claude through Claude Desktop.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "nba_mcp_server" '{"command":"docker","args":["exec","-i","nba_mcp_server","python","nba_server.py"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"nba_mcp_server": {
"command": "docker",
"args": [
"exec",
"-i",
"nba_mcp_server",
"python",
"nba_server.py"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"nba_mcp_server": {
"command": "docker",
"args": [
"exec",
"-i",
"nba_mcp_server",
"python",
"nba_server.py"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect