Project Navigator MCP Server
Integrates with VS Code's GitHub Copilot Agent Mode to provide the same codebase navigation capabilities, enabling AI-powered code exploration and safe command execution.
Project Navigator MCP Server
MCP-сервер для навигации по кодовой базе. Позволяет AI-агенту в IDE самостоятельно исследовать проект: просматривать файлы, искать символы и запускать безопасные команды — без ручного копирования кода в чат.
Как работает MCP
IDE запускает MCP-сервер как дочерний процесс и общается с ним через stdin/stdout. Агент вызывает инструменты (tools) — типизированные функции с описанием и схемой параметров. Это позволяет агенту автономно получать контекст из внешних источников (файловая система, команды) вместо того, чтобы ждать, пока пользователь всё скопирует вручную.
В этом сервере tool — это изолированная функция с именем, описанием, JSON-схемой входных параметров и структурированным JSON-ответом.
Related MCP server: Files MCP Server
Инструменты
Инструмент | Описание |
| Список файлов и папок в директории |
| Чтение содержимого файла (опционально — диапазон строк) |
| Поиск файлов по glob-паттерну ( |
| Полнотекстовый поиск по файлам проекта |
| Запуск команды из whitelist |
Tool outputs contract
Все инструменты возвращают структурированный JSON:
// list_directory
{ entries: Array<{ name: string; type: "file" | "dir"; path: string }> }
// read_file
{ content: string; total_lines: number; path: string }
// find_files
{ files: string[]; count: number }
// search_code
{ matches: Array<{ file: string; line: number; content: string }>; count: number }
// run_command
{ stdout: string; stderr: string; exit_code: number; success: boolean }Ошибки возвращаются через стандартный MCP error response.
Структура проекта
src/
index.ts ← bootstrap (env → startServer)
server.ts ← McpServer, регистрация инструментов
logger/
index.ts ← logCall / logSuccess / logError → stderr
index.test.ts
security/
index.ts ← assertInProjectRoot (path traversal guard)
index.test.ts
tools/
list-directory/index.ts + index.test.ts
read-file/index.ts + index.test.ts
find-files/index.ts + index.test.ts
search-code/index.ts + index.test.ts
run-command/index.ts + index.test.tsЗапуск через Docker (рекомендуется)
Node.js на машине не нужен.
docker build -t project-navigator-mcp .Проверка (smoke test):
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \
| docker run --rm -i project-navigator-mcpОжидаемый результат — JSON с 5 инструментами: list_directory, read_file, find_files, search_code, run_command.
Ограничение
run_commandв Docker: инструмент запускает команды в директорииPROJECT_ROOT. Еслиnode_modulesцелевого проекта установлен на другой ОС (например, macOS), нативные биндинги (rolldown,esbuildи т.п.) не будут работать внутри Linux-контейнера. В этом случаеnpm testупадёт с ошибкой о нативном модуле — это ограничение окружения, не сервера. Для запуска тестов используйте Node.js-вариант (без Docker) или предварительно выполнитеnpm installв целевом проекте внутри контейнера.
Интеграция с агентами и IDE
MCP — открытый протокол. Сервер работает с любым MCP-совместимым клиентом; меняется только путь к конфиг-файлу и название ключа.
Во всех примерах замените /ABSOLUTE/PATH/TO/PROJECT на абсолютный путь к проекту, который хотите исследовать.
Без Docker: замените блок
"command": "docker", "args": ["run", ...]на"command": "node", "args": ["/path/to/simple-mcp-server/dist/index.js"]и добавьте"env": { "PROJECT_ROOT": "/path/to/project" }.
Claude Code
Добавьте один раз в глобальный ~/.claude/settings.json:
{
"mcpServers": {
"project-navigator": {
"command": "sh",
"args": ["-c", "docker run --rm -i -v \"$(pwd):/project:ro\" -e PROJECT_ROOT=/project project-navigator-mcp"]
}
}
}$(pwd) автоматически подставляет директорию, из которой запущен Claude Code — путь к проекту указывать не нужно. Просто откройте любой проект и начните новый разговор:
cd /any/project
claudeВажно: если конфиг добавлен на уровне проекта (
.claude/settings.json), но сервер не появляется — добавьте его в глобальный~/.claude/settings.json. Также убедитесь, что начали новый разговор — MCP-серверы регистрируются при старте сессии.
Claude Desktop
Claude Desktop не привязан к директории проекта, поэтому путь нужно указать явно.
Файл:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"project-navigator": {
"command": "sh",
"args": ["-c", "docker run --rm -i -v \"/ABSOLUTE/PATH/TO/PROJECT:/project:ro\" -e PROJECT_ROOT=/project project-navigator-mcp"]
}
}
}Замените /ABSOLUTE/PATH/TO/PROJECT на путь к нужному проекту. Перезапустите Claude Desktop.
VS Code (GitHub Copilot Agent Mode)
Требует VS Code 1.99+ с GitHub Copilot.
Файл: .vscode/mcp.json в целевом проекте (добавьте в репозиторий — будет работать у всех участников).
{
"servers": {
"project-navigator": {
"type": "stdio",
"command": "sh",
"cwd": "${workspaceFolder}",
"args": ["-c", "docker run --rm -i -v \"$(pwd):/project:ro\" -e PROJECT_ROOT=/project project-navigator-mcp"]
}
}
}${workspaceFolder} — встроенная переменная VS Code, автоматически подставляет корень открытого проекта. Путь указывать не нужно.
Откройте Copilot Chat → переключитесь в режим Agent → сервер подключится автоматически.
Отличие от других клиентов: ключ
"servers"(не"mcpServers"), обязательное"type": "stdio"и поддержка"cwd"с переменными.
Cursor
Файл: ~/.cursor/mcp.json (глобально) или .cursor/mcp.json (в проекте)
{
"mcpServers": {
"project-navigator": {
"command": "sh",
"args": ["-c", "docker run --rm -i -v \"$(pwd):/project:ro\" -e PROJECT_ROOT=/project project-navigator-mcp"]
}
}
}Cursor запускает MCP-сервер с cwd = корень открытого проекта, поэтому $(pwd) подставляется автоматически. Перезапустите Cursor — инструменты появятся в Cursor Agent.
Запуск без Docker
npm install
npm run buildПроверка:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | node dist/index.jsСоздайте .env (по образцу .env.example):
PROJECT_ROOT=/path/to/your/project
ALLOWED_COMMANDS=npm run build,npm test,npm run lint,npm run dev,npx tsc --noEmitБезопасность
Файловые инструменты ограничены папкой
PROJECT_ROOT— выход за пределы возвращает ошибкуread_fileне читает файлы с именем.env*run_commandиспользуетchild_process.spawn(неexec), команда проверяется по точному совпадению с whitelist — shell-инъекции невозможны
Логи
Сервер пишет в stderr:
[CALL] list_directory { "path": "src" }
[SUCCESS] list_directory duration=12ms
[CALL] run_command { "command": "rm -rf /" }
[ERROR] run_command reason="command not in whitelist"В логах никогда не появляется содержимое файлов и вывод команд — только метаданные вызова.
Demo сценарии
# | Запрос | Инструмент |
1 | «Покажи структуру папки src» |
|
2 | «Найди все TypeScript файлы в проекте» |
|
3 | «Где используется |
|
4 | «Покажи строки 1–30 файла server.ts» |
|
5 | «Запусти тесты» |
|
Available Tools
5 toolsfind_filesA
Find files by glob pattern within the project. Example pattern: "**/*.ts"
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | Glob pattern, e.g. "**/*.ts" | |
| directory | No | Directory to search in (relative to project root). Defaults to project root. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description bears full burden. It describes basic behavior but omits details like performance, limits, or return format. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence with an example pattern. Very concise, front-loaded, and efficient without unnecessary text.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema, so description should hint at return format. It does not describe what the tool returns (e.g., list of file paths). However, given low complexity, it is minimally adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%. The tool description adds an example pattern but does not provide additional meaning beyond what the schema already specifies for parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool finds files by glob pattern within the project, and provides an example. This distinctly differentiates it from siblings like list_directory or search_code.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives such as search_code. The description implies its use for pattern-based file discovery but lacks context for exclusion.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_directoryB
List files and folders in a directory within the project
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Directory path relative to project root | . |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden for behavioral disclosure. It does not mention output format (e.g., only names? full paths?), error handling, or whether it follows symlinks. This lack of detail is problematic for a listing tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence with no wasted words. However, it could include more details in the same length (e.g., what is returned).
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of output schema, the description should explain the return value (e.g., list of file/folder names, paths, or metadata). It does not, leaving the agent guessing about the output structure.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with a description for the 'path' parameter. The tool description adds 'within the project' which is redundant with the schema's 'relative to project root'. No new semantic value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'List files and folders in a directory within the project' clearly states the action (list) and the resource (files and folders in a directory). It is distinct from sibling tools like find_files (search), read_file (content), run_command (execute), and search_code (text search).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It does not mention scenarios where listing is appropriate or when to use other tools like find_files for filtering.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_fileA
Read file contents. Line numbers are 1-indexed.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path relative to project root | |
| start_line | No | First line to read (1-indexed) | |
| end_line | No | Last line to read, inclusive (1-indexed) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It discloses that line numbers are 1-indexed but omits behavior for missing files, permissions, or whether the whole file is read if no range is specified. Adequate but not comprehensive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise, with two sentences that contain no unnecessary words. Every part earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description does not explain the return format. While the tool is simple, information about what is returned (e.g., file content as a string) would improve completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the description adds 'line numbers are 1-indexed' which reinforces the schema. While this adds value, it is minimal beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool reads file contents and notes line indices. It is distinct from siblings like find_files, list_directory, run_command, and search_code, which handle searching, listing, and execution.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies reading file contents but does not provide explicit guidance on when to use this tool versus siblings, such as for direct file access vs. searching. No alternatives or exclusions are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
run_commandA
Run a whitelisted shell command. Allowed commands: npm run build, npm test, npm run lint, npm run dev, npx tsc --noEmit
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | Exact command string (must match whitelist exactly) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the behavioral burden. It states the tool runs whitelisted shell commands but does not disclose output handling, error behavior, or whether the command runs in a specific directory or environment. This is adequate but not detailed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence of 15 words, extremely concise with no fluff. It front-loads the purpose and immediately lists allowed commands.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given a simple tool with one parameter and no output schema, the description covers the essential constraint (whitelist). It could be improved by mentioning that output is returned as stdout/stderr or that errors are non-zero exit codes, but it is largely sufficient for an agent to use correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, and the description adds value by listing allowed command strings beyond the schema's generic description. The schema says 'must match whitelist exactly', and the description makes the whitelist explicit.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Run' and the resource 'whitelisted shell command', listing specific allowed commands. It clearly distinguishes from sibling tools like find_files and search_code which are not shell execution.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly lists allowed commands (npm run build, npm test, etc.), indicating when to use the tool. It does not explicitly state when not to use it or provide alternatives, but the whitelist serves as clear guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_codeB
Full-text search across project files
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Text string to search for | |
| directory | No | Directory to search in (relative to project root). Defaults to project root. | |
| file_pattern | No | Glob to filter which files are searched, e.g. "*.ts" |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden but does not disclose important behaviors like return format, scope of search, performance considerations, or handling of no results.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise (one sentence) and front-loaded, but omits essential information that could be added without bloat.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of output schema, the description is incomplete: it does not describe what the tool returns (e.g., file paths, line numbers, code snippets) or any constraints.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already documents all parameters. The description adds no additional meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Full-text search across project files' clearly states the tool's purpose with specific verb and resource. It distinguishes from siblings like find_files (file name search) and read_file (file content reading).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No usage guidelines provided. The description does not mention when to use this tool vs alternatives such as find_files or list_directory.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
5 tool updates
v1.0.0- First observed
find_files - First observed
list_directory - First observed
read_file - First observed
run_command - First observed
search_code
TDQS
Each tool has a clearly distinct purpose: find_files locates files by pattern, list_directory lists directory contents, read_file reads file contents, run_command executes commands, and search_code does full-text search. No overlapping functionality.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., find_files, list_directory), making them predictable and easy to understand.
With 5 tools covering file discovery, browsing, reading, searching, and command execution, the count is well-scoped for a project navigator, neither too few nor excessive.
The tool set covers core navigation and search needs, and the ability to run whitelisted commands adds flexibility. Missing write/delete operations, but these are typically out of scope for a navigator, so only minor gaps.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Securely search and manage workspace context files for AI agents and teams.
Codebase intelligence for agents: 152 structured artifacts across 21 programs, one call.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to intelligently search and explore local file systems using native Unix commands (ripgrep, find, ls) with token-optimized output, automatic pagination, and multi-layer security validation.1642-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to safely explore directories, read files, search content by pattern or filename, and edit files with checksum verification and dry-run preview within sandboxed filesystem access.1675ISC
- FlicenseBqualityDmaintenanceEnables LLMs to search and read files in local and GitHub repositories, analyze pull request diffs, and grep code content with built-in security protections.6-
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to generate annotated file trees, retrieve file statistics, list git-changed files, and read file contents from local directories or GitHub repositories.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/hrustalevdev/simple-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server