An MCP server that provides AI assistants with access to Astro documentation, enabling them to search and reference Astro docs when helping users with Astro-related tasks.
An MCP server for providing Astro documentation access to AI agents. This server allows AI assistants to look up and reference Astro documentation when helping users with Astro-related tasks.
This TypeScript-based MCP server implements a documentation retrieval system for Astro. It demonstrates core MCP concepts by providing:
astro-docs://
URIssearch_docs
- Search Astro documentation
explain_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 frameworkssrc/
- Source code for the MCP server
index.ts
- Main MCP server implementationscripts/
- Helper scripts for building and testing
build.js
- Build script that transpiles TypeScript and creates launcher scriptstest-client.js
- Test client for verifying server functionalitybin/
- Generated executable scripts
astro-docs-mcp
- Main launcher script for the MCP serverbuild/
- Compiled JavaScript files (generated)Install dependencies:
pnpm install
Build the server:
pnpm run build
For development with auto-rebuild:
pnpm run watch
pnpm start # OR directly ./bin/astro-docs-mcp
To use with Claude Desktop, add the server config:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
Important: The configuration must 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" } ] }
Replace /full/absolute/path/to/astro-mcp/
with the actual absolute path to your installation directory.
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"
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
pnpm run inspector
The Inspector will provide a URL to access debugging tools in your browser.
A test client is provided to verify the server is working correctly:
pnpm test # OR directly node src/scripts/test-client.js
This will send several commands to the server and display the responses.
If you encounter issues with the server:
Path Issues: The most common problem is incorrect paths in the configuration. Make sure:
bin/astro-docs-mcp
(not the root script)ls -la build/
)"Module not found" errors: If you see errors like Cannot find module '/build/index.js'
, check:
pnpm run build
)Node.js Version: Make sure you're using Node.js v16 or later. For best results, use v20+.
node --version
Script Permissions: Ensure the scripts have executable permissions:
chmod +x bin/astro-docs-mcp src/scripts/build.js src/scripts/test-client.js
JSON Output Issues: Debug messages being sent to stdout will confuse Claude Desktop because it expects only valid JSON. Our scripts properly redirect all debug output to stderr.
Install the server by following the installation steps above.
Configure Claude Desktop by editing the configuration file to include 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" } ] }
Restart Claude Desktop.
You can now interact with the Astro documentation using the following commands:
list
- List available Astro documentation sectionssearch
- Search the Astro documentationread astro-docs:///
- Read a specific documentation sectionDiscover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!