Skip to main content
Glama
GwangPyo

nautilus-trader MCP server

by GwangPyo

nautilus-trader MCP 服务器

这是什么

一个 MCP(模型上下文协议)服务器,为 LLM(Claude Code、Codex CLI 等)提供两种方式,在编写针对 nautilus_trader 的策略代码时进行查找:

  • 代码搜索index.py)——对实际源代码(Python + Rust)进行结构化搜索,按符号名查找。不是模糊文本/嵌入搜索:它找到真实的类/函数/结构体,并返回其文档字符串或完整源码。

  • 文档搜索rags/)——对项目的 Markdown 文档(概念、指南、教程)进行语义(基于嵌入的)搜索,用于回答“如何……”这类无法映射到单个符号名的问题。

Related MCP server: MCPyDoc

工作原理

  • index.py 启动两个真实的语言服务器作为子进程,并直接通过 LSP(基于 stdio 的 JSON-RPC)与它们通信——pylsp 用于 nautilus_trader/python/nautilus_trader 下的 Python 源码,rust-analyzer 用于 nautilus_trader/crates 下的 Rust 源码。documentSymbol 查找顶层类/函数/结构体/实现;hover 获取文档字符串(仅限 Python——参见已知限制)。结果缓存到 .code_index_cache.json,因为构建它大约需要 25 秒(主要是 rust-analyzer 处理约 2600 个文件)。

  • rags/rag_build.pydocs/ 下的每个文件分块,并构建一个 dspy.retrievers.Embeddings 索引(Gemini 嵌入),保存到 rags/config.json + corpus_embeddings.npy),外加一个 shape.json,记录原始文件夹结构,以便 rags/search.py 可以过滤到子文件夹。

  • mcp_server.py 将两者整合为 5 个 MCP 工具:search_codeget_code_docget_code_sourcesearch_docsshow_doc_keys

设置

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 是幂等的:重新运行它会跳过 nautilus_trader 克隆、docs/ 复制以及(付费的)文档嵌入构建(如果它们已存在)。设置 ENV_NAME=<name> 以使用不同的 conda 环境名称(用于测试,这样不会影响真正的 mcp 环境)。

环境管理器不是必需的——uv venv && uv pip install -e . 也可以;install.sh 只是统一使用 conda,以实现可复现的一键设置。

注册到客户端

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

两者都只是让客户端通过 stdio 指向 <conda mcp env>/bin/python3 mcp_server.py

已知限制 / 待办事项

  • .code_index_cache.jsonrags/{config.json,corpus_embeddings.npy,shape.json} 没有失效机制——如果 nautilus_trader/docs/ 发生变化,你必须手动删除缓存文件并重新运行才能生效。

  • 没有自动化测试——到目前为止所有内容都是手动验证的(全新的 conda 环境、全新的 uv 环境、通过 stdio 的真实 MCP 客户端)。

  • nautilus_trader/ 是从 main(未固定版本)克隆的——可能会随时间漂移;目前没有任何机制将其与已知良好的提交/标签进行核对。

F
license - not found
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    Exposes type-aware code navigation and fast file search to AI agents via language servers, enabling definitions, references, symbols, and file lookup without reading entire codebases.
    3,520
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables LLMs to efficiently navigate large codebases by providing surgical access to specific code symbols via semantic search and call-graph queries.
    6
    MIT

View all related MCP servers

Related MCP Connectors

  • Token-efficient search for coding agents over public and private documentation.

  • Provide your AI coding tools with token-efficient access to up-to-date technical documentation for…

  • Search @imqueue docs and scaffold typed services & clients from your AI coding agent.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GwangPyo/NautilusTraderMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server