什么是 dflow-mcp?
访问 kalshi.com 预测市场的实时与历史数据,覆盖事件、市场和交易,并支持按 ticker、mint、类别和体育项目筛选分析。
README
DFlow MCP Server
Access Kalshi prediction market data - the first CFTC-regulated exchange for trading on real-world events. Built by OpenSVM. 23 tools for events, markets, trades, forecasts, candlesticks and live data.
Demo: https://dflow.opensvm.com
Features
This MCP server provides access to the complete Prediction Market Metadata API including:
- Event Management: Get events, search events, retrieve event metadata
- Market Data: Market information, batch queries, market lookups by mint
- Trading Data: Trade history, trades by market, pagination support
- Forecast Analytics: Forecast percentile history, time series data
- Candlestick Data: OHLC data for events and markets
- Live Data: Real-time data feeds, milestone information
- Series Information: Series templates, categories, and metadata
- Utility Functions: Outcome mint queries, filtering, and search capability
Installation
Method 1: Install via Smithery (Recommended)
The easiest way to install this MCP server is through Smithery:
npx @smithery/cli install dflow-mcp-server --client claude
This will automatically configure the server for use with Claude Desktop.
Method 2: Manual Installation
Prerequisites
- Bun (recommended) or Node.js 18+
Install Dependencies
bun install
Usage
Starting the Server
# Development mode (with hot reload)
bun run dev
# Production mode
bun start
# Or directly with Bun
bun run src/index.ts
The server uses stdio transport for MCP communication, which is the standard for MCP clients.
Integration with MCP Clients
Claude Desktop
If you installed via Smithery, the configuration is automatic. For manual setup, add this to your Claude Desktop config:
{
"mcpServers": {
"dflow-mcp": {
"command": "bun",
"args": ["run", "/path/to/dflow-mcp/src/index.ts"]
}
}
}
Other MCP Clients
This server is compatible with any MCP client (Cursor, Continue, etc.). Use the same configuration format as above.
Available Tools
Event Tools
get_event- Get a single event by tickerget_events- Get paginated list of all events
Market Tools
get_market- Get market details by tickerget_market_by_mint- Get market by mint addressget_markets- Get paginated list of marketsget_markets_batch- Get multiple markets (up to 100)
Trade Tools
get_trades- Get trades across marketsget_trades_by_mint- Get trades for specific market
Analytics Tools
get_forecast_percentile_history- Get forecast historyget_forecast_percentile_history_by_mint- Forecast history by mintget_event_candlesticks- Event candlestick dataget_market_candlesticks- Market candlestick dataget_market_candlesticks_by_mint- Candlesticks by mint
Live Data Tools
get_live_data- Get live data for milestonesget_live_data_by_event- Live data for eventget_live_data_by_mint- Live data by mint
Series Tools
get_series- Get all series templatesget_series_by_ticker- Get specific series
Utility Tools
get_outcome_mints- Get outcome mint addressesfilter_outcome_mints- Filter addresses to outcome mintsget_tags_by_categories- Get category-tag mappingget_filters_by_sports- Get sports filtering optionssearch_events- Search events by title/ticker
Example Tool Calls
Get a specific event
{
"tool": "get_event",
"arguments": {
"event_id": "US-PRESIDENT-2024",
"withNestedMarkets": true
}
}
Get market by mint address
{
"tool": "get_market_by_mint",
"arguments": {
"mint_address": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
}
}
Get forecast history
{
"tool": "get_forecast_percentile_history",
"arguments": {
"series_ticker": "US-PRESIDENT",
"event_id": "US-PRESIDENT-2024",
"percentiles": "25,50,75",
"startTs": 1704067200,
"endTs": 1706745600,
"periodInterval": 3600
}
}
Search events
{
"tool": "search_events",
"arguments": {
"q": "election",
"limit": 10,
"sort": "volume",
"order": "desc"
}
}
Development
Project Structure
dflow-mcp/
├── src/
│ └── index.ts # Main server implementation
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── llms_dflow.json # API specification
└── README.md # This file
Building
bun run build
Testing
bun run test
API Details
The server implements the complete REST API defined in llms_dflow.json with the following base URL:
https://prediction-markets-api.dflow.net
All tools include comprehensive parameter validation and type definitions. Error handling returns informative messages for debugging.
Publishing to Smithery
This server is configured for publication on Smithery, the MCP server registry.
Configuration Files
smithery.yaml- Defines the runtime (TypeScript) and target (local)package.json- Includes module entry point and Smithery CLI scripts
To Publish
- Ensure your code is pushed to a public GitHub repository
- Visit smithery.ai/new
- Connect your GitHub repository
- Smithery will automatically detect the
smithery.yamlconfiguration
Once published, users can install your server with:
npx @smithery/cli install dflow-mcp-server --client claude
License
MIT License - See LICENSE file for details.
OpenSVM × Kalshi × DFlow
常见问题
dflow-mcp 是什么?
访问 kalshi.com 预测市场的实时与历史数据,覆盖事件、市场和交易,并支持按 ticker、mint、类别和体育项目筛选分析。
相关 Skills
技术栈评估
by alirezarezvani
对比框架、数据库和云服务,结合 5 年 TCO、安全风险、生态活力与迁移复杂度做量化评估,适合技术选型、栈升级和替换路线决策。
✎ 帮你系统比较技术栈优劣,不只看功能,还把TCO、安全性和生态健康度一起量化,选型和迁移决策更稳。
资深数据科学家
by alirezarezvani
覆盖实验设计、特征工程、预测建模、因果推断与模型评估,适合用 Python/R/SQL 做 A/B 测试、时序分析和生产级 ML 落地,支撑数据驱动决策。
✎ 从 A/B 测试、因果分析到预测建模一条龙搞定,既有硬核统计方法也懂业务沟通,特别适合把数据结论真正落地。
资深架构师
by alirezarezvani
适合系统设计评审、ADR记录和扩展性规划,分析依赖与耦合,权衡单体或微服务、数据库与技术栈选型,并输出Mermaid、PlantUML、ASCII架构图。
✎ 搞系统设计、技术选型和扩展规划时,用它能更快理清架构决策与依赖关系,还能直接产出 Mermaid/PlantUML 图,方案讨论效率很高。
相关 MCP Server
SQLite 数据库
编辑精选by Anthropic
SQLite 是让 AI 直接查询本地数据库进行数据分析的 MCP 服务器。
✎ 这个服务器解决了 AI 无法直接访问 SQLite 数据库的问题,适合需要快速分析本地数据集的开发者。不过,作为参考实现,它可能缺乏生产级的安全特性,建议在受控环境中使用。
PostgreSQL 数据库
编辑精选by Anthropic
PostgreSQL 是让 Claude 直接查询和管理你的数据库的 MCP 服务器。
✎ 这个服务器解决了开发者需要手动编写 SQL 查询的痛点,特别适合数据分析师或后端开发者快速探索数据库结构。不过,由于是参考实现,生产环境使用前务必评估安全风险,别指望它能处理复杂事务。
Firecrawl 智能爬虫
编辑精选by Firecrawl
Firecrawl 是让 AI 直接抓取网页并提取结构化数据的 MCP 服务器。
✎ 它解决了手动写爬虫的麻烦,让 Claude 能直接访问动态网页内容。最适合需要实时数据的研究者或开发者,比如监控竞品价格或抓取新闻。但要注意,它依赖第三方 API,可能涉及隐私和成本问题。