OneTick MCP Server

OneTick MCP Server

Enables enterprise-grade OneTick tick data analytics with 18 tools for market data retrieval, metadata discovery, and analytics computations across 200+ global exchanges.

Category
访问服务器

README

OneTick MCP Server

Enterprise-grade MCP server for OneTick tick data analytics. Provides 18 tools across 4 categories, 6 workflow commands, and 6 domain skills — covering equities, futures, FX, options, and indices from 200+ global exchanges.

Quick Start

1. Install

git clone https://github.com/your-org/onetick-mcp.git
cd onetick-mcp
pip install -e .

2. Set Credentials

export ONETICK_CLIENT_ID=your_client_id
export ONETICK_CLIENT_SECRET=your_client_secret

Or copy .env.example to .env and fill in your credentials.

3. Connect to Claude

Choose your platform below.


Platform Setup

Claude Code (CLI)

Register the MCP server so Claude Code can use all 18 tools:

# Add to your current project
claude mcp add onetick -- onetick-mcp

# Or with explicit credentials
claude mcp add onetick \
  --env ONETICK_CLIENT_ID=your_client_id \
  --env ONETICK_CLIENT_SECRET=your_client_secret \
  -- onetick-mcp

# Verify it's registered
claude mcp list

This creates a .mcp.json in your project root. To register across all projects instead:

claude mcp add --scope user onetick -- onetick-mcp

Direct mode (registers all 18 tools upfront instead of 3 meta-tools — uses more tokens but skips the discovery step):

claude mcp add onetick -- onetick-mcp --direct

Claude Desktop

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "onetick": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/path/to/onetick_mcp",
        "onetick-mcp"
      ],
      "env": {
        "ONETICK_CLIENT_ID": "your_client_id",
        "ONETICK_CLIENT_SECRET": "your_client_secret"
      }
    }
  }
}

Replace /path/to/onetick_mcp with the actual path to this repository.


Using Skills and Commands

The server ships with 6 skills (domain knowledge) and 6 commands (step-by-step workflows) that tell Claude how to chain the MCP tools into complete analyses. These work together: commands define what to do, skills provide how to interpret the results.

Skills (Domain Knowledge)

Skills are loaded from the skills/ directory. Each skill teaches Claude a domain — what metrics matter, how to interpret them, and what output format to produce.

Skill Domain When to Use
tca-analysis Execution benchmarking Trading costs, slippage, VWAP shortfall, cost decomposition
market-microstructure Liquidity & price formation Order book depth, bid-ask dynamics, buy/sell pressure
intraday-analytics Volume & momentum Volume profile, VWAP deviation, unusual activity detection
volatility-analysis Risk measurement Realized vol, vol regimes, historical percentile comparison
execution-quality Fill assessment Interval-level benchmark comparison, best/worst fill windows
market-overview Daily briefing Price action, volume, volatility, spreads across symbols

Commands (Workflow Orchestration)

Commands are loaded from the commands/ directory. Each command chains 3-5 tool calls into a complete analysis with a defined workflow.

Command What It Does Tool Chain
/analyze-tca Transaction Cost Analysis CALC_VWAP -> CALC_SPREAD_STATS -> CALC_TRADE_STATS -> GET_BARS
/analyze-microstructure Market microstructure GET_BOOK_SNAPSHOT -> CALC_BOOK_IMBALANCE -> CALC_SPREAD_STATS
/analyze-intraday Intraday activity profile CALC_VWAP -> CALC_TRADE_STATS -> GET_BARS
/analyze-volatility Realized volatility analysis CALC_VOLATILITY -> GET_DAILY_BARS -> CALC_SPREAD_STATS -> CALC_TRADE_STATS
/analyze-execution Execution quality assessment CALC_VWAP -> CALC_TRADE_STATS -> CALC_SPREAD_STATS -> GET_BARS
/market-overview Market snapshot GET_DAILY_BARS -> CALC_VWAP -> CALC_TRADE_STATS -> CALC_VOLATILITY -> CALC_SPREAD_STATS

