Project Explorer MCP Server
<div align="center">
<img src="promo_material/Logo_Long_Badge.png" alt="MCP Explorer" width="520">
> **A powerful Model Context Protocol server for exploring, analyzing, and managing project files with advanced search capabilities**
>
> **š¦ Available on npm:** [`@team-jd/mcp-project-explorer`](https://www.npmjs.com/package/@team-jd/mcp-project-explorer)
[](https://www.npmjs.com/package/@team-jd/mcp-project-explorer)
[](https://www.npmjs.com/package/@team-jd/mcp-project-explorer)
[](https://nodejs.org)
[](https://www.typescriptlang.org)
[](https://github.com/MausRundung/mcp-explorer)
**[ā¶ Watch the demo](https://youtu.be/iZL3MSk1ApI)**
</div>
## ā” Quick Start
```json
{
"mcpServers": {
"project-explorer": {
"command": "npx",
"args": ["-y", "@team-jd/mcp-project-explorer", "/your/project/path"]
}
}
}
```
**With disabled tools:**
```json
{
"mcpServers": {
"project-explorer": {
"command": "npx",
"args": [
"-y",
"@team-jd/mcp-project-explorer",
"/your/project/path",
"--disable-tool=delete_file"
]
}
}
}
```
---
## š¬ Demo
<a href="https://youtu.be/iZL3MSk1ApI">
<img src="https://img.youtube.com/vi/iZL3MSk1ApI/hqdefault.jpg" alt="Watch the Project Explorer demo on YouTube" width="720">
</a>
ā¶ **[Watch the full demo on YouTube](https://youtu.be/iZL3MSk1ApI)**
---
## šø Stop Wasting Tokens
<div align="center">
<img src="promo_material/Stop_Wasting_Tokens_Banner.png" alt="Stop wasting tokens" width="780">
</div>
Every line of raw file content your agent reads is context it never gets back. Project Explorer is built to answer structural questions without dumping files into the conversation:
- š§ **`explore_project`** returns a compact file listing plus an import/export dependency graph ā no need to open files to understand a codebase
- šÆ **`search_files`** trims output with `snippetLength`, `maxResults`, `extensions`, `excludePatterns`, `excludeComments` and `excludeStrings`, so you get only the lines that matter
- š« Build and vendor noise (`node_modules`, `dist`, `.git`, `.next`, ā¦) is always skipped
- āļø **`--disable-tool`** removes tools you don't use from the tool list entirely, shrinking the schema payload sent with every request
---
## š Overview
The Project Explorer MCP Server provides comprehensive tools for analyzing project structures, searching through codebases, managing dependencies, and performing file operations. Perfect for developers who need intelligent project navigation and analysis capabilities.
## š¦ Installation & Setup
### š For MCP Users (Recommended)
Add this server to your MCP settings configuration:
```json
{
"mcpServers": {
"project-explorer": {
"command": "npx",
"args": [
"-y",
"@team-jd/mcp-project-explorer",
"/path/to/your/project"
]
}
}
}
```
**š Multiple Directory Access:**
```json
{
"mcpServers": {
"project-explorer": {
"command": "npx",
"args": [
"-y",
"@team-jd/mcp-project-explorer",
"/path/to/project1",
"/path/to/project2",
"/path/to/project3"
]
}
}
}
```
**š« Disabling Specific Tools:**
Use `--disable-tool=tool_name` or `--disable-tool tool_name` to disable tools you don't want available. Disabled tools won't appear in the tools list and can't be called.
```json
{
"mcpServers": {
"project-explorer": {
"command": "npx",
"args": [
"-y",
"@team-jd/mcp-project-explorer",
"/path/to/project",
"--disable-tool=delete_file",
"--disable-tool", "rename_file"
]
}
}
}
```
**š¦ Available tools you can disable:**
- `explore_project`
- `list_allowed_directories`
- `search_files`
- `rename_file`
- `delete_file`
- `check_outdated`
### š ļø For Developers
```bash
# Clone and setup for development
git clone https://github.com/MausRundung/mcp-explorer.git
cd mcp-explorer
# Install dependencies
npm install
# Build the project
npm run build
# Run the MCP inspector for testing
npm run inspector
```
---
## š ļø Available Commands
### š `explore_project`
**Analyzes project structure with detailed file information and import/export analysis**
```typescript
// Basic usage
explore_project({
directory: "/path/to/project"
})
// Advanced usage
explore_project({
directory: "/path/to/project",
subDirectory: "src", // Optional: focus on specific subdirectory
includeHidden: false // Optional: include hidden files (default: false)
})
```
**⨠Features:**
- š File size analysis with human-readable formatting
- š Import/export statement detection for JS/TS and Dart files
- š¦ Flutter/Dart dependency graph: resolves `package:` URIs, implicit-relative imports, and `part`/`part of` codegen links via `pubspec.yaml` (including local `path:` dependencies in monorepos)
- š¦ `pubspec.yaml` summaries: package name, SDK constraints, dependency counts, path deps, declared assets
- š« Automatically excludes build directories (`node_modules`, `.git`, `dist`, `.vscode`, `.gradle`, `.idea`, `.dart_tool`, `Pods`, `ephemeral`, etc.)
- š Recursive directory traversal
- šÆ Support for subdirectory analysis
---
### š `search_files`
**Advanced file and code search with comprehensive filtering capabilities**
```typescript
// Simple text search
search_files({
pattern: "your search term",
searchPath: "/path/to/search"
})
// Advanced search with filters
search_files({
pattern: "function.*async", // Regex pattern
searchPath: "/path/to/search",
regexMode: true, // Enable regex
caseSensitive: false, // Case sensitivity
extensions: [".js", ".ts"], // File types to include
excludeExtensions: [".min.js"], // File types to exclude
excludeComments: true, // Skip comments
excludeStrings: true, // Skip string literals
maxResults: 50, // Limit results
sortBy: "relevance" // Sort method
})
```
**šļø Search Options:**
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `pattern` | string | *required* | Search pattern (text or regex). No default |
| `searchPath` | string | *first allowed dir* | Directory to search in |
| `extensions` | string[] | *all* | Include only these file types |
| `excludeExtensions` | string[] | `[]` | Exclude these file types |
| `excludePatterns` | string[] | `[]` | Exclude filename patterns |
| `regexMode` | boolean | `false` | Treat pattern as regex |
| `caseSensitive` | boolean | `false` | Case-sensitive search |
| `wordBoundary` | boolean | `false` | Match whole words only |
| `multiline` | boolean | `false` | Multiline regex matching |
| `maxDepth` | number | *unlimited* | Directory recursion depth |
| `followSymlinks` | boolean | `false` | Follow symbolic links |
| `includeBinary` | boolean | `false` | Search in binary files |
| `minSize` | number | *none* | Minimum file size (bytes) |
| `maxSize` | number | *none* | Maximum file size (bytes) |
| `modifiedAfter` | string | *none* | Files modified after date (ISO 8601) |
| `modifiedBefore` | string | *none* | Files modified before date (ISO 8601) |
| `snippetLength` | number | `50` | Text snippet length around matches |
| `maxResults` | number | `100` | Maximum number of results |
| `sortBy` | string | `"relevance"` | Sort by: relevance, file, lineNumber, modified, size |
| `groupByFile` | boolean | `true` | Group results by file |
| `excludeComments` | boolean | `false` | Skip comments (language-aware, incl. Dart) |
| `excludeStrings` | boolean | `false` | Skip string literals |
| `excludeGenerated` | boolean | `false` | Skip generated Dart parts (`*.g.dart`, `*.freezed.dart`, `*.mocks.dart`, ā¦) |
| `outputFormat` | string | `"text"` | Output format: text or json |
**šÆ Use Cases:**
- š Find all TODO comments: `pattern: "TODO.*", excludeStrings: true`
- š Search for potential bugs: `pattern: "console\\.log", regexMode: true`
- š¦ Find import statements: `pattern: "import.*from", regexMode: true`
- š§ Recent changes: `modifiedAfter: "2024-01-01", extensions: [".js", ".ts"]`
---
### š `check_outdated`
**Checks for outdated npm packages with detailed analysis**
```typescript
// Basic check
check_outdated({
projectPath: "/path/to/project"
})
// Detailed analysis
check_outdated({
projectPath: "/path/to/project",
includeDevDependencies: true, // Include dev dependencies
outputFormat: "detailed" // detailed, summary, or raw
})
```
**š Output Formats:**
- **`detailed`** - Full package info with versions and update commands
- **`summary`** - Count of outdated packages by type
- **`raw`** - Raw npm outdated JSON output
**š§ Requirements:**
- Node.js and npm must be installed
- Valid `package.json` in the specified directory
---
### šļø `delete_file`
**Safely delete files or directories with protection mechanisms**
```typescript
// Delete a file
delete_file({
path: "/path/to/file.txt"
})
// Delete a directory (requires recursive flag)
delete_file({
path: "/path/to/directory",
recursive: true, // Required for directories
force: false // Force deletion of read-only files
})
```
**ā ļø Safety Features:**
- š Only works within allowed directories
- š Requires `recursive: true` for non-empty directories
- š”ļø Protection against accidental deletions
- ā” Optional force deletion for read-only files
---
### āļø `rename_file`
**Rename or move files and directories**
```typescript
// Simple rename
rename_file({
oldPath: "/path/to/old-name.txt",
newPath: "/path/to/new-name.txt"
})
// Move to different directory
rename_file({
oldPath: "/path/to/file.txt",
newPath: "/different/path/file.txt"
})
```
**⨠Features:**
- š Works with both files and directories
- š Can move between directories
- š« Fails if destination already exists
- š Both paths must be within allowed directories
---
### š `list_allowed_directories`
**Shows which directories the server can access**
```typescript
list_allowed_directories()
```
**š§ Use Cases:**
- š Check access permissions before operations
- š”ļø Security validation
- š Directory discovery
---
## šØ Usage Examples
### š Project Analysis Workflow
```typescript
// 1. Check what directories you can access
list_allowed_directories()
// 2. Explore the project structure
explore_project({
directory: "/your/project/path",
includeHidden: false
})
// 3. Search for specific patterns
search_files({
pattern: "useState",
searchPath: "/your/project/path",
extensions: [".jsx", ".tsx"],
excludeComments: true
})
// 4. Check for outdated dependencies
check_outdated({
projectPath: "/your/project/path",
outputFormat: "detailed"
})
```
### š Advanced Search Scenarios
```typescript
// Find all async functions
search_files({
pattern: "async\\s+function",
regexMode: true,
extensions: [".js", ".ts"]
})
// Find large files modified recently
search_files({
pattern: ".*",
minSize: 1000000, // 1MB+
modifiedAfter: "2024-01-01",
sortBy: "size"
})
// Find TODO comments excluding test files
search_files({
pattern: "TODO|FIXME|BUG",
regexMode: true,
excludePatterns: ["*test*", "*spec*"],
excludeStrings: true
})
```
---
## š”ļø Security & Permissions
The server operates within **allowed directories** only, providing:
- š **Sandboxed access** - Cannot access files outside allowed paths
- š”ļø **Safe operations** - Built-in protections against dangerous operations
- š **Path validation** - All paths are normalized and validated
- ā ļø **Error handling** - Clear error messages for permission issues
---
## š§ Development
### š Project Structure
```
src/
āāā index.ts # Main server entry point
āāā explore-project.ts # Project analysis tool
āāā search.ts # Advanced search functionality
āāā check-outdated.ts # NPM dependency checker
āāā delete-file.ts # File deletion tool
āāā rename-file.ts # File rename/move tool
āāā list-allowed.ts # Directory permission checker
```
### šļø Build Commands
```bash
npm run build # Compile TypeScript
npm run watch # Watch mode for development
npm run inspector # Test with MCP inspector
```
---
## š¤ Contributing
1. š“ Fork the repository
2. š Create a feature branch
3. š» Make your changes
4. ā
Test thoroughly
5. š Submit a pull request
---
## š License
See [LICENSE](LICENSE) file for details. š QoderTDQS
Scored across 6 tools
Each tool serves a distinct purpose: listing allowed dirs, renaming/moving, project exploration with dependency analysis, content search, npm outdated check, and deletion. There is no overlap or ambiguity between them.
All tool names follow a consistent snake_case verb_noun pattern (e.g., list_allowed_directories, rename_file, explore_project). The naming is uniform and predictable.
With 6 tools, the server is well-scoped for a project exploration and file management utility. The count is within the ideal range and each tool contributes to the core functionality.
The tool set covers listing, searching, renaming, deleting, and dependency checks, but lacks basic file operations like creating or reading file content. This is a notable gap for a file-related server, though the exploration focus mitigates it partially.