Skip to main content
Glama

Next.js MCP Server

by vertile-ai

Next.js MCP 服务器

一个实用工具,可分析您的 Next.js 应用程序路由并提供有关它们的详细信息。

演示

路由器分析演示

概述

  • get-routers-info路由器分析器会扫描您的 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

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 路由的结构化表示

执照

麻省理工学院

-
security - not tested
A
license - permissive license
-
quality - not tested

一个实用工具,用于分析 Next.js 应用程序路由并提供有关 API 路径、HTTP 方法、参数、状态代码和请求/响应模式的详细信息。

  1. 演示
    1. 概述
      1. 安装
        1. 用法
          1. 命令行
          2. Docker
        2. 输出
          1. 发展
            1. 工作原理
              1. 执照

                Related MCP Servers

                • -
                  security
                  A
                  license
                  -
                  quality
                  An unofficial JavaScript SDK to create customized servers for the Model Context Protocol, allowing definition of prompts, resources, and tools for tailored interactions.
                  Last updated -
                  6
                  2
                  JavaScript
                  Apache 2.0
                  • Linux
                  • Apple
                • A
                  security
                  A
                  license
                  A
                  quality
                  A comprehensive Model Context Protocol server that provides advanced Node.js development tooling for automating project creation, component generation, package management, and documentation with AI-powered assistance.
                  Last updated -
                  7
                  2
                  JavaScript
                  MIT License
                • A
                  security
                  A
                  license
                  A
                  quality
                  Node.js server implementing Model Context Protocol that enables interaction with TaskWarrior through natural language to view, filter, add, and complete tasks.
                  Last updated -
                  3
                  13
                  1
                  JavaScript
                  MIT License
                • -
                  security
                  F
                  license
                  -
                  quality
                  A Node.js and TypeScript server project that provides a simple starter example with Express.js web server, supporting hot-reload, testing, and modular structure.
                  Last updated -
                  TypeScript

                View all related MCP servers

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/vertile-ai/next-mcp-server'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server