
morinokami/astro-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
Astro プロジェクト開発をサポートするMCPサーバー
概要
Antfu の nuxt-mcp に触発された Astro プロジェクト開発をサポートする MCP サーバー。 このパッケージは実験的で不安定です。 ご使用の際は注意が必要です。 astro-mcp は、Astro プロジェクトをよりよく理解できるよう、プロジェクトファイルを見るだけで簡単にアクセスできない情報を提供することを目指しています。 - Astroサーバーに関するランタイム情報 - 最新のAstro docsコンテンツ - 使用するAstro統合に関する情報 Astro プロジェクトディレクトリで、次のコマンドを実行します。 次に、Astro config に astro-mcp 統合を追加します。 統合後、MCP サーバーは [http://localhost:4321/__mcp/sse.] で利用できます。 接続するには、エディタまたはツールの適切な場所に空の構成ファイルを作成します。 astro-mcp は、Astro サーバーが起動したときに自動的にファイルを更新します.
概要(AI 翻訳)
Antfu の nuxt-mcp に触発された Astro プロジェクト開発をサポートする MCP サーバー。
【重要】 このパッケージは実験的、不安定です。 ご使用の際は注意が必要です。
[astro-mcp] は、Astro プロジェクトをよりよく理解できるようにすることを目的としています。プロジェクトファイルを見るだけで簡単にアクセスできない情報を提供することで、次のようにします。
- Astroサーバーに関するランタイム情報
- 最新のAstro docsコンテンツ
- 使用しているAstroの統合に関する情報
インストール
Astro プロジェクトディレクトリで、次のコマンドを実行します。
手動インストール
まず、astro-mcpパッケージをインストールします。
次に、Astro config に astro-mcp の統合を追加します。
使用法
統合後、MCP サーバーは [[http://localhost:4321/__mcp/sse.]] で利用できます。 接続するには、エディタまたはツールの適切な場所に空の構成ファイルを作成します。
| 編集・ツール | 設定ファイル |
|---|---|
| VSCode | [[[T4] |
| カーソル | 【T5】 |
| ウィンドサーフィン | 【T6】 |
| クロードコード | [[T7] |
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
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