How to Use in Claude Code

Once the MCP server is registered, you can use commands and ask questions naturally:

# Run a workflow command
/analyze-tca AAPL 2024-01-15 09:30:00 2024-01-15 16:00:00

# Ask natural language questions (Claude picks the right tools)
"What's the VWAP for MSFT today?"
"Show me the order book for TSLA"
"Morning briefing for AAPL, MSFT, GOOGL"
"How volatile is AMZN compared to the last 20 days?"

# Run multi-symbol analysis
/market-overview AAPL,MSFT,GOOGL,AMZN

How Skills and Commands Work Together

Each command references its corresponding skill. For example, /analyze-tca uses the tca-analysis skill for domain expertise:

  1. Command defines the workflow: which tools to call, in what order, with what parameters
  2. Skill provides interpretation: what the numbers mean, how to classify results, what output format to use
  3. MCP Tools execute the computation: deterministic analytics on OneTick's C++ engine

This separation means you can also ask free-form questions. Claude will use the skill knowledge to pick the right tools and interpret results, even without invoking a command explicitly.


Packaging as a Plugin

To distribute the server + skills + commands as a self-contained Claude Code plugin:

1. Create Plugin Manifest

Create .claude-plugin/plugin.json:

{
  "name": "onetick",
  "description": "OneTick market data analytics — tick data, TCA, microstructure, volatility analysis across 200+ global exchanges",
  "version": "0.2.0",
  "author": {
    "name": "OneTick"
  }
}

2. Create Plugin MCP Config

Create .mcp.json at the repo root:

{
  "mcpServers": {
    "onetick": {
      "type": "stdio",
      "command": "onetick-mcp",
      "env": {
        "ONETICK_CLIENT_ID": "${ONETICK_CLIENT_ID}",
        "ONETICK_CLIENT_SECRET": "${ONETICK_CLIENT_SECRET}"
      }
    }
  }
}

3. Test the Plugin

claude --plugin-dir /path/to/onetick_mcp

When packaged as a plugin, commands are namespaced:

/onetick:analyze-tca AAPL 2024-01-15 09:30:00 2024-01-15 16:00:00

Plugin Directory Structure

onetick_mcp/
├── .claude-plugin/
│   └── plugin.json            <- Plugin manifest
├── .mcp.json                  <- MCP server config (auto-starts with plugin)
├── commands/                  <- Workflow commands (become slash commands)
│   ├── analyze-tca.md
│   ├── analyze-microstructure.md
│   ├── analyze-intraday.md
│   ├── analyze-volatility.md
│   ├── analyze-execution.md
│   └── market-overview.md
├── skills/                    <- Domain knowledge (loaded automatically)
│   ├── tca-analysis/SKILL.md
│   ├── market-microstructure/SKILL.md
│   ├── intraday-analytics/SKILL.md
│   ├── volatility-analysis/SKILL.md
│   ├── execution-quality/SKILL.md
│   └── market-overview/SKILL.md
├── src/                       <- MCP server implementation
│   ├── server.py
│   ├── config.py
│   ├── response.py
│   └── tools/
│       ├── registry.py
│       ├── meta_tools.py
│       ├── data_retrieval.py
│       ├── metadata.py
│       ├── analytics.py
│       └── sql.py
├── tests/
├── CONNECTORS.md              <- Complete tool reference
├── pyproject.toml
└── .env.example

MCP Tools Reference

Progressive Discovery (Default)

The server exposes only 3 meta-tools by default, reducing token usage by ~88%:

Meta-Tool Purpose
TOOL_LIST List all 18 tools with brief descriptions (~1,000 tokens)
TOOL_GET Full schema for specific tool(s) (~200 tokens per tool)
TOOL_CALL Execute a tool by name with JSON arguments

Workflow: TOOL_LIST -> identify relevant tools -> TOOL_GET for schemas -> TOOL_CALL with arguments.

Use --direct mode to register all 18 tools upfront (no meta-tools, but ~8,000 tokens upfront).

Market Data Retrieval (8 tools)

