Skip to main content
Glama
michaeljiangmingfeng-debug

quanttogo-mcp-servers

README.md
# QuantToGo MCP Servers

MCP (Model Context Protocol) servers for **QuantToGo** - a quantitative trading platform providing live trading signals, market data, and portfolio management through AI-native interfaces.

## Overview

This repository contains three MCP servers that expose QuantToGo's quantitative trading capabilities:

| Server | Description | Tools |
|--------|-------------|-------|
| **quanttogo-signals** | Real-time trading signals from live quant strategies | 3 tools |
| **quanttogo-market-data** | Product catalog, NAV history, backtest reports | 5 tools |
| **quanttogo-portfolio** | Portfolio positions, dual-track performance, trade history | 6 tools |

Plus an **HTTP server** for remote access (MCP Connector mode).

## Quick Start

### Installation

```bash
npm install quanttogo-mcp-servers
```

Or clone and build:

```bash
git clone https://github.com/michaeljiangmingfeng-debug/quanttogo-mcp-servers.git
cd quanttogo-mcp-servers
npm install
npm run build
```

### Configuration

Set environment variables:

```bash
export QUANTTOGO_API_BASE="https://www.quanttogo.com"  # API endpoint
export QUANTTOGO_API_KEY="your-api-key"                 # API authentication key
export QUANTTOGO_USER_ID="your-user-id"                 # Your user ID
```

### Usage with Claude Desktop

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "quanttogo-signals": {
      "command": "npx",
      "args": ["tsx", "src/signals-server.ts"],
      "cwd": "/path/to/quanttogo-mcp-servers",
      "env": {
        "QUANTTOGO_API_KEY": "your-api-key",
        "QUANTTOGO_USER_ID": "your-user-id"
      }
    },
    "quanttogo-market-data": {
      "command": "npx",
      "args": ["tsx", "src/market-data-server.ts"],
      "cwd": "/path/to/quanttogo-mcp-servers",
      "env": {
        "QUANTTOGO_API_KEY": "your-api-key"
      }
    },
    "quanttogo-portfolio": {
      "command": "npx",
      "args": ["tsx", "src/portfolio-server.ts"],
      "cwd": "/path/to/quanttogo-mcp-servers",
      "env": {
        "QUANTTOGO_API_KEY": "your-api-key",
        "QUANTTOGO_USER_ID": "your-user-id"
      }
    }
  }
}
```

### Remote HTTP Mode (Connector)

For remote access via Streamable HTTP:

```bash
npm run serve
# Server starts at http://localhost:3000/mcp
```

## Available Tools

### Signals Server (`quanttogo-signals`)

| Tool | Description |
|------|-------------|
| `get_trading_signals` | Get latest BUY/SELL signals with strategy, symbol, quantity, price |
| `confirm_signal` | Execute or skip a pending signal |
| `get_signal_stats` | Signal performance metrics and win rate |

### Market Data Server (`quanttogo-market-data`)

| Tool | Description |
|------|-------------|
| `get_products` | List all quantitative trading products |
| `get_product_detail` | Detailed product info with parameters |
| `get_nav_history` | Historical NAV data with daily returns |
| `get_backtest_report` | Strategy backtest with Sharpe ratio, drawdown |
| `search_products` | Search by risk level, currency, strategy type |

### Portfolio Server (`quanttogo-portfolio`)

| Tool | Description |
|------|-------------|
| `get_portfolio` | Complete portfolio overview |
| `get_dual_track_comparison` | AUTO vs MANUAL track performance comparison |
| `get_positions` | Current open positions across strategies |
| `get_trade_history` | Historical trade records |
| `get_subscriptions` | User subscription status |
| `get_performance_metrics` | Return, drawdown, Sharpe ratio, win rate |

## Architecture

```
quanttogo-mcp-servers/
├── src/
│   ├── common/
│   │   ├── client.ts          # QuantToGo API client
│   │   └── types.ts           # Shared TypeScript types
│   ├── signals-server.ts      # Signals MCP Server (stdio)
│   ├── market-data-server.ts  # Market Data MCP Server (stdio)
│   ├── portfolio-server.ts    # Portfolio MCP Server (stdio)
│   └── http-server.ts         # Combined HTTP server (Connector mode)
├── package.json
├── tsconfig.json
├── glama.json
├── LICENSE
└── README.md
```

## Key Concepts

### Dual-Track System

QuantToGo uses a unique dual-track system:
- **AUTO track**: All signals are automatically executed (virtual trading)
- **MANUAL track**: Only user-confirmed signals are executed

This allows users to compare their decision-making against the algorithm's full execution.

### Signal Sources

Signals come from two quantitative platforms:
- **QC** (QuantConnect): US market strategies
- **JQ** (JoinQuant): China market strategies

## Development

```bash
# Run individual servers in dev mode
npm run dev:signals
npm run dev:market-data
npm run dev:portfolio

# Run HTTP server
npm run serve

# Build for production
npm run build
```

## License

MIT

TDQS

B3.3/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: confirm_signal handles pending signal actions, get_signal_stats provides performance metrics, and get_trading_signals fetches real-time signals. There is no overlap in functionality, making tool selection unambiguous for an agent.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (confirm_signal, get_signal_stats, get_trading_signals), using snake_case and starting with clear action verbs. This predictability aids in understanding and usage.

Tool Count3/5

With only 3 tools, the set feels thin for a trading signal domain, as it lacks operations like creating, updating, or deleting signals, or managing strategies. While core functions are covered, the scope could be expanded for better completeness.

Completeness3/5

The tools cover key aspects: retrieving signals, confirming them, and viewing stats. However, there are notable gaps such as no ability to create or modify signals, manage strategies, or handle trade execution beyond virtual actions, which limits full lifecycle coverage.