Project Explorer MCP Server

Project Explorer MCP Server

Provides tools for analyzing project structures, searching through codebases, managing dependencies, and performing file operations with advanced filtering capabilities.

Category
访问服务器

README

🔍 Project Explorer MCP Server

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

⚡ Quick Start

{
  "mcpServers": {
    "project-explorer": {
      "command": "npx",
      "args": ["-y", "@team-jd/mcp-project-explorer", "/your/project/path"]
    }
  }
}

npm version npm downloads Node.js TypeScript GitHub


🚀 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:

{
  "mcpServers": {
    "project-explorer": {
      "command": "npx",
      "args": [
        "-y",
        "@team-jd/mcp-project-explorer",
        "/path/to/your/project"
      ]
    }
  }
}

📁 Multiple Directory Access:

{
  "mcpServers": {
    "project-explorer": {
      "command": "npx",
      "args": [
        "-y",
        "@team-jd/mcp-project-explorer",
        "/path/to/project1",
        "/path/to/project2",
        "/path/to/project3"
      ]
    }
  }
}

🛠️ For Developers

# Clone and setup for development
git clone https://github.com/MausRundung362/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

// 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 files
  • 🚫 Automatically excludes build directories (node_modules, .git, dist, etc.)
  • 📁 Recursive directory traversal
  • 🎯 Support for subdirectory analysis

🔎 search_files

Advanced file and code search with comprehensive filtering capabilities

// 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 ".*" Search pattern (text or regex)
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)
excludeStrings boolean false Skip string literals
outputFormat string "text" Output format: text, json, structured

🎯 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

// 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

// 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

// 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

list_allowed_directories()

🔧 Use Cases:

  • 🔍 Check access permissions before operations
  • 🛡️ Security validation
  • 📂 Directory discovery

🎨 Usage Examples

📊 Project Analysis Workflow

// 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

// 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

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 file for details.


<div align="center">

Happy coding! 🎉

Built with ❤️ using TypeScript and the Model Context Protocol

</div>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选