MTA:SA Documentation MCP Server
MTA:SA 文档 MCP 服务器
一个 MCP (Model Context Protocol) 服务器,为 AI 助手提供可靠、结构化的 Multi Theft Auto: San Andreas 文档访问权限。
它结合了快速关键词搜索、语义匹配和基于 SQLite 的缓存,使智能体能够发现正确的 API 并获取权威文档,而无需手动抓取 Wiki。
亮点
11 个用于发现、文档检索、缓存操作和工作流指导的 MCP 工具
事件优先发现 (
search_events,find_events_for_task)基于 SQLite 向量搜索的语义任务匹配
智能关键词扩展 (例如,
database->db*API)内置弃用检测和警告
具有可配置生命周期的本地 SQLite 缓存
CI 验证门控、冒烟测试和发布自动化
Related MCP server: Documentation Retrieval MCP Server (DOCRET)
安装
要求:
Node.js 24+
Bun 1.3+ (可选运行时)
pnpm 10+ (用于本地开发)
启动器说明:
您可以通过
npx、pnpx、bunx或 yarn dlx 风格的流程启动/安装。运行时支持跨运行时:Node.js (通过
node:sqlite) 和 Bun (通过bun:sqlite)。
从 npm 安装 (推荐)
npm install -g mtasa-docs-mcp或者:
pnpm add -g mtasa-docs-mcp快速安装

