
morinokami/astro-mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
MCP-сервер для поддержки разработки проекта Astro
Обзор
MCP-сервер для поддержки разработки проекта Astro, вдохновленный nuxt-mcp антфу. Этот пакет экспериментальный и нестабильный. Будьте осторожны при его использовании. Astro-mcp стремится помочь моделям лучше понять ваш проект Astro, предоставляя им информацию, к которой невозможно легко получить доступ, просто просмотрев файлы проекта, такие как: - Информация о времени выполнения сервера Astro - Актуальный контент Astro docs - Информация об используемой вами интеграции Astro В каталоге проекта Astro запустите следующую команду: Затем добавьте интеграцию astro-mcp в конфигурацию Astro: После установки интеграции сервер MCP будет доступен по адресу http://localhost:4321/__mcp/sse. Для подключения создайте пустой файл конфигурации в соответствующем месте для вашего редактора или инструмента: Astro-mcp автоматически обновляет файл при запуске сервера Astro.
Обзор (машинный перевод)
MCP-сервер для поддержки разработки проекта Astro, вдохновленный nuxt-mcp антфу.
[!Важно] Этот пакет является экспериментальным и неустойчивым. Будьте осторожны при его использовании.
T0 стремится помочь моделям лучше понять ваш проект Astro, предоставляя им информацию, к которой невозможно легко получить доступ, просто просмотрев файлы проекта, такие как:
- Информация о времени выполнения сервера Astro Актуальный контент Astro Docs Информация об интеграции Astro, которую вы используете
##Установка
В каталоге проекта Astro запустите следующую команду:
Ручная инсталляция
Во-первых, установите пакет astro-mcp:
Затем добавьте astro-mcp интеграцию в конфигурацию Astro:
Использование
После установки интеграции сервер MCP будет доступен по адресу http://localhost:4321/__mcp/sse. Для подключения создайте пустой файл конфигурации в соответствующем месте для вашего редактора или инструмента:
| Редактор / Инструмент | Конфигурационный файл
VSCode | .vscode/mcp.json
Обсуждение Cursor | .cursor/mcp.json
Виндсерфинг ~/.codeium/windsurf/mcp_config.json
Код Клода .mcp.json
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
astro-mcp
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
Installation
In your Astro project directory, run the following command:
npx astro add astro-mcp
Manual installation
First, install the astro-mcp package:
npm install astro-mcp
Then, add the astro-mcp integration to your Astro config:
import { defineConfig } from "astro/config";
import mcp from "astro-mcp";
export default defineConfig({
integrations: [mcp()],
});
Usage
After installing the integration, the MCP server will be available at http://localhost:4321/__mcp/sse. To connect, create an empty configuration file in the appropriate location for your editor or tool:
| Editor/Tool | Configuration File |
|---|---|
| VSCode | .vscode/mcp.json |
| Cursor | .cursor/mcp.json |
| Windsurf | ~/.codeium/windsurf/mcp_config.json |
| Claude Code | .mcp.json |
astro-mcp will automatically update the file when the Astro server starts.
Extending the MCP server
astro-mcp provides a hook called mcp:setup that other integrations can use to extend the MCP server. This is useful if you want to add custom tools to the MCP server.
export default function createExampleIntegration(): AstroIntegration {
return {
name: "example-integration",
hooks: {
"mcp:setup": async ({ mcp }) => {
mcp.tool("add", { a: z.number(), b: z.number() }, async ({ a, b }) => ({
content: [{ type: "text", text: String(a + b) }],
}));
},
},
};
}
Tools
get-astro-config: Get the Astro config object containing comprehensive project settings including file paths (root, src, public, output directories), site URL, build options, server settings, enabled integrations, markdown processing configuration, image handling, Vite plugins, security settings, and experimental features- Parameters: None
list-astro-routes: List detailed routing information from your Astro project, including all routes with their file entrypoints, URL patterns, dynamic parameters, pre-rendering status, and route types. Optionally filter by type to focus on specific route categories- Parameters:
type(string, optional):redirect,page,endpoint, orfallback
- Parameters:
Установка
npx astro add astro-mcp