Skip to main content
Glama
vertile-ai

Next.js MCP Server

by vertile-ai

Next.js MCP サーバー

Next.js アプリケーションのルートを分析し、詳細な情報を提供するユーティリティ ツールです。

デモ

ルーター分析デモ

Related MCP server: MCP Multi-Context Hook Generator

概要

  • 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

仕組み

ツール:

  1. Next.js アプリのディレクトリ構造をスキャンしてルートファイルを探します

  2. 各ルート ファイルを分析して、HTTP メソッド、パス、パラメータなどを抽出します。

  3. コメントからドキュメントを抽出します

  4. すべてのAPIルートの構造化された表現を返します

ライセンス

マサチューセッツ工科大学

Related MCP Connectors

Related MCP Servers

  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Automatically generates typed React hooks for Next.js projects by crawling API routes, GraphQL queries, and components. Analyzes pages to suggest optimal render modes (SSR/CSR/ISR) and produces documentation with performance guidance.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Automatically generates typed React hooks for Next.js projects by crawling API routes, GraphQL queries, and components. Analyzes pages to suggest optimal render modes (SSR/CSR/ISR) and produces comprehensive documentation with AI-powered guidance.
    -
  • A
    license
    A
    quality
    B
    maintenance
    Provides specialized development tools and utilities for Next.js, allowing AI agents to perform runtime diagnostics and access official documentation. It enables automated context initialization and real-time interaction with Next.js development servers to query application state.
    4
    128,501 npm
    824
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides code analysis for Next.js projects through the Model Context Protocol, enabling IDE and LLM integration to identify unused files, dead code, and redundant API endpoints.
    18 npm
    8
    MIT