nautilus-trader MCP server

nautilus-trader MCP server

Provides LLMs with code and documentation search over nautilus_trader via LSP-based symbol lookup and semantic embedding-based doc retrieval.

Category
Visit Server

README

nautilus-trader MCP server

What this is

An MCP (Model Context Protocol) server that gives an LLM (Claude Code, Codex CLI, etc.) two ways to look things up in nautilus_trader while writing strategy code against it:

  • Code search (index.py) -- structural search over the actual source (Python + Rust), by symbol name. Not fuzzy-text/embedding search: it finds the real class/function/struct and returns its docstring or full source.
  • Doc search (rags/) -- semantic (embedding-based) search over the project's markdown docs (concepts, guides, tutorials), for "how do I..." questions that don't map to a single symbol name.

How it works

  • index.py spawns two real language servers as subprocesses and talks LSP (JSON-RPC over stdio) to them directly -- pylsp for the Python source under nautilus_trader/python/nautilus_trader, rust-analyzer for the Rust source under nautilus_trader/crates. documentSymbol finds top-level classes/functions/structs/impls; hover gets the docstring (Python only -- see Known limitations). Results are cached to .code_index_cache.json since building it costs ~25s (mostly rust-analyzer over ~2600 files).
  • rags/rag_build.py chunks every file under docs/ and builds a dspy.retrievers.Embeddings index (Gemini embeddings), saved to rags/ (config.json + corpus_embeddings.npy) plus a shape.json that records the original folder structure so rags/search.py can filter to a subfolder.
  • mcp_server.py wires both into 5 MCP tools: search_code, get_code_doc, get_code_source, search_docs, show_doc_keys.

Setup

git clone https://github.com/GwangPyo/NautilusTraderMCP.git
cd NautilusTraderMCP
cp .env.example .env   # fill in GEMINI_API_KEY (and OPENAI/ANTHROPIC if you use load_model)
./install.sh           # conda env "mcp" + deps, nautilus_trader clone, code index, doc index

install.sh is idempotent: re-running it skips the nautilus_trader clone, the docs/ copy, and the (paid) doc-embedding build if they already exist. Set ENV_NAME=<name> to use a different conda env name (used for testing so it doesn't touch the real mcp env).

An env manager isn't required -- uv venv && uv pip install -e . works too; install.sh just standardizes on conda for a reproducible one-command setup.

Register with a client

./add_claude.sh   # claude mcp add
./add_codex.sh    # codex mcp add

Both just point the client at <conda mcp env>/bin/python3 mcp_server.py over stdio.

Known limitations / TODO

  • [ ] .code_index_cache.json and rags/{config.json,corpus_embeddings.npy,shape.json} have no invalidation -- if nautilus_trader/ or docs/ change, you have to delete the cache files by hand and re-run to pick it up.
  • [ ] No automated tests -- everything so far has been verified by hand (fresh conda env, fresh uv env, real MCP client over stdio).
  • [ ] nautilus_trader/ is cloned from main (unpinned) -- can drift over time; nothing currently checks it against a known-good commit/tag.

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
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
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
VeyraX MCP

VeyraX MCP

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

Official
Featured
Local
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
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
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

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
Qdrant Server

Qdrant Server

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

Official
Featured