Tool Description Key Parameters
GET_TICK_DATA Raw tick data (trades, quotes, NBBO) for a single symbol symbol, tick_type, database, start, end, max_rows
GET_BARS OHLC/VWAP/TWAP bars at configurable intervals symbol, bar_type, interval, database
GET_DAILY_BARS End-of-day OHLCV with corporate action adjustment symbol, start_date, end_date, adjusted
GET_MULTI_SYMBOL Data for 2+ symbols in parallel symbols, data_type, bar_type, interval
GET_BOOK_SNAPSHOT Point-in-time order book reconstruction symbol, timestamp, max_levels
GET_BOOK_TIMESERIES Order book snapshots at regular intervals symbol, start, end, interval
GET_CORPORATE_ACTIONS Splits, dividends, mergers, adjustment factors symbol, start_date, end_date
GET_STATIC_DATA Reference data (name, currency, ISIN) or auction prices symbol, data_type

Metadata & Discovery (4 tools)

Tool Description
LIST_DATABASES All available databases by region and asset class
GET_DATABASE_INFO Tick types, date range, schema for a specific database
SEARCH_SYMBOLS Find symbols by pattern (SQL LIKE: 'AAPL', 'AA%', '%GOLD%')
LIST_VENUES All supported exchanges by region and asset class

Analytics & Computation (5 tools)

All computations are deterministic, executed on OneTick's C++ engine.

Tool Description Formula
CALC_VWAP Single aggregate VWAP for a time range SUM(Price*Volume) / SUM(Volume)
CALC_SPREAD_STATS Bid-ask spread statistics per interval Spread = ASK - BID
CALC_BOOK_IMBALANCE Order book buy/sell pressure (BidVol - AskVol) / (BidVol + AskVol)
CALC_VOLATILITY Realized volatility from trade data StdDev(log returns), annualized
CALC_TRADE_STATS Trade flow: count, volume, VWAP, avg size per interval Aggregated from trade ticks

SQL (1 tool)

Tool Description
EXECUTE_SQL Run OneTick SQL SELECT queries. Table format: DATABASE.TICK_TYPE

See CONNECTORS.md for complete parameter specifications and optimization guidance.


Usage Examples

Quick Lookups

"What is the current price of AAPL?"
-> GET_TICK_DATA (symbol='AAPL', tick_type='TRD', max_rows=1)

"EUR/USD rate right now"
-> GET_TICK_DATA (symbol='EUR/USD', database='GLOBAL_FX', tick_type='QTE', max_rows=1)

"What's the DJIA at?"
-> GET_TICK_DATA (database='DJ_INDICES', max_rows=1)

Daily / Historical Data

"AAPL daily chart for this month"
-> GET_DAILY_BARS (symbol='AAPL', start_date='2026-04-01', end_date='2026-04-30')

"MSFT historical prices adjusted for splits"
-> GET_DAILY_BARS (symbol='MSFT', adjusted=True)

Intraday Bars

"5-minute OHLC bars for AAPL today"
-> GET_BARS (symbol='AAPL', bar_type='ohlc', interval='5min')

"Compare 5-min bars for AAPL, MSFT, GOOGL"
-> GET_MULTI_SYMBOL (symbols='AAPL,MSFT,GOOGL', data_type='bars', interval='5min')

Analytics

"What's the VWAP for AAPL today?"
-> CALC_VWAP (symbol='AAPL', start='2026-04-08 09:30:00', end='2026-04-08 16:00:00')

"Is there buying pressure in TSLA?"
-> CALC_BOOK_IMBALANCE (symbol='TSLA')

"Realized volatility for GOOGL"
-> CALC_VOLATILITY (symbol='GOOGL', interval='5min')

Workflow Commands

"Run a TCA for CSCO from 9:30 to 12:00 on Jan 3, 2024"
-> /analyze-tca chains: CALC_VWAP -> CALC_SPREAD_STATS -> CALC_TRADE_STATS -> GET_BARS

