预测市场mcp
](https://www.npmjs.com/package/prediction-market-mcp) 
最小化 MCP服务器 这暴露了SimpleFunctions的公共预测市场 API到任何MCP客户端-Claude Desktop,Cursor,Windsurf,VS Code Copilot, mcp-cli。七个工具,没有授权,没有速率限制,没有API密钥。
npx prediction-market-mcp______________________________________________________________________
工具
所有七个工具都使用公共的SimpleFunctions API。 没有API密钥,没有速率限制, 没有身份验证。 以下每个端点都经过实时验证。
| 工具 | 端点 | 何时使用 |
|---|---|---|
get_context | /api/public/context | 从这里开始。 单捆绑:边缘、推动者、亮点、传统市场背景。 |
get_world_state | /api/agent/world | 所有市场的约800个代币压缩快照,非常适合系统快速注入。 |
get_world_changes | /api/agent/world/delta | 约30-50个代币增量增量增量——廉价轮询。 |
get_market_edges | /api/edges | 原始错误定价(论文价格与市场价格)及其推理。 |
get_uncertainty_index | /api/public/index | 单一数字脉冲:不确定性、地缘政治风险、势头、活动。 |
get_market_detail | /api/public/markets?tickers= | 一个市场的全部细节(价格、买卖、交易量、可选订单深度)。 |
get_ideas | /api/public/ideas | 法学硕士以信念、催化剂和时间范围产生了贸易想法。 |
安装--克劳德桌面
添加 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)或 %APPDATA%/Claude/claude_desktop_config.json (Windows):
{
"mcpServers": {
"prediction-markets": {
"command": "npx",
"args": ["-y", "prediction-market-mcp"]
}
}
}重新启动克劳德桌面。这7个工具应出现在斜线工具菜单中。
安装--光标
添加 .cursor/mcp.json:
{
"mcpServers": {
"prediction-markets": {
"command": "npx",
"args": ["-y", "prediction-market-mcp"]
}
}
}安装——Windsurf/VS代码副本
两人荣誉相同 mcpServers 形状。将上面的片段放入您的 客户端的MCP配置文件。
安装--mcp-cli(手动测试)
npx @modelcontextprotocol/inspector npx prediction-market-mcp在以下位置打开交互式检查器 http://localhost:5173 在哪里可以列出 工具和尝试通话。
试试看
在Claude Desktop中,问:
市场认为目前最高的地缘政治风险是什么? 首先使用get_text,然后钻入顶部边缘。
克劳德会挑 get_context,总结亮点,然后致电 get_market_edges 和 get_market_detail 顶部边缘。
Bug修复与旧版本
之前的版本 2.1.0 已发货 get_market_detail 召唤 /api/public/market/{ticker} (单数),其中 不存在 现场直播 API,并在每次调用时返回一个404HTML页面。当前版本路由 通过 /api/public/markets?tickers= (复数)并返回第一个匹配-- 现场验证。
发展
git clone https://github.com/spfunctions/prediction-market-mcp-example
cd prediction-market-mcp-example
npm install
npm run build
node dist/index.js # speak MCP over stdio服务器是单个文件(src/index.ts,约150行)——易于阅读,易于理解 以适应作为您自己的MCP服务器的起点。
姐妹套餐
| 堆栈 | 包装 |
|---|---|
| Vercel AI SDK | vercel-ai-prediction-markets |
| 语言链/语言图 | langchain-prediction-markets |
| OpenAI代理SDK | openai-agents-prediction-markets |
| CrewAI(Python) | crewai-prediction-markets |
| 完整的CLI(更多工具、论文、信号) | simplefunctions-cli |
| 裸Python SDK | simplefunctions-python |
许可证
麻省理工学院-由 简单函数.
