The Astro Docs MCP Server provides AI assistants with access to Astro documentation for helping users with Astro-related tasks. It implements a documentation retrieval system that allows searching and referencing different sections of the Astro documentation through a structured interface.
First, install the required dependencies:
pnpm install
Build the server:
pnpm run build
For development with automatic rebuilding:
pnpm run watch
Start the server using either of these commands:
pnpm start
# OR directly
./bin/astro-docs-mcp
To use this server with Claude Desktop, you need to add configuration to the appropriate location:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%/Claude/claude_desktop_config.json
Add the following configuration, making sure to use the absolute path to the script:
{
"mcp_servers": [
{
"id": "astro-docs-mcp",
"name": "Astro Docs",
"command": "/full/absolute/path/to/astro-mcp/bin/astro-docs-mcp",
"type": "built-in"
}
]
}
For example, if the repository is at /Users/username/projects/astro-mcp
, the command would be:
"/Users/username/projects/astro-mcp/bin/astro-docs-mcp"
After adding the configuration, restart Claude Desktop.
The server provides several capabilities:
astro-docs://
URIssearch_docs
- Search through Astro documentation with a query parameterexplain_astro_islands
- Get detailed explanations of Astro Islands architectureastro_project_setup
- Guide for setting up a new Astro projectastro_vs_other_frameworks
- Compare Astro with other web frameworksOnce configured in Claude Desktop, you can:
list
command to see available sectionssearch <query>
to find relevant documentationread astro-docs:///<id>
to view a particular sectionIf you encounter issues:
Path Issues:
bin/astro-docs-mcp
ls -la build/
Module Not Found Errors:
pnpm run build
)Node.js Version:
node --version
)Script Permissions:
chmod +x bin/astro-docs-mcp src/scripts/build.js src/scripts/test-client.js
For better debugging visibility, use the MCP Inspector:
pnpm run inspector
This will provide a URL to access debugging tools in your browser.
Verify the server is working correctly:
pnpm test
# OR directly
node src/scripts/test-client.js
This sends several commands to the server and displays the responses.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "astro-docs-mcp" '{"command":"/full/absolute/path/to/astro-mcp/bin/astro-docs-mcp"}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"astro-docs-mcp": {
"command": "/full/absolute/path/to/astro-mcp/bin/astro-docs-mcp"
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"astro-docs-mcp": {
"command": "/full/absolute/path/to/astro-mcp/bin/astro-docs-mcp"
}
}
}
3. Restart Claude Desktop for the changes to take effect