Repo Lens MCP Server
Allows discovery of API routes in Express.js projects, extracting route patterns and HTTP methods.
Allows discovery of API routes in Fastify projects, extracting route patterns and HTTP methods.
Allows discovery of API routes in Laravel projects, extracting route patterns and HTTP methods.
Allows discovery of API routes in NestJS projects, extracting route patterns and HTTP methods.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Repo Lens MCP Server find the createUser function in all repos"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Repo Lens MCP Server
Cross-repository code intelligence for developers.
Search functions, classes, and API routes across all your local JS/TS and PHP repositories without switching context.
Why Use This?
The problem: You're working in your frontend repo and need to find a backend API endpoint. Or you're debugging and need to find where a function is defined across your monorepo. With Claude Code, you can search the current repository, but what about your other local projects?
The solution: Repo Lens lets you declare your repositories once in a YAML config file — or search any directory ad-hoc — and search across all of them simultaneously using AST-based structural search. Find the exact function signature, class definition, or API route you need without leaving your current context.
Use Cases
Frontend + Backend development: Search backend API routes while working in your frontend repo
PHP + JS/TS projects: Find PHP classes, traits, and interfaces alongside TypeScript types
Microservices architecture: Find function definitions across multiple services
Monorepo navigation: Search across packages without switching directories
Code exploration: Understand how different projects in your ecosystem connect
Related MCP server: Carrick
Quickstart
npx repo-lens-mcpKey Features
AST-Based Intelligence
Unlike grep-style text search, Repo Lens uses ast-grep (written in Rust) to parse code into Abstract Syntax Trees:
Structural accuracy: Distinguish between
class Userandconst UserExport awareness: Find only exported functions, or include private ones
Signature extraction: Get full function signatures, not just names
Zero-Friction Search
Search any directory instantly with the paths parameter — no configuration required:
Pass directory paths directly to any search tool
Declare persistent repos in
repolens.yamlwith aliases for repeated useMix both: registered repos + ad-hoc paths in the same query
Multi-Repository Search
Declare your repositories once and search them all at once:
Static YAML config — declare once, search always
Filter by repository alias or search all
Results include repository context
API Route Discovery
Map all API endpoints across Express, NestJS, Fastify, and Laravel projects. Find that /users/:id endpoint in seconds.
Installation
Claude Desktop / VS Code (Recommended)
Add this to your claude_desktop_config.json (or VS Code MCP settings):
{
"mcpServers": {
"repo-lens": {
"command": "npx",
"args": ["-y", "repo-lens-mcp", "--config", "/home/user/repolens.yaml"]
}
}
}Restart Claude, and you're ready to go.
Local Development
git clone https://github.com/YohannHommet/repo-lens-mcp.git
cd repo-lens-mcp
pnpm install
pnpm build
pnpm devConfiguration
Config File (repolens.yaml)
Create a YAML config file declaring your repositories:
# repolens.yaml
repositories:
- path: ~/projects/backend-api
alias: backend
- path: ~/projects/frontend-app
alias: frontend
- path: ~/projects/shared-lib~ is expanded to your home directory automatically.
Config Path Resolution
--config <path>CLI argument (explicit — fails if file not found)Default:
~/.config/repo-lens-mcp/repolens.yaml(graceful — returns empty if not found, ad-hoc paths still work)
Environment Variables
Variable | Default | Description |
|
| Log level: |
Example:
{
"env": {
"MCP_LOG_LEVEL": "debug"
}
}Capabilities
Repository Listing (1 tool)
Tool | Description |
| List all configured repositories (read-only) |
Symbol Search (3 tools)
AST-based structural search powered by ast-grep. Supports JavaScript/TypeScript and PHP (classes, traits, interfaces, enums, functions, methods, constants):
Tool | Description |
| Find function/method definitions in JS/TS and PHP (supports wildcards like |
| Find class definitions (also finds PHP traits) |
| Find interfaces and type aliases (PHP: interfaces only) |
All search tools accept:
paths— Ad-hoc directory paths to search (comma-separated, no registration needed)repoFilter— Filter registered repositories by alias
API Route Discovery (1 tool)
Tool | Description |
| Map API endpoints across Express, NestJS, Fastify, Laravel |
Usage Examples
1. Search Any Directory (No Configuration)
"Find all functions starting with 'handle' in my backend"
repolens_find_functions(paths: "/home/user/projects/backend", name: "handle*")2. List Configured Repos
"What repos are available?"
repolens_list_repositories()3. Find an API Endpoint
"Find the Express route that handles POST requests to /login"
repolens_find_api_routes(repoFilter: "backend", method: "POST", pathPattern: "/login")4. Find a Specific Class
"Where is the UserService class defined?"
repolens_find_classes(name: "UserService")What About Text Search / File Operations?
Repo Lens focuses on multi-repository AST-based search. For text search and file operations within your current repository, use Claude Code's built-in tools (Grep, Read, Glob) which are optimized for single-repo use.
This separation keeps Repo Lens fast and focused on what it does best: cross-repository structural code intelligence.
License
AGPL-3.0
This software is free to use. If you modify and distribute it (or run it as a network service), you must share your source code under the same license.
Available Tools
5 toolsrepolens_find_api_routesFind API RoutesARead-onlyIdempotent
Find API route/endpoint definitions in backend code across repositories.
Searches for HTTP route definitions in Express, Fastify, NestJS, and Laravel codebases.
Supported Frameworks: Express, Fastify, NestJS, Laravel (PHP)
Args:
method (string, optional): Filter by HTTP method: "GET", "POST", "PUT", "DELETE", "PATCH"
pathPattern (string, optional): Filter routes containing this path segment (e.g., "/users", "/api/v1")
paths (string, optional): Ad-hoc directory paths to search (comma-separated). No registration needed.
repoFilter (string, optional): Filter registered repositories by alias (comma-separated)
framework (string, optional): Filter by framework: "express", "fastify", "nestjs", "laravel"
maxResults (number, optional): Maximum results to return (default: 100)
response_format (string, optional): Output format - "markdown" (default) or "json"
Examples:
Search a directory directly: paths="/home/user/projects/api"
Find all user endpoints: pathPattern="/users"
Find POST routes in backend: repoFilter="backend-api", method="POST"
Find NestJS controllers: framework="nestjs"
Inputs: paths, method, framework, maxResults, +3 more. Returns: count, results
repolens_find_classesFind ClassesARead-onlyIdempotent
Find class definitions across repositories using AST analysis.
Searches for class declarations. Also finds PHP traits. Uses ast-grep for accurate structural matching.
Args:
name (string, optional): Class name pattern. Supports wildcards: "*Service", "Controller", "Base"
paths (string, optional): Ad-hoc directory paths to search (comma-separated). No registration needed.
repoFilter (string, optional): Filter registered repositories by alias (comma-separated)
language (string, optional): Filter by language: "typescript", "javascript", "php"
exportedOnly (boolean, optional): Only return exported classes (default: false)
maxResults (number, optional): Maximum results to return (default: 100)
response_format (string, optional): Output format - "markdown" (default) or "json"
Examples:
Search a directory directly: paths="/home/user/projects/api"
Find all services: name="*Service"
Find controllers in backend: repoFilter="backend", name="*Controller"
Inputs: name, paths, language, maxResults, +3 more. Returns: count, results
repolens_find_functionsFind FunctionsARead-onlyIdempotent
Find function and method definitions across repositories using AST analysis.
Searches for function declarations, arrow functions, and class methods in JS/TS and PHP. Uses ast-grep for accurate structural matching.
Args:
name (string, optional): Function name pattern. Supports wildcards: "handle*", "*Controller", "user"
paths (string, optional): Ad-hoc directory paths to search (comma-separated). No registration needed.
repoFilter (string, optional): Filter registered repositories by alias (comma-separated)
language (string, optional): Filter by language: "typescript", "javascript", "php"
exportedOnly (boolean, optional): Only return exported functions (default: false)
maxResults (number, optional): Maximum results to return (default: 100)
response_format (string, optional): Output format - "markdown" (default) or "json"
Examples:
Search a directory directly: paths="/home/user/projects/api"
Find all handlers: name="handle*"
Find exported functions in backend: repoFilter="backend", exportedOnly=true
Inputs: name, paths, language, maxResults, +3 more. Returns: count, results
repolens_find_typesFind TypesARead-onlyIdempotent
Find type aliases and interface definitions across repositories using AST analysis.
Searches for both "type" and "interface" declarations. For PHP, finds interface declarations (PHP has no type aliases). Uses ast-grep for accurate structural matching.
Args:
name (string, optional): Type/interface name pattern. Supports wildcards: "*Props", "Config", "I"
paths (string, optional): Ad-hoc directory paths to search (comma-separated). No registration needed.
repoFilter (string, optional): Filter registered repositories by alias (comma-separated)
language (string, optional): Filter by language: "typescript", "javascript", "php"
exportedOnly (boolean, optional): Only return exported types (default: false)
maxResults (number, optional): Maximum results to return (default: 100)
response_format (string, optional): Output format - "markdown" (default) or "json"
Examples:
Search a directory directly: paths="/home/user/projects/api"
Find all props types: name="*Props"
Find interfaces with prefix: name="I*", exportedOnly=true
Inputs: name, paths, language, maxResults, +3 more. Returns: count, results
repolens_list_repositoriesList RepositoriesARead-onlyIdempotent
List all configured repositories available for cross-repository search.
Returns the list of repositories declared in repolens.yaml with their aliases, paths, and git branch info.
Args:
response_format (string, optional): Output format - "markdown" (default) or "json"
Inputs: response_format.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct code construct: repositories, functions, classes, types/interfaces, and API routes. The descriptions clearly separate concerns, so an agent is unlikely to confuse one tool for another.
All tool names follow the consistent `repolens_<verb>_<noun>` pattern using snake_case. The verb choices are uniform (`list` for one, `find` for the rest) and the object nouns clearly indicate the target.
Five tools is well-scoped for a focused cross-repository code search server. Each tool covers a meaningful piece of the search surface without redundant or unnecessary entries.
The set covers the primary search needs for functions, classes, types, and API routes across repositories. Notable gaps remain such as full-text search, enums, variables, or imports, but these are workable minor omissions rather than critical dead ends.
Maintenance
Related MCP Connectors
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Enterprise code intelligence for M&A, security audits, and tech debt. Hosted server with 200k free.
Ask a codebase what calls what: search, blast radius, paths between symbols, and diffs.
Ask who calls a route, what a change breaks or who reads a field, across a system's repos.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceCode-search engine that parses TypeScript and JavaScript with a real AST, stores the symbol graph in SQLite, and serves AI assistants exact matching declarations (functions, classes, types) via BM25 fused with declaration-exact ranking — saving tokens by returning only the relevant code instead of whole files.7 npm4MIT

Carrickofficial
FlicenseNot gradedqualityBmaintenanceEnables AI coding agents to query a live, type-aware, intent-aware cross-repo index of an organization's TypeScript services, answering semantic questions about functions, endpoints, types, and behavior across repositories. It also supports validation of cross-repo API mismatches and same-repo checks.7-- AlicenseNot gradedqualityCmaintenanceEnables AI agents to navigate and refactor a codebase through an AST index, offering project overviews, symbol and usage search, module dependency exploration, and LSP-backed operations such as rename, go-to-definition, diagnostics, and extract-method. Supports TypeScript/JavaScript and C# with automatic reindexing and watch mode.MIT
- FlicenseNot gradedqualityCmaintenanceEnables agents to look up how symbols in a codebase are called — signatures, parameters or props with resolved types, optionality, defaults, docblocks and declaration locations — and to list a module's exports and find where a symbol is used. Works across TypeScript, JavaScript and PHP projects.-