从源码安装
git clone https://github.com/Luminaire1337/mtasa-docs-mcp.git
cd mtasa-docs-mcp
pnpm install
pnpm build如果您的环境跳过了可选的本地依赖项,请运行:
pnpm install --forceMCP 客户端设置
Cursor (手动)
全局:~/.cursor/mcp.json
项目:.cursor/mcp.json
{
"mcpServers": {
"mtasa-docs": {
"command": "npx",
"args": ["-y", "mtasa-docs-mcp"]
}
}
}VS Code (手动)
工作区:.vscode/mcp.json
用户:命令面板 -> MCP: Open User Configuration
{
"servers": {
"mtasa-docs": {
"command": "npx",
"args": ["-y", "mtasa-docs-mcp"]
}
}
}或者通过终端添加:
code --add-mcp "{\"name\":\"mtasa-docs\",\"command\":\"npx\",\"args\":[\"-y\",\"mtasa-docs-mcp\"]}"Claude Code (CLI)
claude mcp add-json mtasa-docs '{"type":"stdio","command":"npx","args":["-y","mtasa-docs-mcp"]}'OpenCode (手动)
全局配置文件:~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"mtasa-docs": {
"type": "local",
"command": ["npx", "-y", "mtasa-docs-mcp"],
"enabled": true
}
}
}Antigravity (手动)
配置文件:~/.gemini/antigravity/mcp_config.json
{
"mcpServers": {
"mtasa-docs": {
"command": "npx",
"args": ["-y", "mtasa-docs-mcp"]
}
}
}通用 MCP 客户端 (手动)
{
"mcpServers": {
"mtasa-docs": {
"command": "node",
"args": ["/absolute/path/to/mtasa-docs-mcp/build/index.js"]
}
}
}如果 mtasa-docs-mcp 已经发布,请将命令替换为:
{
"mcpServers": {
"mtasa-docs": {
"command": "npx",
"args": ["-y", "mtasa-docs-mcp"]
}
}
}可用工具
search_functionssearch_eventsfind_functions_for_taskfind_events_for_taskget_function_docsget_multiple_function_docsget_function_exampleslist_functions_by_categoryget_cache_statsrecommend_doc_workflowclear_cache
开发
pnpm build
pnpm test
pnpm test:runtime
pnpm smoke
pnpm smoke:cross-runtime
pnpm verify
pnpm verify:full有用的检查:
pnpm check:versions- 保持package.json和 MCP 服务器版本一致pnpm check:changelog- 确保CHANGELOG.md具有当前发布标题pnpm check:tool-names- 防止遗留工具命名回归pnpm test:runtime- 运行 Node 和 Bun 冒烟路径的集成运行时测试pnpm smoke:cross-runtime- 针对 Node 和 Bun 运行时运行冒烟检查
脚本位于 scripts/ (构建、冒烟、发布防护)。
发布流程
发布自动化由 .github/workflows/release.yml 处理。
在
package.json和src/index.ts中提升版本号。使用
## [x.y.z] - YYYY-MM-DD将发布说明从Unreleased移动到CHANGELOG.md中的版本化部分。创建并推送发布标签:
git tag v<version> && git push origin v<version>。
分支策略:
v1.0.0之前:允许直接推送到master。从
v1.0.0开始:所有对master的更改均使用基于 PR 的开发。
在发布标签推送 (v*.*.*) 时,发布工作流会:
检查版本是否已存在于 npm 上
运行
pnpm verify:full使用受信任的发布 (OIDC) 将带有来源证明的包发布到 npm
使用 GitHub OIDC 将
server.json发布到 MCP 注册表从
CHANGELOG.md创建/更新 GitHub Release验证已发布包的可安装性并运行冒烟测试
维护者设置 npm 受信任发布
在 npm 包设置中,为此存储库和工作流配置受信任的发布者:
存储库:
Luminaire1337/mtasa-docs-mcp工作流文件:
.github/workflows/release.yml环境 (如果使用):匹配您的 GitHub Actions 配置
维护者设置 MCP 注册表发布
确保
server.json存在于存储库根目录并使用此包名称:mtasa-docs-mcp为
io.github.Luminaire1337/mtasa-docs-mcp配置 MCP 注册表所有权发布工作流使用
mcp-publisher login github-oidc,并且仅在 npm 发布门控通过时才发布
CI 工作流
.github/workflows/ci.yml- 推送/PR 到master时的验证 (Ubuntu + macOS),以及标记 PR 上的可选实时 Wiki 集成测试.github/workflows/release.yml- 发布标签 (v*.*.*) 时的自动发布和 GitHub Release
项目文档
AGENTS.md- 架构和贡献者指南FEATURES.md- 路线图和想法CHANGELOG.md- 发布历史SECURITY.md- 漏洞披露政策
许可证
GNU 通用公共许可证 v3.0。请参阅 LICENSE。
Available Tools
11 toolsclear_cacheB
Clear the MTA:SA documentation cache for a specific function or all functions.
Inputs: function_name (required).
find_events_for_taskA
Task-to-events matcher. Use when you need event names for handlers/triggers (e.g., resource lifecycle, player joins, marker hits). Returns ranked MTA:SA events only.
Inputs: task_description (required), side, limit.
find_functions_for_taskA
Task-to-functions matcher. Use this FIRST when user intent is high-level (e.g., 'vehicle dealership', 'login panel'). Returns ranked MTA:SA functions/events optimized for follow-up documentation retrieval.
Inputs: task_description (required), limit.
get_cache_statsB
Get statistics about the MTA:SA documentation cache.
Inputs: no named parameters.
get_function_docsA
Fetch authoritative docs for exactly ONE MTA:SA function/event by canonical name. Preferred over manual web browsing. For multiple names, use get_multiple_function_docs in one call.
Inputs: function_name (required), use_cache, include_optional_arguments.
get_function_examplesA
Get only code examples for one function/event after docs lookup. Use when writing implementation snippets and tests.
Inputs: function_name (required).
get_multiple_function_docsA
Batch docs retrieval for implementation phase. Provide exact function/event names (ideally from search/find tools) and get combined authoritative docs in one response.
Inputs: function_names (required), include_examples, include_optional_arguments.
list_functions_by_categoryA
Enumerate canonical function/event names in a category. Useful for discovery when query terms are vague.
Inputs: category (required), limit.
recommend_doc_workflowA
Planner tool that tells LLMs exactly which mtasa-docs tools to call next for a given task. Use this to enforce MCP-first workflows and avoid manual wiki scraping.
Inputs: task_description (required), known_function_names.
search_eventsA
Event discovery tool. Search MTA:SA client/server events only (not regular functions), then chain into docs tools with exact event names.
Inputs: query (required), side, limit.
search_functionsA
Primary discovery tool. Search MTA:SA functions and events by name or keyword before coding. Returns canonical function names with side/category so LLMs can reliably chain into docs tools.
Inputs: query (required), side, limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool has a clearly distinct purpose: search tools (search_functions, search_events) differ from task matchers (find_functions_for_task, find_events_for_task), retrieval tools handle single/batch/examples, and cache/listing/planner serve unique roles. No overlap or confusion.
All tool names follow a consistent verb_noun snake_case pattern (e.g., clear_cache, search_functions, get_function_docs). No mixing of cases or verb styles, making the pattern predictable and easy to navigate.
With 11 tools, the server is well-scoped for its documentation purpose. Each tool earns its place, covering search, retrieval, cache management, category listing, and workflow planning without excess or deficiency.
The tool surface provides a complete workflow: discover (search/task matchers), retrieve (docs, examples, batch), manage (cache stats/clear), explore (category listing), and plan (workflow recommender). No obvious gaps for a documentation server.
Maintenance
Related MCP Connectors
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
An MCP server that gives your AI access to the source code and docs of all public github repos
An MCP server that integrates with Discord to provide AI-powered features.
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server implementation that provides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation context20 npm263MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI assistants to access up-to-date documentation for Python libraries like LangChain, LlamaIndex, and OpenAI through dynamic fetching from official sources.1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides full-text search over documentation using Whoosh, enabling AI assistants to find up-to-date, authoritative answers.MIT
- AlicenseAqualityDmaintenanceAn MCP server that serves documentation and enables AI-powered search, Q\&A, and document analysis for developer tools and guides.54MIT