"Analyze AAPL's market microstructure"
-> /analyze-microstructure chains: GET_BOOK_SNAPSHOT -> CALC_BOOK_IMBALANCE -> CALC_SPREAD_STATS

"Morning briefing for AAPL, MSFT, GOOGL"
-> /market-overview chains: GET_DAILY_BARS -> CALC_VWAP -> CALC_TRADE_STATS -> CALC_VOLATILITY -> CALC_SPREAD_STATS

SQL Queries

SELECT SYMBOL_NAME, SUM(SIZE) AS VOLUME
FROM US_COMP.TRD
WHERE SYMBOL_NAME = 'AAPL'
  AND TIMESTAMP >= '2024-01-15 09:30:00 America/New_York'
GROUP BY SYMBOL_NAME

Tool Selection Guide

Question Type Use This Tool NOT This
"What is the price of X?" GET_TICK_DATA (max_rows=1) GET_DAILY_BARS
"X daily chart" GET_DAILY_BARS GET_BARS or GET_TICK_DATA
"VWAP for X" (single number) CALC_VWAP GET_BARS
"VWAP bars every 5min" (time series) GET_BARS (bar_type=vwap) CALC_VWAP
"Volume today" CALC_TRADE_STATS GET_TICK_DATA
"Bid-ask spread" CALC_SPREAD_STATS GET_TICK_DATA
"Show order book" GET_BOOK_SNAPSHOT CALC_BOOK_IMBALANCE
"Buying/selling pressure" CALC_BOOK_IMBALANCE GET_BOOK_SNAPSHOT
"What databases exist?" LIST_DATABASES LIST_VENUES
"What exchanges exist?" LIST_VENUES LIST_DATABASES
"Compare multiple symbols" GET_MULTI_SYMBOL Multiple GET_TICK_DATA calls

Supported Databases

Database Asset Class Region Examples
US_COMP Equities US AAPL, MSFT, GOOGL, TSLA
CME Futures US ES (S&P), CL (crude oil), GC (gold), NG (nat gas)
GLOBAL_FX FX Global EUR/USD, GBP/JPY, USD/JPY
LSE Equities EU VOD, BP, HSBA
XETRA Equities EU SIE, SAP, ALV
EURONEXT Equities EU AI, MC, SAN
EUREX Futures EU FESX, FGBL
SP_INDICES Indices US SPX, RUT
DJ_INDICES Indices US INDU (DJIA)
CBOE_IDX Indices US VIX
US_OPTIONS Options US OPRA consolidated
CA_COMP / TSX Equities CA RY, TD, BNS

OneTick cloud demo databases use _SAMPLE suffix (e.g., US_COMP_SAMPLE). The server resolves this automatically — if US_COMP is not found, it tries US_COMP_SAMPLE.


Requirements

  • Python 3.10+
  • OneTick Cloud API credentials (ONETICK_CLIENT_ID and ONETICK_CLIENT_SECRET)
  • onetick-py[webapi] package (installed automatically)
  • Valid OneTick data entitlements for the databases you want to access

Credential Setup

Obtaining Credentials

  1. Log in to your OneTick Cloud account at cloud.onetick.com
  2. Navigate to API settings or contact your OneTick administrator
  3. Generate a client ID and client secret for API access

Configuration Methods

Method Best For How
Environment variables Development export ONETICK_CLIENT_ID=...
.env file Local use Copy .env.example to .env
Claude Desktop config Claude Desktop Add to claude_desktop_config.json
CLI arguments Quick testing onetick-mcp --client-id X --client-secret Y

OneTick Connection Details

  • REST endpoint: https://rest.cloud.onetick.com:443
  • Auth endpoint: https://cloud-auth.parent.onetick.com/realms/OMD/protocol/openid-connect/token
  • Authentication: OAuth2 client_credentials flow (automatic)

Running Tests

# Tool selection validation (7 tests)
python tests/test_tool_selection.py

# Workflow/skill structure validation (9 tests)
python tests/test_workflow_validation.py

# Independent query optimization validation (10 rules, 100 queries)
python tests/test_independent_queries.py

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选