离线模型上下文协议(MCP)服务器,从本地文档/文件夹中提供 Godot Engine API 文档。
概览
离线模型上下文协议(MCP)服务器,从本地文档/文件夹中提供 Godot Engine API 文档。它通过 stdio 快速搜索和检索类/方法/信号/属性文档,面向任何支持 MCP 的客户端。 - 运行时零网络(仅本地文档)- 解析Godot 4.x XML文档;容忍3.x变体 - 构建内存内搜索索引,支持可选的磁盘温启动 - 提供稳定的MCP搜索和检索工具 先修课程:- Node.js 20+ - pnpm(推荐)或npm 文档来源:- 将 Godot XML 文档放在 ./doc/classes/*.xml 下(该仓库已经包含本地测试的代表集)。如果你把文档放在仓库外,建议GODOT_DOC_DIR到别处。- 需要从现有的 Godot 借阅处获取新文档吗?运行编辑器二进制文件,并用 --doctool 指向你的目标文档/classes 文件夹(CI/服务器时添加 --headless)。
概述(AI 翻译)
离线模型上下文协议(MCP)服务器,从本地 doc/ 文件夹中提供 Godot Engine API 文档。它通过 stdio 快速搜索和检索类/方法/信号/属性文档,面向任何支持 MCP 的客户端。
- 运行时零网络(仅本地文档)
- 解析Godot 4.x XML文档;容忍3.x版本
- 构建内存内搜索索引,并可选磁盘热启动
- 提供稳定的MCP工具用于搜索和检索
快速启动
先修课程:
- Node.js 20+
- PNPM(推荐)或NPM
文档来源:
- 将 Godot XML 文档置于
./doc/classes/*.xml(该仓库已包含本地测试的代表集)。如果你将文档放在仓库外,则将GODOT_DOC_DIR标记在其他位置。 - 需要从现有的 Godot 借阅中获取新文档吗?运行编辑器二进制文件,将
--doctool指向目标doc/classes文件夹(为 CI/服务器添加--headless。如果你的PATH还没有 CLI 二进制文件,按照官方命令行说明安装或添加别名(安装包、手动构建或导出编辑器)。
该命令导出完整的 XML 集合(类、信号等)。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Godot API Docs MCP Server
Offline Model Context Protocol (MCP) server that serves Godot Engine API documentation from a local doc/ folder. It provides fast search and retrieval of class/method/signal/property docs over stdio to any MCP‑capable client.
- Zero network at runtime (local docs only)
- Parses Godot 4.x XML docs; tolerates 3.x variants
- Builds an in‑memory search index with optional on‑disk warm start
- Exposes stable MCP tools for search and retrieval
Quick Start
Prereqs:
- Node.js 20+
- pnpm (recommended) or npm
Docs source:
-
Place Godot XML docs under
./doc/classes/*.xml(this repo already includes a representative set for local testing). PointGODOT_DOC_DIRelsewhere if you keep docs outside the repo. -
Need fresh docs from an existing Godot checkout? Run the editor binary with
--doctoolpointing at your targetdoc/classesfolder (add--headlessfor CI/servers). If you don’t already have the CLI binary on yourPATH, follow the official command line instructions to install or alias it (package install, manual build, or exporting the editor).# inside the upstream Godot repo after building the editor, or anywhere godot is on PATH godot --doctool ./doc/classes --headlessThe command exports the full XML set (classes, signals, etc.). Repeat whenever you update your Godot source to keep docs in sync.
Run (stdio):
# from repo root
export GODOT_DOC_DIR=./doc
pnpm install
pnpm dev # hot reload via tsx, runs the stdio MCP server
# or run without watch
pnpm start
Smoke tests and examples:
# Lightweight end‑to‑end checks
pnpm test
# Example local smoke against the parser/index/tools (no external clients)
pnpm run smoke:local
# Minimal MCP client demo (stdio handshake + tool calls)
pnpm run smoke:mcp
# Manual, step‑by‑step stdio session (prints what to send/expect)
node --import tsx scripts/manual-stdio.mjs
What This Is
This project turns the Godot docs you already have locally into an MCP server so LLM tooling can search and retrieve authoritative API information offline. The server:
- Parses
doc/classes/*.xmlinto typed objects - Builds a compact inverted index covering class names and text fields
- Serves MCP tools over stdio for search and direct lookup
- Optionally writes
.cache/godot-index.jsonfor warm starts
Non‑goals (for now): authoring docs, live web fetching, or general web search.
Repository Layout
server/— MCP server implementation (TypeScript)server/src/index.ts— bootstrap/containerserver/src/cli.ts— CLI (stdio by default)server/src/mcp/stdio.ts— MCP wiring: tools/resources/promptsserver/src/parser/xmlParser.ts— Godot XML → typed docsserver/src/indexer/— index build + persistence (if present)server/src/search/searchEngine.ts— in‑memory search
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →