Next.js MCP サーバー
Next.js アプリケーションのルートを分析し、詳細な情報を提供するユーティリティ ツールです。
デモ
概要
get-routers-info
Router Analyzer は、Next.js アプリのディレクトリ構造をスキャンし、次のようなすべての API ルートに関する情報を抽出します。
APIパス
HTTP メソッド (GET、POST、PUT、DELETE など)
リクエストパラメータ
ステータスコード
リクエストとレスポンスのスキーマ
これは、ドキュメント作成、テスト、または API 管理ツールとの統合に特に役立ちます。
インストール
npm install next-mcp-server
またはpnpmを使用している場合:
pnpm add next-mcp-server
使用法
コマンドライン
mcp サーバーを直接実行できます。
npm run build
node dist/index.js
ドッカー
docker build -t mcp/next -f Dockerfile .
docker run mcp/next -d
出力
このツールは各ルートに関する詳細情報を生成します。
[
{
"filePath": "/path/to/your/app/api/test/route.ts",
"implementationPath": "/path/to/your/app/api/test/route.ts",
"apiPath": "/api/test",
"handlers": [
{
"method": "GET",
"path": "/api/test",
"functionSignature": "export async function GET(request: Request)",
"description": "Get test data",
"parameters": [],
"statusCodes": [200]
},
{
"method": "POST",
"path": "/api/test",
"functionSignature": "export async function POST(request: Request)",
"description": "Create test data",
"parameters": [],
"requestBodySchema": "{ name: string }",
"statusCodes": [201, 400]
}
]
}
]
発達
テストを実行するには:
node run-router-test.js
仕組み
ツール:
Next.js アプリのディレクトリ構造をスキャンしてルートファイルを探します
各ルート ファイルを分析して、HTTP メソッド、パス、パラメータなどを抽出します。
コメントからドキュメントを抽出します
すべてのAPIルートの構造化された表現を返します
ライセンス
マサチューセッツ工科大学
Related MCP Servers
- -securityFlicense-qualityEnables real-time communication between applications and AI models using the Model Context Protocol, supporting features like custom tools and multiple transport options for Next.js applications.Last updated -30,136
- -securityFlicense-qualityRoutes requests to multiple downstream Model Context Protocol servers and provides a LangGraph.js-based agent with RAG capabilities for development assistance.Last updated -
- AsecurityFlicenseAqualityEnables AI assistants to access Ramp's developer documentation and API schemas through natural language queries. Provides contextual answers about API endpoints, authentication methods, data relationships, and implementation patterns for developers building on Ramp's platform.Last updated -4
- AsecurityFlicenseAqualityEnables efficient extraction of specific data from JSON APIs using JSONPath patterns, reducing token usage by up to 99% compared to fetching entire responses. Supports single and batch operations for both JSON extraction and raw text retrieval from URLs.Last updated -41