Astro Docs MCP Server
Astro Docs MCP 服务器
一个 MCP 服务器,用于向 AI 代理提供 Astro 文档访问权限。该服务器允许 AI 助手在帮助用户执行 Astro 相关任务时查找和参考 Astro 文档。
这个基于 TypeScript 的 MCP 服务器为 Astro 实现了一个文档检索系统。它通过提供以下功能演示了 MCP 的核心概念:
代表 Astro 文档部分的资源,包含 URI 和元数据
Astro 文档搜索工具
常见 Astro 问题和任务的提示
特征
资源
通过
astro-docs://URI 列出并访问 Astro 文档每个文档部分都有标题、内容和类别
用于简单内容访问的纯文本 MIME 类型
工具
search_docs- 搜索 Astro 文档将搜索查询作为必需参数
返回匹配的文档部分
提示
explain_astro_islands- 获取 Astro Islands 建筑的详细解释astro_project_setup- 建立新 Astro 项目的指南astro_vs_other_frameworks- 将 Astro 与其他 Web 框架进行比较
Related MCP server: Dedalus MCP Documentation Server
项目结构
src/——MCP 服务器的源代码index.ts- 主 MCP 服务器实现scripts/——用于构建和测试的辅助脚本build.js- 构建转换 TypeScript 并创建启动器脚本的脚本test-client.js- 测试客户端以验证服务器功能
bin/——生成的可执行脚本astro-docs-mcp- MCP 服务器的主启动脚本
build/——编译的 JavaScript 文件(生成)
要求
需要 Node.js v16 或更高版本
建议使用 Node.js v20+ 以获得最佳兼容性
服务器使用 ES 模块语法
pnpm 包管理器(优于 npm)
安装
安装依赖项
安装依赖项:
pnpm install构建服务器:
pnpm run build对于使用自动重建的开发:
pnpm run watch运行服务器
pnpm start
# OR directly
./bin/astro-docs-mcp使用 Claude Desktop 进行配置
要与 Claude Desktop 一起使用,请添加服务器配置:
在 MacOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json
重要:配置必须使用脚本的绝对路径:
{
"mcp_servers": [
{
"id": "astro-docs-mcp",
"name": "Astro Docs",
"command": "/full/absolute/path/to/astro-mcp/bin/astro-docs-mcp",
"type": "built-in"
}
]
}将/full/absolute/path/to/astro-mcp/替换为安装目录的实际绝对路径。
例如,如果存储库位于/Users/username/projects/astro-mcp ,则命令为:
"/Users/username/projects/astro-mcp/bin/astro-docs-mcp"调试
由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们推荐使用MCP Inspector ,它以包脚本的形式提供:
pnpm run inspector检查器将提供一个 URL 来访问浏览器中的调试工具。
测试
提供测试客户端来验证服务器是否正常工作:
pnpm test
# OR directly
node src/scripts/test-client.js这将向服务器发送几个命令并显示响应。
故障排除
如果您遇到服务器问题:
路径问题:最常见的问题是配置中的路径不正确。请确保:
您正在使用 claude_desktop_config.json 中脚本的绝对路径
该路径指向
bin/astro-docs-mcp(不是根脚本)构建目录存在并包含 index.js (
ls -la build/)所有脚本均具有可执行权限
“找不到模块”错误:如果您看到类似
Cannot find module '/build/index.js'错误,请检查:您已运行构建步骤(
pnpm run build)脚本正在从正确的目录运行
脚本执行时使用绝对路径
Node.js 版本:请确保您使用的是 Node.js v16 或更高版本。为了获得最佳效果,请使用 v20 及以上版本。
node --version脚本权限:确保脚本具有可执行权限:
chmod +x bin/astro-docs-mcp src/scripts/build.js src/scripts/test-client.jsJSON 输出问题:发送到标准输出 (stdout) 的调试消息会导致 Claude Desktop 出现问题,因为它只接受有效的 JSON 格式。我们的脚本可以正确地将所有调试输出重定向到标准输出 (stderr)。
与 Claude Desktop 一起使用
按照上述安装步骤安装服务器。
通过编辑配置文件来配置 Claude Desktop,使其包含脚本的绝对路径:
{ "mcp_servers": [ { "id": "astro-docs-mcp", "name": "Astro Docs", "command": "/full/absolute/path/to/astro-mcp/bin/astro-docs-mcp", "type": "built-in" } ] }重新启动 Claude Desktop。
您现在可以使用以下命令与 Astro 文档进行交互:
list——列出可用的 Astro 文档部分search <query>- 搜索 Astro 文档read astro-docs:///<id>- 阅读特定文档部分
未来的增强功能
从 Astro 网站获取实时文档
添加更全面的文档部分
实施文档版本控制支持
添加常见 Astro 模式的代码示例和片段
Available Tools
1 toolsearch_docsC
Search Astro documentation
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search term to find in Astro documentation |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action but reveals nothing about how the search works (e.g., scope, ranking, pagination), what the output looks like, or any constraints like rate limits or authentication needs. This leaves significant gaps for a tool with undocumented behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise at just three words, front-loading the essential action and resource without any wasted text. Every word earns its place, making it efficient and straightforward for an agent to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete for a search tool. It doesn't explain what the search returns, how results are structured, or any behavioral nuances, leaving the agent with insufficient context to use the tool effectively beyond the basic parameter.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with the single parameter 'query' clearly documented as 'Search term to find in Astro documentation'. The description adds no additional parameter details beyond what the schema provides, so it meets the baseline for high schema coverage without compensating value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('Search') and resource ('Astro documentation'), making it immediately understandable. However, with no sibling tools mentioned, there's no opportunity to demonstrate differentiation from alternatives, which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, prerequisites, or contextual limitations. While the absence of sibling tools reduces the need for differentiation, it still lacks any usage instructions or exclusions, leaving the agent with minimal operational context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.0- First observed
search_docs
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion or overlap between tools. The single tool 'search_docs' has a clearly distinct and unambiguous purpose.
The single tool name 'search_docs' follows a clear verb_noun pattern, and with only one tool, consistency is inherently perfect as there are no other names to compare against.
A single tool for an 'Astro Docs MCP Server' feels too thin for the apparent scope. While search is a core function, documentation servers typically benefit from additional tools like browsing, filtering, or retrieving specific pages, making this count borderline inadequate.
The tool surface is severely incomplete for a documentation server. It only provides search functionality, lacking obvious gaps such as retrieving documentation pages, listing categories, or navigating content, which are essential for comprehensive agent interaction with documentation.
Maintenance
Related MCP Connectors
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
An MCP server that integrates with Discord to provide AI-powered features.
An MCP server that gives your AI access to the source code and docs of all public github repos
Related MCP Servers
- 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
- AlicenseAqualityDmaintenanceAn MCP server that serves documentation and enables AI-powered search, Q\&A, and document analysis for developer tools and guides.54MIT
- AlicenseNot gradedqualityAmaintenanceAn MCP server that provides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation context.32 npmMIT
- AlicenseNot gradedqualityBmaintenanceMCP server for Astro/Starlight docs sites, providing search, get, and list tools for documentation content.91 npm13MIT