AgentSkillsCN

@neural-trader/mcp

MCP 服务器开放 87 多种神经交易工具,助力 AI 智能体集成。适用于通过 MCP 将交易能力接入 Claude 或其他 AI 智能体、借助模型上下文协议(Model Context Protocol)开放行情数据与策略工具,或打造由智能体驱动的交易自动化方案。

SKILL.md
--- frontmatter
name: "@neural-trader/mcp"
description: "MCP server exposing 87+ neural trading tools for AI agent integration. Use when connecting trading capabilities to Claude or other AI agents via MCP, exposing market data and strategy tools through Model Context Protocol, or building agent-driven trading automation."

@neural-trader/mcp

Model Context Protocol (MCP) server wrapping the Neural Trader engine, exposing 87+ trading tools for seamless integration with Claude, AI agents, and MCP-compatible clients.

Quick Reference

TaskCode
Installnpx @neural-trader/mcp@latest
Importimport { NeuralTraderMCP } from '@neural-trader/mcp';
Createconst mcp = new NeuralTraderMCP({ port: 3001 });
Startawait mcp.start();
Stopawait mcp.stop();
Statusconst info = mcp.getStatus();

Installation

Hub install (recommended): npx neural-trader@latest includes this package. Standalone: npx @neural-trader/mcp@latest See Installation Guide for the full ecosystem.

Key API

NeuralTraderMCP

The MCP server class exposing trading tools.

typescript
import { NeuralTraderMCP } from '@neural-trader/mcp';

const mcp = new NeuralTraderMCP({
  port: 3001,
  transport: 'stdio',
  engine: { mode: 'paper', capital: 100000 },
});

Constructor Options:

OptionTypeDefaultDescription
portnumber3001Server port (for SSE transport)
transportstring'stdio'Transport: 'stdio', 'sse', 'ws'
engineEngineOptionsdefaultsNeural Trader engine config
authTokenstringundefinedOptional authentication token
enabledToolsstring[]allSubset of tools to enable
readOnlybooleanfalseDisable trade execution tools
maxConcurrentnumber10Max concurrent tool calls

Methods:

MethodReturnsDescription
start()Promise<void>Start the MCP server
stop()Promise<void>Stop the MCP server
getStatus()ServerStatusServer and engine status
getTools()ToolDefinition[]List all available tools
enableTool(name)voidEnable a specific tool
disableTool(name)voidDisable a specific tool

Tool Categories

The 87+ tools are organized into categories:

CategoryCountDescription
Market Data15Price quotes, OHLCV, order books
Technical Analysis20RSI, MACD, Bollinger, SMA, EMA, etc.
Strategy Management12Create, configure, backtest strategies
Order Execution10Place, modify, cancel orders
Portfolio8Positions, balance, allocation
Risk Management7VaR, exposure, correlation, limits
Neural Models8Train, predict, evaluate alpha models
Backtesting5Run, analyze, compare backtests
Alerts2Price and condition alerts

Key MCP Tools

Market Data Tools:

ToolDescription
get_quoteGet real-time price quote for a symbol
get_ohlcvGet OHLCV bars for a symbol and timeframe
get_order_bookGet current order book (L2 data)
get_market_statusCheck if markets are open
search_symbolsSearch for symbols by name

Strategy Tools:

ToolDescription
create_strategyCreate a new trading strategy
backtest_strategyBacktest a strategy on historical data
list_strategiesList all configured strategies
get_strategy_metricsGet strategy performance metrics
optimize_strategyOptimize strategy parameters

Order Tools:

ToolDescription
place_orderPlace a buy/sell order
cancel_orderCancel a pending order
get_ordersList open/recent orders
modify_orderModify order price/quantity

Portfolio Tools:

ToolDescription
get_portfolioGet current portfolio summary
get_positionsList open positions
get_balanceGet account balance
get_pnlGet realized/unrealized P&L

Common Patterns

Claude Desktop Integration

Add to Claude Desktop claude_desktop_config.json:

json
{
  "mcpServers": {
    "neural-trader": {
      "command": "npx",
      "args": ["@neural-trader/mcp@latest"],
      "env": {
        "NEURAL_TRADER_MODE": "paper"
      }
    }
  }
}

Programmatic MCP Server

typescript
import { NeuralTraderMCP } from '@neural-trader/mcp';

const mcp = new NeuralTraderMCP({
  transport: 'stdio',
  engine: { mode: 'paper', capital: 50000 },
  readOnly: false,
});

await mcp.start();

Read-Only Market Data Server

typescript
import { NeuralTraderMCP } from '@neural-trader/mcp';

const mcp = new NeuralTraderMCP({
  transport: 'sse',
  port: 3001,
  readOnly: true,
  enabledTools: ['get_quote', 'get_ohlcv', 'search_symbols', 'get_market_status'],
});

await mcp.start();

RAN DDD Context

Bounded Context: RANO Optimization

References