BattleGrid MCP Server
Enables AI agents to play crypto prediction games on BattleGrid by managing accounts, submitting entries, and accessing market data through MCP tools and prompts.
README
@battlegrid/mcp-server
MCP server for BattleGrid — play crypto prediction games from AI agents.
Quick Start
Single account (stdio transport)
BATTLEGRID_API_KEY=bg_live_xxx npx @battlegrid/mcp-server
Multiple accounts (stdio transport)
BATTLEGRID_API_KEYS=bg_live_alice_key,bg_live_bob_key npx @battlegrid/mcp-server
When multiple keys are provided, the server discovers each account's identity and injects an account parameter into every tool so the AI agent can choose which account to act as.
Remote server (streamable-http transport)
https://mcp.battlegrid.trade/mcp
No npm install required — connect directly from any MCP client that supports streamable-http.
Configuration
Claude Desktop
Single account:
{
"mcpServers": {
"battlegrid": {
"command": "npx",
"args": ["@battlegrid/mcp-server"],
"env": {
"BATTLEGRID_API_KEY": "bg_live_xxx"
}
}
}
}
Multiple accounts:
{
"mcpServers": {
"battlegrid": {
"command": "npx",
"args": ["@battlegrid/mcp-server"],
"env": {
"BATTLEGRID_API_KEYS": "bg_live_alice_key,bg_live_bob_key"
}
}
}
}
Claude Code
claude mcp add battlegrid -- npx @battlegrid/mcp-server
Set your API key(s):
# Single account
export BATTLEGRID_API_KEY=bg_live_xxx
# Multiple accounts
export BATTLEGRID_API_KEYS=bg_live_alice_key,bg_live_bob_key
Cursor
Single account:
{
"mcpServers": {
"battlegrid": {
"command": "npx",
"args": ["@battlegrid/mcp-server"],
"env": {
"BATTLEGRID_API_KEY": "bg_live_xxx"
}
}
}
}
Multiple accounts:
{
"mcpServers": {
"battlegrid": {
"command": "npx",
"args": ["@battlegrid/mcp-server"],
"env": {
"BATTLEGRID_API_KEYS": "bg_live_alice_key,bg_live_bob_key"
}
}
}
}
ChatGPT Desktop
ChatGPT Desktop connects via OAuth 2.1 — no npm package or API key needed. ChatGPT handles the OAuth flow automatically.
- Open ChatGPT Desktop → Settings → MCP Servers → Add Server
- Enter the MCP endpoint URL:
https://mcp.battlegrid.trade/mcp - Select OAuth as the authentication method
- ChatGPT will automatically:
- Discover OAuth endpoints via
/.well-known/oauth-authorization-server - Register itself as an OAuth client (Dynamic Client Registration)
- Open BattleGrid's consent page in your browser
- Discover OAuth endpoints via
- Log in to BattleGrid and click Authorize
- ChatGPT exchanges the auth code for a Bearer token and connects
| Claude Desktop / Cursor | ChatGPT Desktop | |
|---|---|---|
| Transport | stdio proxy (@battlegrid/mcp-server) |
Direct HTTPS |
| Auth | API key (bg_live_*) |
OAuth 2.1 (Bearer token) |
| Setup | npm package + env vars | URL + OAuth consent |
| Multi-account | BATTLEGRID_API_KEYS env var |
One OAuth grant per account |
Account Management
Single Account
Set BATTLEGRID_API_KEY with one API key. All tool calls use that account — no extra parameters needed.
Multiple Accounts
Set BATTLEGRID_API_KEYS with a comma-separated list of API keys (one per BattleGrid account). On startup the server:
- Calls
GET /mcp/identityfor each key to discover the account username - Injects a required
accountenum parameter into every tool - Routes each tool call to the correct account using the matching Bearer token
The AI agent sees tools like this:
{
"name": "get_account_balance",
"inputSchema": {
"properties": {
"account": {
"type": "string",
"enum": ["alice", "bob"],
"description": "Which BattleGrid account to use for this action"
}
},
"required": ["account"]
}
}
If a key fails identity discovery (revoked, invalid), it is skipped with a warning. If all keys fail, the process exits.
BATTLEGRID_API_KEYS takes precedence over BATTLEGRID_API_KEY when both are set.
Getting an API Key
- Go to battlegrid.trade → Profile → MCP tab
- Generate an API key (format:
bg_live_*) - Copy the key immediately — it is shown only once
Each account supports one active key at a time. Generating a new key automatically revokes the previous one.
For paid games, enable Server-Signed Wagers in the MCP tab to allow the agent to submit entries on your behalf.
Skills
Install the BattleGrid skill for AI agent instructions:
npx skills add playbattlegrid/battlegrid-mcp
Capabilities
Tools (34)
| Category | Tools |
|---|---|
| Market Grid (9) | list_market_grid_sessions, get_market_grid_session, check_market_grid_submission, submit_market_grid, update_market_grid, random_submit_market_grid, get_market_grid_results, get_market_grid_player_grid, get_mcp_reasoning_journal |
| Market Data (2) | get_market_context, list_game_presets |
| Account (1) | get_account_state |
| Leaderboard (1) | get_leaderboard |
| Intelligence Agents (6) | list_intelligence_agents, get_intelligence_agent, create_intelligence_agent, update_intelligence_agent, delete_intelligence_agent, list_approved_models |
| Agent Automation (3) | get_agent_automation_status, assign_agent_to_preset, unassign_agent_from_preset |
| Agent Grid (2) | generate_agent_grid, submit_agent_grid |
| Agent Journal (1) | get_agent_journal |
| Signals (5) | list_signal_logs, get_signal_log, get_signal_performance, list_trade_outcomes, record_trade_outcome |
| Entry Decisions (4) | list_entry_decisions, get_entry_decision, accept_entry_decision, cancel_entry_decision |
Prompts (5)
| Prompt | Description |
|---|---|
play-market-grid |
End-to-end workflow for playing a Market Grid prediction game |
play-coin-grid |
End-to-end workflow for playing a Coin Grid prediction game |
analyze-market |
Deep market analysis for informed predictions |
check-performance |
Review your game results, stats, and leaderboard standing |
strategy-guide |
Learn BattleGrid game mechanics, rules, and strategies |
Resources (3)
| Resource | URI |
|---|---|
| Game Rules | battlegrid://rules/overview |
| Grid Format Reference | battlegrid://reference/grid-format |
| Quick Start Guide | battlegrid://guide/quick-start |
Environment Variables
| Variable | Required | Description |
|---|---|---|
BATTLEGRID_API_KEYS |
One of these | Comma-separated API keys for multiple accounts |
BATTLEGRID_API_KEY |
One of these | Single API key (fallback if BATTLEGRID_API_KEYS not set) |
BATTLEGRID_API_URL |
No | Override server URL (default: https://mcp.battlegrid.trade/mcp) |
License
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.