[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1359":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":9,"languages":9,"totalLinesOfCode":9,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":13,"stars30d":14,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":15,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":16,"fork":16,"defaultBranch":17,"hasWiki":18,"hasPages":16,"topics":19,"createdAt":9,"pushedAt":9,"updatedAt":20,"readmeContent":21,"aiSummary":22,"trendingCount":13,"starSnapshotCount":13,"syncStatus":23,"lastSyncTime":24,"discoverSource":25},1359,"ai-polymarket-agent","kaktusesquire6rmu\u002Fai-polymarket-agent","kaktusesquire6rmu","Enable Claude, ChatGPT, and other AI agents to analyze markets, fetch real-time odds, and execute trades on Polymarket using the Model Context Protocol (MCP).",null,239,13,1,0,357,3.44,false,"main",true,[],"2026-06-12 02:00:26","# 🤖 Polymarket MCP Server: Trade Prediction Markets with AI Agents\nConnect Polymarket to your AI. The official-like MCP implementation for real-time prediction market analysis, automated odds tracking, and AI-powered trading insights.\n\n# 📊 Dashboard\n\u003Cimg width=\"1536\" height=\"1024\" alt=\"polymarket_mcp_banner\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F95907a83-b0f9-4e11-b937-871420f33b17\" \u002F>\n\u003Cimg width=\"1248\" height=\"832\" alt=\"polymarket_mcp_dashboard_v2\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fcd654773-60f1-4b54-b4f1-0cd32b8438ed\" \u002F>\n\n\n\n# 🚀 Getting Started\n\n\n```bash\nimport { Server } from \"@modelcontextprotocol\u002Fsdk\u002Fserver\u002Findex.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol\u002Fsdk\u002Fserver\u002Fstdio.js\";\nimport {\n  CallToolRequestSchema,\n  ListToolsRequestSchema,\n} from \"@modelcontextprotocol\u002Fsdk\u002Ftypes.js\";\nimport axios from \"axios\";\n\n\nconst server = new Server(\n  {\n    name: \"polymarket-mcp-server\",\n    version: \"1.0.0\",\n  },\n  {\n    capabilities: {\n      tools: {},\n    },\n  }\n );\n\n\u002F**\n * Список доступных инструментов для ИИ\n *\u002F\nserver.setRequestHandler(ListToolsRequestSchema, async () => {\n  return {\n    tools: [\n      {\n        name: \"search_markets\",\n        description: \"Search for active prediction markets on Polymarket by keyword\",\n        inputSchema: {\n          type: \"object\",\n          properties: {\n            query: { type: \"string\", description: \"Keyword to search (e.g., 'Bitcoin', 'Election')\" },\n          },\n          required: [\"query\"],\n        },\n      },\n      {\n        name: \"get_market_odds\",\n        description: \"Get real-time odds and order book data for a specific market ID\",\n        inputSchema: {\n          type: \"object\",\n          properties: {\n            conditionId: { type: \"string\", description: \"The unique condition ID of the market\" },\n          },\n          required: [\"conditionId\"],\n        },\n      },\n    ],\n  };\n});\n\n\u002F**\n * Логика выполнения инструментов\n *\u002F\nserver.setRequestHandler(CallToolRequestSchema, async (request) => {\n  const { name, arguments: args } = request.params;\n\n  try {\n    if (name === \"search_markets\") {\n      const query = args?.query as string;\n      const response = await axios.get(`${POLYMARKET_API_BASE}\u002Fmarkets?active=true`);\n      const markets = response.data\n        .filter((m: any) => m.question.toLowerCase().includes(query.toLowerCase()))\n        .slice(0, 5);\n\n      return {\n        content: [{ type: \"text\", text: JSON.stringify(markets, null, 2) }],\n      };\n    }\n\n    if (name === \"get_market_odds\") {\n      const conditionId = args?.conditionId as string;\n      const response = await axios.get(`${POLYMARKET_API_BASE}\u002Fbook?token_id=${conditionId}`);\n      \n      return {\n        content: [{ type: \"text\", text: JSON.stringify(response.data, null, 2) }],\n      };\n    }\n\n    throw new Error(`Tool not found: ${name}`);\n  } catch (error: any) {\n    return {\n      content: [{ type: \"text\", text: `Error: ${error.message}` }],\n      isError: true,\n    };\n  }\n});\n\n\u002F**\n * Запуск сервера через стандартный ввод\u002Fвывод (Stdio)\n *\u002F\nasync function main() {\n  const transport = new StdioServerTransport();\n  await server.connect(transport);\n  console.error(\"Polymarket MCP Server running on stdio\");\n}\n\nmain().catch((error) => {\n  console.error(\"Fatal error in main():\", error);\n  process.exit(1);\n});\n```\n\n---\n# ✨ Features\n* get_market_data: Fetch live odds for any Polymarket URL.\n* search_markets: Find trending markets by keywords.\n* execute_trade: (Optional\u002FAdvanced) Place orders via API.\n\n# 🧱 Architecture\n```bash\npolymarket-mcp-server-ai-agents\u002F\n│\n├── server\u002F\n│   ├── agents\u002F\n│   ├── strategies\u002F\n│   ├── api\u002F\n│   ├── data\u002F\n│   └── core\u002F\n│\n├── scripts\u002F\n├── tests\u002F\n├── docs\u002F\n│\n├── .env.example\n├── README.md\n├── package.json \u002F requirements.txt\n└── docker-compose.yml\n```\n\n  * Agents – AI decision-makers\n  * Strategies – trading logic\n  * Data Layer – market + external signals\n  * API Layer – Polymarket integration\n  * Core Engine – execution + risk control\n# Tech Stack\n\n**Backend:**\n\n* Python\n* FastAPI\n* Web3.py\n\n**AI Layer:**\n\n* OpenAI \u002F LLMs\n* Custom probability models\n\n**Frontend:**\n\n* React \u002F Next.js\n* TailwindCSS\n* Recharts\n\n**Data Layer:**\n\n* WebSockets (real-time markets)\n* PostgreSQL \u002F Redis\n\nModern trading systems often use **event-driven architectures + real-time streams + AI scoring engines** ([Prolymarket][4])\n\n# Use Cases\nAutomated prediction market trading\nAI-powered crypto speculation\nPolitical and event forecasting\nArbitrage strategies\nSentiment-based trading\n\n## 🧪 Roadmap\n\n- [ ] 🧱 Basic MCP server  \n      Initial implementation of the MCP (Model Context Protocol) server core, including request handling and modular architecture.\n\n- [ ] 🔗 Polymarket API integration  \n      Connect to Polymarket APIs to fetch real-time market data, prices, and execute trades programmatically.\n\n- [ ] 🤖 AI agent framework  \n      Develop a flexible framework for creating and managing AI trading agents with pluggable strategies.\n\n- [ ] 🧠 Strategy marketplace  \n      Enable users to create, share, and deploy custom trading strategies in a modular marketplace.\n\n- [ ] 📈 Reinforcement learning agents  \n      Implement RL-based agents capable of learning and improving trading strategies over time.\n\n- [ ] 📊 Dashboard UI  \n      Build a web-based interface for monitoring agents, strategies, trades, and performance analytics.\n\n# 🐳 6. Docker\n\n### Dockerfile\n\n```dockerfile\nFROM python:3.11\n\nWORKDIR \u002Fapp\nCOPY . .\n\nRUN pip install -r requirements.txt\n\nCMD [\"python\", \"main.py\"]\n```\n\n      \n ![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue)\n![Build](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002F...)\n![Stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002F...)\n\nKeywords: polymarket bot, AI trading agent, prediction market automation, crypto AI trading, decentralized trading bots, web3 AI tools\n\n","该项目旨在让Claude、ChatGPT等AI代理能够通过Model Context Protocol (MCP)分析市场、获取实时赔率并在Polymarket上执行交易。其核心功能包括市场分析、自动跟踪赔率及提供由AI驱动的交易洞察，借助标准化协议实现与多种AI模型的无缝集成。适合需要利用先进AI技术进行预测市场分析和自动化交易策略部署的场景使用，如金融研究、投资决策支持等领域。",2,"2026-06-11 02:43:15","CREATED_QUERY"]