MCP server to support Astro project development, inspired by antfu's nuxt-mcp.
Important
This package is experimental and unstable. Proceed with caution when using it.
astro-mcp aims to help models understand your Astro project better, by providing them with information that cannot be easily accessed just by looking at the project files, such as:
- Runtime information about the Astro server
- Up-to-date Astro docs content
- Information about the Astro integrations you are using
In your Astro project directory, run the following command:
npx astro add astro-mcpFirst, install the astro-mcp package:
npm install astro-mcpThen, add the astro-mcp integration to your Astro config:
import { defineConfig } from "astro/config";
import mcp from "astro-mcp";
export default defineConfig({
integrations: [mcp()],
});After installing the integration, the MCP server will be available at http://localhost:4321/__mcp/sse.
You can use this URL to connect to the MCP server:
- If you are using VSCode, create an empty
.vscode/mcp.jsonfile in the root of your project.astro-mcpwill automatically update this file when the Astro server starts. - If you are using Cursor, create an empty
.cursor/mcp.jsonfile in the root of your project.astro-mcpwill automatically update this file when the Astro server starts.