bb-gnubg-mcp
Provides tools for analyzing backgammon positions, evaluating moves, and running rollouts using the GNU Backgammon neural network engine.
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., "@bb-gnubg-mcpAnalyze this backgammon position: 4HPwATDgc/ABMA"
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.
bb-gnubg-mcp
MCP server wrapping the GNU Backgammon neural network evaluation engine. Exposes 18 tools for position analysis, move evaluation, rollouts, and board conversion via the Model Context Protocol.
Requirements
Python 3.13+
Related MCP server: Chess MCP
Installation
git clone <repo-url>
cd bb-gnubg-mcp
uv syncRunning Locally (stdio)
The default transport is stdio, suitable for use with Claude Code and other MCP clients:
uv run python -m bb_gnubg_mcpOr via the installed script:
uv run bb-gnubg-mcpClaude Code Configuration
Add to your Claude Code MCP settings:
{
"mcpServers": {
"bb-gnubg-mcp": {
"command": "uv",
"args": ["run", "--directory", "/path/to/bb-gnubg-mcp", "python", "-m", "bb_gnubg_mcp"]
}
}
}Running Locally (HTTP)
For HTTP transport with API key authentication:
export MCP_TRANSPORT=http
export API_KEY=your-secret-key
export PORT=8000 # optional, defaults to 8000
uv run python -m bb_gnubg_mcpThe server starts on http://0.0.0.0:8000 with:
Streamable HTTP MCP transport
Bearer token auth on all tool calls (pass
Authorization: Bearer <API_KEY>)Health check at
GET /health
Docker
Build
docker build -t bb-gnubg-mcp .Run
docker run -p 10000:10000 \
-e API_KEY=your-secret-key \
bb-gnubg-mcpThe Dockerfile uses a multi-stage build with uv. The image defaults to HTTP transport on port 10000.
Override settings
docker run -p 8080:8080 \
-e API_KEY=your-secret-key \
-e PORT=8080 \
-e MAX_ROLLOUT_GAMES=5000 \
bb-gnubg-mcpDeploy to Render
Push this repo to GitHub.
In the Render dashboard, click New > Blueprint and connect your GitHub repo.
Render detects
render.yamland creates the service automatically.Set the
API_KEYenvironment variable in the Render dashboard (it's markedsync: falsein the Blueprint so it won't be committed to source).Deploy. The health check at
/healthconfirms the service is running.
Alternatively, create the service manually:
New > Web Service in Render.
Connect your GitHub repo.
Set Environment to Docker.
Add environment variables:
MCP_TRANSPORT=httpPORT=10000API_KEY= your secret key
Set Health Check Path to
/health.Deploy.
Auto-deploy is enabled — pushing to the connected branch triggers a new deployment.
Tools
Board Conversion
Tool | Description |
| Position ID string to 2x25 board |
| Position key string to 2x25 board |
| Board (any format) to Position ID |
| Board (any format) to position key |
Position Analysis
Tool | Description |
| Classify position type (contact, race, bearoff, etc.) |
| Win/gammon/backgammon probabilities via neural net |
| Fast heuristic evaluation score |
Move Evaluation
Tool | Description |
| Best move with alternatives, probabilities, and equity |
| Best move via fast public evaluation |
| All legal moves for a position and dice roll |
Simulation
Tool | Description |
| Cubeless Monte Carlo rollout |
| Cubeful Monte Carlo rollout |
Bearoff
Tool | Description |
| Bearoff ID to 6-point position |
| Probability distribution for bearing off in N moves |
| Win probability for single-checker bearoff |
Utility
Tool | Description |
| Roll two dice |
| Match equity table lookup |
| List all GNUBG constant names and values |
Board Input Formats
All tools that accept a board position support three formats:
JSON boardState (matching the bb-plays-mcp convention):
{
"board": {
"x": {"24": 2, "13": 5, "8": 3, "6": 5},
"o": {"24": 2, "13": 5, "8": 3, "6": 5}
},
"player": "x"
}Position ID (14-character GNUBG string):
"4HPwATDgc/ABMA"Raw 2x25 array (as returned by gnubg):
[[0,0,0,0,0,5,0,3,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,2,0],
[0,0,0,0,0,5,0,3,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,2,0]]Environment Variables
Variable | Default | Description |
|
| Transport mode: |
| — | Required for HTTP mode. Bearer token for auth. |
|
| HTTP listen port |
|
| Maximum games per rollout call |
Tests
uv run pytest # all tests (rollouts are slow)
uv run pytest -m "not slow" # skip rollout testsThis 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.
Latest Blog Posts
- 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/hbomze/bb-gnubg-api-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server