game-knowledge MCP Server
Provides semantic search and API knowledge lookup for Cocos Creator 3.8.8 engine classes and methods, enabling AI assistants to query module, class, and method information from Cocos Creator APIs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@game-knowledge MCP Server search_api('延迟执行')"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
game-knowledge MCP Server
为 Cocos Creator 3.8.8 + exia-framework 提供 AI 知识库查询服务。
索引文件(index/)和 .d.ts 文件(dts/)已预构建并提交到仓库,clone 后即可直接使用。
目录
Related MCP server: Cocos Creator MCP Server
快速安装
要求:Node.js >= 22
git clone <仓库地址> ~/exia/exia-framework-mcp
cd ~/exia/exia-framework-mcp
npm install安装完成后无需启动,AI 编辑器会在需要时自动拉起 MCP Server。
配置 AI 编辑器
Claude Code
在游戏项目目录的 .claude/settings.json(或全局 ~/.claude/settings.json)中添加:
{
"mcpServers": {
"game-knowledge": {
"command": "node",
"args": ["/你实际clone的路径/exia-framework-mcp/src/server.js"]
}
}
}配置后重启 Claude Code,运行 /mcp 命令确认 game-knowledge 状态为 connected。
Cursor
在游戏项目根目录的 .cursor/mcp.json 中添加:
{
"mcpServers": {
"game-knowledge": {
"command": "node",
"args": ["/你实际clone的路径/bit-framework-mcp/src/server.js"]
}
}
}可用工具
MCP Server 启动后,AI 可直接调用以下工具查询 API:
工具 | 说明 | 示例 |
| 语义搜索(支持中英文互搜) |
|
| 查询模块包含的所有类/接口 |
|
| 查询类的完整属性和方法 |
|
| 查询特定方法签名 |
|
search_api 支持的 source 参数:
all(默认):同时搜索框架和 Cocos 引擎 APIframework:只搜索 bit-framework 模块cocos:只搜索 Cocos Creator 3.8.8 API
框架更新后同步索引(框架维护者操作)
安装 cross-env:
npm install --save-dev cross-env普通成员不需要执行此步骤,
git pull拉取最新索引后重启编辑器即可。
# 1. 手动复制有变动的模块 .d.ts(以 exia-ccui 为例)
cp /path/to/exia-framework/exia-ccui.d.ts dts/framework/exia-ccui.d.ts
# 2. 重建索引(首次运行需下载向量模型 ~120MB,存入 models/ 目录)
npm run sync
# 3. 提交并推送(不需要提交 models/ 目录,已在 .gitignore 中)
git add dts/ index/
git commit -m "chore: 同步框架索引 vX.X.X"
git push国内网络若下载模型超时,npm run sync 默认已启用 hf-mirror.com 镜像,也可手动指定:
HF_ENDPOINT=https://hf-mirror.com npm run sync首次构建索引
仓库已包含预构建索引,以下步骤仅在完全重建时需要。
# 1. 放入 Cocos 3.8.8 类型定义
cp /path/to/cc.d.ts dts/cocos/cc.d.ts
# 2. 放入框架 .d.ts(每个模块一个文件)
cp /path/to/exia-ccui.d.ts dts/framework/exia-ccui.d.ts
cp /path/to/exia-data.d.ts dts/framework/exia-data.d.ts
# ... 其余模块同理
# 3. 构建索引(Cocos 类较多,向量化需要几分钟)
npm run sync
# 4. 提交
git add dts/ index/
git commit -m "feat: 初始化框架索引"
git push项目结构说明
exia-framework-mcp/
├── src/
│ ├── server.js # MCP Server 入口,定义 4 个查询工具
│ ├── searcher.js # 索引查询逻辑(关键词 + 向量语义搜索)
│ └── build-index.js # 索引构建脚本(解析 .d.ts → JSON + 向量)
├── dts/
│ ├── framework/ # exia-framework 各模块 .d.ts(已预置)
│ └── cocos/ # cc.d.ts(Cocos 3.8.8,已预置)
├── index/ # 构建产物(已预置,勿手动修改)
│ ├── framework.json # 框架类索引
│ ├── framework-vectors.json # 框架语义向量
│ ├── cocos.json # Cocos 类索引
│ └── cocos-vectors.json # Cocos 语义向量
├── models/ # 向量模型缓存(.gitignore,本地自动生成)
└── package.jsonAvailable Tools
4 toolsget_classA
查询某个类或接口的完整属性和方法
Inputs: className (required).
get_methodB
查询某个类的特定方法签名和说明
Inputs: className (required), methodName (required).
get_moduleA
查询某个模块包含的所有类和接口
Inputs: moduleName (required).
search_apiB
按关键词搜索框架或Cocos API,支持中英文
Inputs: query (required), source.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct level of the API knowledge hierarchy: search, module, class, and method. There is no overlap in purpose; search returns results, while the get_* tools retrieve specific entities. The hierarchy is clear and unambiguous.
All tool names follow a consistent snake_case verb_noun pattern: search_api, get_module, get_class, get_method. This makes the pattern predictable and easy to infer for additional tools.
Four tools is a minimal but well-scoped set for an API knowledge server. Each tool covers a distinct retrieval need, and the count is neither excessive nor trivially small for the stated purpose.
The set covers the core workflow of searching, navigating to a module, inspecting a class, and getting method details. A minor gap is the absence of a direct 'list modules' tool, but search provides an entry point, making the surface reasonably complete.
Maintenance
Related MCP Connectors
Semantic search over Handsontable and HyperFormula docs, API reference, release notes, and issues.
Search and query nTop's knowledge base and engineering guides from AI applications.
Search @imqueue docs and scaffold typed services & clients from your AI coding agent.
Versioned documentation registry and semantic search for AI tools and coding assistants.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to directly control the Cocos Creator 3.8.x editor via MCP protocol, providing over 130 tools for scene, node, component, asset, and project operations.26 npm44MIT
- -licenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to interact with the Cocos Creator 3.8+ editor through standardized protocols for scene, node, component, prefab, asset, project, debugging, and server operations.-
- AlicenseNot gradedqualityDmaintenanceA comprehensive MCP server for Cocos Creator 3.8+ that enables AI assistants to interact with the editor via 50+ tools for scene, node, component, prefab, asset, and project management.26 npm1MIT
- AlicenseNot gradedqualityDmaintenanceA Cocos Creator 3.8 editor extension that exposes scene, node, component, prefab, preview, build, asset, and debug operations as MCP tools for AI clients like Codex and Claude Code.1MIT