How nexus-xyz/nexus-exchange-mcp works
Nexus Exchange MCP Server exposes exchange API operations as tools for AI agents: callers connect over stdio or hosted Streamable HTTP, discover and invoke validated tools, and receive market, account, trading, funding, or bridge results. The shared server dispatches tool handlers to an ExchangeClient, which selects a configured network target and makes public or signed gateway requests. The README documents a broad tool surface; the excerpts do not show every handler, so domain capabilities are grouped rather than mapped endpoint by endpoint.
Main entry points: index.ts Tool definitions · client.ts Exchange client · server.ts MCP server · http.ts HTTP sessions
Components 16
MCP entry points
- stdio entry
src/index.ts - HTTP entry
src/http-index.ts - HTTP sessions
src/http.ts
Tool dispatch
- MCP server
src/server.ts - Tool definitions
src/tools/index.ts
Exchange capabilities
- Market data
src/tools/index.ts - Account data
src/tools/index.ts - Order trading
src/tools/index.ts - Funding operations
src/tools/index.ts - Bridge operations
src/tools/index.ts - Admin tools
src/tools/index.ts
API access
- Runtime config
src/config.ts - Network targets
src/networks.ts - Exchange client
src/client.ts
Other components
- AI agent
- Exchange gateway
Connections 22
- AI agent → stdio entry: connects via stdio
- AI agent → HTTP sessions: sends MCP requests
- stdio entry → MCP server: creates and connects
- HTTP entry → HTTP sessions: starts listener
- HTTP sessions → MCP server: creates and connects
- MCP server → Runtime config: loads configuration
- Runtime config → Network targets: resolves target
- MCP server → Exchange client: constructs client
- MCP server → Tool definitions: lists and dispatches
- Tool definitions → Market data: defines
- Tool definitions → Account data: defines
- Tool definitions → Order trading: defines
- Tool definitions → Funding operations: defines
- Tool definitions → Bridge operations: defines
- Tool definitions → Admin tools: defines
- Market data → Exchange client: requests market data
- Account data → Exchange client: requests account data
- Order trading → Exchange client: submits order actions
- Funding operations → Exchange client: requests funding actions
- Bridge operations → Exchange client: requests bridge actions
- Admin tools → Exchange client: requests admin actions
- Exchange client → Exchange gateway: sends API requests