Skip to content
Back to search

next-mcp-server

Help LLMs to understand your Next apps better

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/vertile-ai--next-mcp-server/badge.svg)](/listings/vertile-ai--next-mcp-server)

HTML

<a href="/listings/vertile-ai--next-mcp-server"><img src="/api/listings/vertile-ai--next-mcp-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

npm install next-mcp-server

Or if you're using pnpm:

pnpm add next-mcp-server

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 140 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Next.js MCP Server
  2. ## Demo
  3. ![Router analysis demo](assets/demo1.png)
  4. ## Features
  5. - `get-routers-info`
  6. The Router Analyzer scans your Next.js app directory structure and extracts information about all API routes, including:
  7. - API paths
  8. - HTTP methods (GET, POST, PUT, DELETE, etc.)
  9. - Request parameters
  10. - Status codes
  11. - Request and response schemas
  12. ## Installation
  13. ```bash
  14. npm install next-mcp-server
  15. ```
  16. Or if you're using pnpm:
  17. ```bash
  18. pnpm add next-mcp-server
  19. ```
  20. ## Usage
  21. ### Command Line
  22. You can run the mcp server directly:
  23. ```bash
  24. npm run build
  25. node dist/index.js
  26. ```
  27. ### Docker
  28. ```bash
  29. docker build -t mcp/next -f Dockerfile .
  30. docker run mcp/next -d
  31. ```
  32. For cursor usage, define a `mcp.json` under `~/.cursor` or `[projectDir]/.cursor`
  33. ```
  34. {
  35. "mcpServers": {
  36. "next.js": {
  37. "url": "http://localhost:4857/sse"
  38. }
  39. }
  40. }
  41. ```
  42. The `url` here could vary based on your .env settings within the project.
  43. ## Output
  44. The tool generates detailed information about each route:
  45. ```javascript
  46. [
  47. {
  48. "filePath": "/path/to/your/app/api/test/route.ts",
  49. "implementationPath": "/path/to/your/app/api/test/route.ts",
  50. "apiPath": "/api/test",
  51. "handlers": [
  52. {
  53. "method": "GET",
  54. "path": "/api/test",
  55. "functionSignature": "export async function GET(request: Request)",
  56. "description": "Get test data",
  57. "parameters": [],
  58. "statusCodes": [200]
  59. },
  60. {
  61. "method": "POST",
  62. "path": "/api/test",
  63. "functionSignature": "export async function POST(request: Request)",
  64. "description": "Create test data",
  65. "parameters": [],
  66. "requestBodySchema": "{ name: string }",
  67. "statusCodes": [201, 400]
  68. }
  69. ]
  70. }
  71. ]
  72. ```
  73. ## Development
  74. To run tests:
  75. ```bash
  76. npm run test
  77. ```
  78. To run the mcp server locally:
  79. ```bash
  80. npm run build
  81. node dist/index.js
  82. ```
  83. To run it from node_modules after `npm i`:
  84. ```bash
  85. node node_modules/next-mcp-server/dist/index.js
  86. ```
  87. To run the playground:
  88. ```bash
  89. pnpm --filter playground dev
  90. ```
  91. ## How It Works
  92. The tool:
  93. 1. Scans your Next.js app directory structure for route files
  94. 2. Analyzes each route file to extract HTTP methods, paths, parameters, etc.
  95. 3. Extracts documentation from comments
  96. 4. Returns a structured representation of all your API routes
  97. ## Restrictions
  98. 1. Due to the nature of accessing filesystem directory by path, it will not work if hosted over network
  99. 2. Only supports Next.js App router projects
  100. ## License
  101. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.