DFlow MCP Server

DFlow MCP Server

Provides access to Kalshi prediction market data with 23 tools for querying events, markets, trades, forecasts, candlesticks, and live data from the CFTC-regulated exchange for trading on real-world events.

Category
Visit Server

README

DFlow MCP Server

smithery badge

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 ticker
  • get_events - Get paginated list of all events

Market Tools

  • get_market - Get market details by ticker
  • get_market_by_mint - Get market by mint address
  • get_markets - Get paginated list of markets
  • get_markets_batch - Get multiple markets (up to 100)

Trade Tools

  • get_trades - Get trades across markets
  • get_trades_by_mint - Get trades for specific market

Analytics Tools

  • get_forecast_percentile_history - Get forecast history
  • get_forecast_percentile_history_by_mint - Forecast history by mint
  • get_event_candlesticks - Event candlestick data
  • get_market_candlesticks - Market candlestick data
  • get_market_candlesticks_by_mint - Candlesticks by mint

Live Data Tools

  • get_live_data - Get live data for milestones
  • get_live_data_by_event - Live data for event
  • get_live_data_by_mint - Live data by mint

Series Tools

  • get_series - Get all series templates
  • get_series_by_ticker - Get specific series

Utility Tools

  • get_outcome_mints - Get outcome mint addresses
  • filter_outcome_mints - Filter addresses to outcome mints
  • get_tags_by_categories - Get category-tag mapping
  • get_filters_by_sports - Get sports filtering options
  • search_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

  1. Ensure your code is pushed to a public GitHub repository
  2. Visit smithery.ai/new
  3. Connect your GitHub repository
  4. Smithery will automatically detect the smithery.yaml configuration

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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured