Astro MCP server: how AI coding tools work with Astro
The Astro MCP server is Astro's free, official docs server that lets AI coding tools like Claude Code, Cursor, and VS Code search the current Astro documentation while they write code. In our test, AI got all five Astro 7 tasks right with it and failed three without it. Here's how it works and how to set it up.
Key takeaways
- The official Astro Docs MCP server gives any MCP-compatible AI tool a search tool over the current Astro docs, for free, with one URL and nothing to install.
- The community astro-mcp integration lets an agent read your own project's config, routes, and dev server, but its author still labels it experimental.
- Astro 7 detects AI agents and, on macOS and Linux, runs the dev server in the background with JSON logs, so agents stop hanging on astro dev.
- In our test, the AI got all five Astro 7 tasks right when it could search the docs. Without the Docs MCP, three of its five answers failed the build.
- Docs access works alongside project rules and code review. It removes outdated-API mistakes, while your team still owns architecture and quality.
Coding agents have become the way a lot of web development gets done. According to the Stack Overflow 2026 Developer Survey, two-thirds of developers who use AI now work with coding agents, and the most popular ones are Claude Code (66%) and GitHub Copilot (59%).
Astro creates a timing problem for those agents. The framework shipped two major versions in 2026, and the models behind the agents learned Astro from older code, so they confidently write Astro 6 config for an Astro 7 project.
This guide covers the Astro web framework. Astronomer sells an unrelated data platform also called Astro, with its own MCP server.
The Astro MCP server is Astro's official, free Docs MCP server, which lets AI tools like Claude Code, Cursor, and VS Code search the current Astro documentation while they answer questions or write code.
What is the Astro MCP server?
The Astro MCP server is a free, remote server at mcp.docs.astro.build/mcp that gives AI coding tools a search tool over the official Astro documentation. When Claude, Cursor, or Copilot is unsure how an Astro API works today, it can query the docs and write code for the current version instead of from memory.
MCP stands for Model Context Protocol, an open standard for connecting AI apps to outside data and tools. The Model Context Protocol docs compare it to "a USB-C port for AI applications," meaning one standard plug works across every compatible tool. If you're new to the framework itself, start with what Astro is and how it works.
Astro needs this more than most frameworks because it moves faster than model training data. Astro 6 shipped in March 2026, and Astro 7 followed in June. The June release changed the compiler, the default Markdown processor, and how whitespace is handled. If a model learned Astro from 2025 code, it still writes code the way Astro 5 expected, but that code can break the build on Astro 7.
The three Astro MCP layers
People use "Astro MCP" to mean three different things:
Astro Docs MCP server (official)
The Docs MCP exposes one tool, search_astro_docs. The agent sends a question, and the server returns the matching sections of the docs with links, drawn from an index the Astro team keeps current through the kapa.ai API.
According to the official Astro guide to building with AI tools, the server is free, open source, and runs remotely with nothing to install. It uses Streamable HTTP, which most current AI tools support natively.
When we queried it about the background dev server, it returned the exact CLI reference section for --background in one call, including the exception for Windows.
The server has no view of your project, since it knows how Astro works in general but nothing about your config, components, or content. That gap is what the second layer covers.
The astro-mcp integration (community)
astro-mcp, built by community developer morinokami, runs inside your project as an Astro integration. While the dev server runs, it exposes facts a model can't get from reading files alone:
- The resolved Astro config, including integrations and output settings
- Every route, with its URL pattern, parameters, and prerender status
- The dev server's address and port
- Metadata and changelogs for Astro packages and integrations
In practice, you can ask an agent which routes are prerendered before switching a section to server rendering, and it answers from the running server instead of guessing from folder names.
Once you create an empty config file for your editor, astro-mcp fills it in for VS Code, Cursor, Windsurf, or Claude Code each time the dev server starts. Its README calls the project "experimental and unstable," so we treat it as a local development aid and keep it out of production builds.
Astro 7 background dev server
Astro 7 tackled a problem every agent user has had. The Astro 7 release post explains that because a dev server never exits, agents "hang, start duplicate servers, lose track of running instances, or leave zombie processes behind."
The fix is astro dev --background, which starts the server as a managed background process. When Astro detects that an AI agent is running it, background mode switches on automatically, along with JSON logs that agents can parse. Three commands let the agent check in later:
- astro dev status shows whether a server is already running, and where
- astro dev logs returns the server output
- astro dev stop shuts it down
Automatic background mode works on macOS and Linux. On Windows, the server stays in the foreground, and you can opt out on any system by setting ASTRO_DEV_BACKGROUND=0.
Background mode lives in the Astro CLI rather than in an MCP server, but the same agents that call the Docs MCP depend on it. For anyone paying for development time, fewer stalled agent runs means fewer hours spent watching an AI restart a server.
Astro Docs MCP test: with vs without
We tested the Docs MCP on 28 November 2026. We set up a clean project on Astro 7.4.13, the current release at the time, and gave two fresh Claude sessions on the same model five identical requests.
One session could search the docs through the Astro Docs MCP, and the other had to answer from memory. We applied every answer to the project, ran astro build, and checked that the result did what was asked.
Each request touches something that changed in Astro 7, picked from the Astro v7 upgrade guide:
- Cache everything under /blog for 5 minutes with 1 minute of stale-while-revalidate, using Astro's built-in route caching.
- Create src/fetch.ts with a getJSON(url) helper the blog pages can import.
- Store contact form submissions in a local database, set up with Astro DB like a previous project.
- Fix the spaces that disappeared between inline elements after an upgrade.
- Fix a remark-toc table of contents that stopped rendering after an upgrade.
With docs access, every answer built cleanly and did exactly what the request asked for. Without it, three of five failed the build, and the other two worked with a catch:
- One switched off HTML minification across the whole site.
- The other left a file that breaks the build the day the site adds server rendering, which something as common as a contact form needs.
The docs-enabled session needed only eight searches across the five requests.
The session without docs access did flag low confidence on three of its five answers and told us to test them. That's honest, but in a busy sprint the warning gets skipped once the code looks right in the editor.
Five requests is a small sample, and we picked them to hit changed APIs, so the test shows what happens at the edges of a new release rather than an average error rate. Those edges are where teams lose the most time to AI guesses, though.
How to set up the Astro MCP server
Whichever AI tool you use, it connects to the same Astro Docs server, so you only need its web address. Some tools also ask for a name and a transport, which is the method the tool and the server use to communicate. These are the values to use:
- Name: Astro Docs
- URL: https://mcp.docs.astro.build/mcp
- Transport: Streamable HTTP
Where you enter those details depends on the tool. The table below shows how each one adds the server, and whether it also works with the astro-mcp integration, which can configure itself automatically in some editors.
Path 1: No-code setup in Claude.ai
This is the simplest option if you don't work in a code editor. It suits marketers, PMs, and content leads who want accurate answers about Astro without opening a repository, like checking whether Astro supports a feature before a planning call.
- In Claude, select Customize in the sidebar, then Connectors.
- Select Add, then Custom, and choose Web if Claude asks for a connector type.
- Name it Astro docs and paste https://mcp.docs.astro.build/mcp as the server URL.
- Click Add, then turn the connector on in a chat from the tools menu.
Custom connectors work on every Claude plan, though a Free account can add only one. On Team and Enterprise plans, an Owner adds the connector for the organization first. If connectors are new to you, our complete guide to Claude and Webflow shows how they work on a real website.
Path 2: Claude Code, Cursor, and VS Code
In Claude Code, one command adds the server:
claude mcp add --transport http astro-docs https://mcp.docs.astro.build/mcp
Cursor and VS Code have one-click install buttons on Astro's guide. For most other MCP-compatible tools, this config works:
{
"mcpServers": {
"Astro docs": {
"type": "http",
"url": "https://mcp.docs.astro.build/mcp"
}
}
}
Astro Docs MCP vs llms.txt and Context7
Astro also publishes llms.txt files, static Markdown copies of its docs that any AI tool can read, even without MCP support. However, they cost far more tokens than a targeted search and go stale between releases.
Context7 is a general docs MCP that covers many libraries at once, which helps when the packages around Astro change just as fast.
For Astro itself, we stick with the official server.
Astro MCP in a website stack
An Astro site rarely runs on Astro alone. Content lives in a CMS, the site runs on a host, and each layer now has its own MCP server, so one agent session can work across all of them.
On a Sanity and Astro build, for example, an agent can write components with the Astro Docs MCP open while Sanity's MCP server reads the content model, so a new template matches the fields editors already use. Well-modeled content is what makes that possible, which we explain in our piece on structured content for LLMs.
Webflow follows the same pattern, since Webflow Cloud deploys Astro apps next to Webflow sites and the Webflow MCP server handles the Webflow side of the same project. When Cloudflare acquired the Astro team in January 2026, its acquisition press release called Astro "the backbone for successful platforms like Webflow and Wix that run on Cloudflare."
Here's how the work splits when you ask an agent to add a case study template that pulls from the CMS and renders as a static route:
- The CMS MCP reads the case study schema and its fields.
- The Astro Docs MCP confirms the current content loader and routing APIs.
- astro-mcp checks the existing routes and their prerender settings.
- Astro 7's background mode keeps the dev server running while the agent previews the page.
The same layering works with other frameworks. If you're still deciding between them, our Astro vs Next.js comparison covers which one fits a marketing site.
Where Astro MCP falls short
- Docs knowledge is generic. The Docs MCP knows Astro and nothing about your design system, naming conventions, or performance budget. A project rules file (AGENTS.md for most tools, CLAUDE.md for Claude Code) carries that context, and it matters as much as docs access.
- astro-mcp is experimental. It opens a local endpoint into your running project, so keep it on development machines and away from shared or public environments.
- Your questions leave your machine. The Docs MCP sends search queries to a hosted index, and Claude.ai connectors reach it from Anthropic's servers. Docs searches rarely contain anything sensitive, but teams with strict AI policies should approve the connection before rolling it out.
- Agents only benefit when they search. In our test, the session with docs access searched at least once per request. An agent that skips the tool falls straight back to memory, so a rules line telling it to check the Astro docs first is worth adding.
AI makes Astro builds faster when a person owns the architecture and reviews what ships. These tools remove a whole class of outdated-API bugs, and the judgment about what to build stays with your team.
Getting started with Astro and AI
We'd roll it out in this order:
- Connect the Astro Docs MCP in the AI tool your team already uses. It takes a minute and costs nothing.
- Add a rules file with your Astro version, output mode, component conventions, and the commands that prove a change is safe.
- Try astro-mcp on a branch once agents are doing real work in the codebase.
If Astro itself is still an open question, our comparison of enterprise website platforms shows where it fits next to Webflow, Sanity, and Next.js, and our breakdown of what an Astro website costs covers hosting and build budgets.
Our Astro development team builds content-driven Astro sites with Sanity, using AI-assisted development with human review before every release. If you want a second opinion on your stack or your AI workflow, let's talk.
FAQs about Astro MCP
Is the Astro Docs MCP server free?
Yes. The official Astro Docs MCP server is free and open source, and it needs no account, API key, or local install. We connected using only the server URL. Your AI tool's own limits still apply, like the Claude Free plan allowing only one custom connector.
Does the Astro Docs MCP server read my project files?
No. The server exposes a single docs search tool and never gets access to your files. Your AI tool reads your files locally and sends the server only the search queries it writes, so what comes back is documentation, with nothing about your project stored or returned.
Which Astro version does the Docs MCP cover?
The Astro Docs MCP searches the current Astro documentation, which covers Astro 7. If your project runs an older major version, state the version in your project rules file so the agent doesn't apply Astro 7 APIs to an Astro 5 or 6 codebase.
Does Astro 7 background mode work on Windows?
Not automatically. Automatic background mode runs only on macOS and Linux, so on Windows astro dev stays in the foreground even when an AI agent is detected, and the agent manages the process directly. You can still start a background server by hand with astro dev --background.
Can an AI agent deploy an Astro site through MCP?
Not through any Astro MCP tool today. The Docs MCP, astro-mcp, and Astro 7's agent mode all stop before deployment. Publishing runs through your host's CLI or Git integration, like Cloudflare, Netlify, Vercel, or Webflow Cloud, and we recommend a human approval step before anything reaches production.
Does Windsurf support the Astro Docs MCP?
Yes, through a local proxy. Windsurf doesn't support the Streamable HTTP transport the server uses, so you add it with npx mcp-remote pointed at https://mcp.docs.astro.build/mcp in Windsurf's mcp_config.json.


See your website the way a senior strategist does
Foresight scans your site across 10 strategy dimensions. You get a scored breakdown of every gap costing you leads.
Your web team, no hiring
One call with the team behind 200+ B2B websites. You'll leave knowing what your site needs, whether or not we're the ones doing it.
Continue reading





Ready to escape your CMS nightmare?
100+ successful migrations. 0 ranking disasters at launch. One embedded team that's done this before.





