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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。