question-market
MCP server for question.market prediction markets on Algorand. Enables market browsing, wallet onboarding, and trading through natural language.
README
@questionmarket/mcp
MCP server for question.market prediction markets on Algorand.
The minimal config gives agents read access plus wallet onboarding. To enable trading and market creation outside the monorepo, you also need the deployment app IDs and USDC ASA ID.
Quick start
Read-only + onboarding
All env vars have sensible defaults (public indexer, public testnet algod, public faucet), so the minimal install needs no env block. This enables market browsing, holdings lookups, wallet creation, set_wallet, faucet requests, and ALGO balance checks.
Claude Code
claude mcp add --transport stdio --scope user \
question-market -- npx -y @questionmarket/mcp
Codex
codex mcp add question-market -- npx -y @questionmarket/mcp
JSON config
{
"mcpServers": {
"question-market": {
"command": "npx",
"args": ["-y", "@questionmarket/mcp"]
}
}
}
Override any of INDEXER_URL, ALGOD_SERVER, ALGOD_PORT, or ALGOD_TOKEN only if you need to point at a different endpoint.
Enable Trading And Create-Market
The published package ships with the current testnet deployment bundled. When ALGOD_SERVER points at a testnet endpoint (the default), the server auto-loads FACTORY_APP_ID, PROTOCOL_CONFIG_APP_ID, and USDC_ASA_ID from that bundle — you do not need to set them manually.
The only thing you still need to add for write tools is a signer:
AGENT_MNEMONIC— 25-word mnemonic preloaded at startup (best for unattended / CI use)- Runtime
set_wallet(mnemonic)— overridesAGENT_MNEMONICfor the current session; use this aftercreate_wallet - Localnet KMD fallback — only applies when neither of the above is set and you are pointing at a local sandbox
Example (testnet, with preloaded mnemonic):
{
"mcpServers": {
"question-market": {
"command": "npx",
"args": ["-y", "@questionmarket/mcp"],
"env": {
"AGENT_MNEMONIC": "your twenty five word mnemonic goes here ..."
}
}
}
}
Network selection. By default the server looks at ALGOD_SERVER to pick the bundled deployment (mainnet, testnet, or localnet). Override with QUESTION_MARKET_NETWORK=testnet|mainnet|localnet or point at a custom deployment file with QUESTION_MARKET_DEPLOYMENT_PATH. Env vars (USDC_ASA_ID, FACTORY_APP_ID, PROTOCOL_CONFIG_APP_ID) always win over the bundle.
Localnet. Run algokit localnet start, deploy the SDK (npm run deploy:localnet inside sdk/), and the resulting protocol-deployment.json will be auto-discovered. Alternatively, set QUESTION_MARKET_DEPLOYMENT_PATH=/absolute/path/to/protocol-deployment.json.
Verify it works
Ask your agent:
List five active question.market markets and show their current implied probabilities.
If you enabled write config, you can also ask:
Create a wallet, fund it on testnet, and buy $5 of outcome 0 in market 123.
Available tools
Read tools:
list_marketsget_marketget_price_historyget_market_tradesget_market_positionsget_positionsget_current_holdingsget_leaderboard
Onboarding tools:
create_walletset_walletrequest_testnet_tokensget_balance
Write tools:
buy_sharessell_sharesrefund_sharesclaim_winningsenter_lp_activeclaim_lp_feeswithdraw_lp_feesclaim_lp_residualcreate_market
The server only registers write tools when the required env vars are configured.
Environment variables
| Variable | Required | Description |
|---|---|---|
INDEXER_URL |
No | question.market API endpoint. Default: https://question.market/api |
ALGOD_SERVER |
No | Algorand node URL. Default: https://testnet-api.4160.nodely.dev |
ALGOD_PORT |
No | Algorand node port. Default: 443 |
ALGOD_TOKEN |
No | Algorand node auth token. Default: empty (correct for Nodely) |
USDC_ASA_ID |
No (auto from bundle) | USDC ASA ID. Required for trading, LP, claims, refunds, and USDC-aware balances. Auto-loaded from the bundled deployment matching ALGOD_SERVER |
FACTORY_APP_ID |
No (auto from bundle) | MarketFactory application ID. Required for create_market. Auto-loaded from the bundled deployment |
PROTOCOL_CONFIG_APP_ID |
No (auto from bundle) | ProtocolConfig application ID. Required for create_market. Auto-loaded from the bundled deployment |
AGENT_MNEMONIC |
No | 25-word mnemonic preloaded as the signer for write tools. Overridden by a runtime set_wallet call |
FAUCET_URL |
No | Override the faucet endpoint for request_testnet_tokens. Default: https://question.market/api/faucet |
INDEXER_AUTH |
No | Optional basic-auth credentials for self-hosted indexers |
INDEXER_WRITE_TOKEN |
No | Optional bearer token used only by create_market to persist blueprint JSON to the indexer's meta endpoint. Failures are non-fatal |
QUESTION_MARKET_NETWORK |
No | Force network selection (testnet, mainnet, or localnet) when auto-detection from ALGOD_SERVER is wrong |
QUESTION_MARKET_DEPLOYMENT_PATH |
No | Override path to a protocol-deployment.json used to auto-load FACTORY_APP_ID, PROTOCOL_CONFIG_APP_ID, and USDC_ASA_ID |
QUESTION_MARKET_DEPLOYMENT_OUT |
No | Same as above, used by some deploy scripts that write to a separate output path |
KMD_SERVER |
No | LocalNet KMD URL. Default: http://localhost |
KMD_PORT |
No | LocalNet KMD port. Default: 4002 |
KMD_TOKEN |
No | LocalNet KMD token. Default: 64 × a |
Built on
- @questionmarket/sdk -- TypeScript SDK for question.market contracts
- Model Context Protocol -- open standard for AI tool access
License
MIT
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。