MCP.so
ログイン

Next.js MCP Server

@jazelly

Next.js MCP Server について

Help LLMs to understand your Next apps better

基本情報

カテゴリ

その他

ライセンス

MIT

ランタイム

node

トランスポート

stdio

公開者

jazelly

設定

以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。

{
  "mcpServers": {
    "next-mcp-server": {
      "command": "node",
      "args": [
        "dist/index.js"
      ]
    }
  }
}

ツール

ツールは検出されませんでした

ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。

概要

What is Next.js MCP Server?

It scans your Next.js App Router project directory and extracts detailed information about all API routes, including paths, HTTP methods, parameters, status codes, and request/response schemas. This server outputs structured JSON representations for use with MCP‑compatible tools like Cursor.

How to use Next.js MCP Server?

Install via npm install next-mcp-server or pnpm add next-mcp-server, then build and run node dist/index.js. For Cursor IDE, configure a mcp.json file (in ~/.cursor or project .cursor) pointing to the server’s SSE endpoint (default http://localhost:4857/sse). Docker deployment is also supported.

Key features of Next.js MCP Server

  • Extracts API route paths, HTTP methods, and parameters from App Router projects.
  • Retrieves request and response schemas directly from route files.
  • Identifies status codes and function signatures for each handler.
  • Outputs structured JSON for integration with MCP clients.
  • Supports local CLI execution and Docker deployment.
  • Scans filesystem directory – no network or external dependencies needed.

Use cases of Next.js MCP Server

  • Developers exploring API routes in a Next.js project via an AI assistant.
  • Automatically generating API documentation from existing route files.
  • Providing structured route information to MCP‑enabled IDEs like Cursor for code generation.

FAQ from Next.js MCP Server

What does the server do?

It analyzes your Next.js app directory and returns structured details about all API routes, including methods, paths, parameters, status codes, and schemas.

How do I install and run it?

Install via npm or pnpm, then build and run dist/index.js. Alternatively, use the provided Dockerfile to run it in a container.

Does it work over a network?

No. The server accesses the filesystem by directory path and only works locally. It will not function if hosted over a network.

Which Next.js router does it support?

Only the App Router. Pages Router projects are not supported.

How do I connect it to Cursor?

Create a mcp.json file under ~/.cursor or your project’s .cursor directory with the server’s URL (by default http://localhost:4857/sse). The exact URL may vary based on environment variables.

コメント

「その他」の他のコンテンツ