MCP integration
Expose next-lens data to IDEs or copilots via MCP.
Run next-lens mcp to start a Model Context Protocol server that exposes the
same route insights to supporting tools.
Configure a client
Add a server entry to your MCP client (example JSON):
{
"mcpServers": {
"next-lens": {
"command": "npx",
"args": ["next-lens@latest", "mcp"]
}
}
}Available tools
api-list— list API routes; acceptstargetDirectoryandmethod.page-list— list page routes; acceptstargetDirectory.api-search— filter API routes bysearchplus optionalmethod.page-search— filter page routes bysearch.
Each tool uses the same validation as the CLI (e.g., HTTP method checking) and returns JSON payloads ready for client-side rendering or further filtering.