Astro Docs MCP server

Provides direct access to Astro documentation through searchable, categorized resources and curated prompts for helping developers with component architecture, content management, and deployment tasks.
Back to servers
Setup instructions
Provider
Paul Valladares
Release date
Mar 23, 2025
Language
TypeScript
Stats
1 star

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.

Installation Requirements

  • Node.js v16 or later (v20+ recommended)
  • pnpm package manager (preferred over npm)

Setting Up the Server

Installing Dependencies

First, install the required dependencies:

pnpm install

Build the server:

pnpm run build

For development with automatic rebuilding:

pnpm run watch

Running the Server

Start the server using either of these commands:

pnpm start
# OR directly
./bin/astro-docs-mcp

Configuring with Claude Desktop

To use this server with Claude Desktop, you need to add configuration to the appropriate location:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %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.

Using the Server

Available Features

The server provides several capabilities:

Resources

  • Access Astro documentation via astro-docs:// URIs
  • Each documentation section includes title, content, and category

Tools

  • search_docs - Search through Astro documentation with a query parameter

Prompts

  • explain_astro_islands - Get detailed explanations of Astro Islands architecture
  • astro_project_setup - Guide for setting up a new Astro project
  • astro_vs_other_frameworks - Compare Astro with other web frameworks

Interacting with the Documentation

Once configured in Claude Desktop, you can:

  • List available documentation: Use the list command to see available sections
  • Search documentation: Use search <query> to find relevant documentation
  • Read specific sections: Use read astro-docs:///<id> to view a particular section

Troubleshooting

If you encounter issues:

Common Problems

  1. Path Issues:

    • Ensure you're using an absolute path in the configuration
    • Confirm the path points to bin/astro-docs-mcp
    • Verify the build directory exists with ls -la build/
    • Check that scripts have executable permissions
  2. Module Not Found Errors:

    • Make sure you've run the build step (pnpm run build)
    • Verify the script is being run from the correct directory
    • Confirm absolute paths are used for script execution
  3. Node.js Version:

    • Ensure you're using Node.js v16 or later (check with node --version)
  4. Script Permissions:

    • Set executable permissions if needed:
    chmod +x bin/astro-docs-mcp src/scripts/build.js src/scripts/test-client.js
    

Debugging Tools

For better debugging visibility, use the MCP Inspector:

pnpm run inspector

This will provide a URL to access debugging tools in your browser.

Testing the Server

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.

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later