SourceNavigator solves the core problem that AI programming assistants like Cursor cannot read source code from external dependencies. By providing intelligent code navigation and analysis tools, it enables AI assistants to:
- Deep Dependency Understanding: Read and analyze source code from external libraries and frameworks
- Intelligent Type Analysis: Search and analyze type definitions across workspaces
- Multi-Window Support: Support multiple VSCode windows with intelligent routing via workspace paths
- Language Extensibility: Currently primarily supports Java, with architecture ready for other languages
SourceNavigator uses a modern architecture with separate processes for better performance and stability:
- The extension runs a dedicated MCP server process independent of the VSCode extension
- This ensures stable service even if the VSCode extension is reloaded or updated
- The server process can handle multiple VSCode windows simultaneously
- The VSCode extension and MCP server communicate via Inter-Process Communication (IPC)
- This provides fast, reliable communication between the extension and server
- IPC allows for efficient data transfer and real-time updates
- Uses a simplified global configuration approach
- No project-specific configuration files required
- The extension automatically detects workspace information from VSCode
- Intelligently read source code from external libraries and frameworks
- Support for various URI formats and line range specifications
- Enable AI assistants to understand complete code context
- Support for multiple VSCode windows simultaneously
- Automatic routing to corresponding windows via workspace paths in tool calls
- Each window uses the same global MCP server instance
- One-click installation with automatic configuration
- No complex project configuration files required
- Seamless integration with mainstream AI assistants
- Primary Support: Java (full support)
- Extensible Architecture: Ready to support other programming languages
- Intelligent Analysis: Code understanding based on language-specific features
Install SourceNavigator extension from the VSCode Marketplace
Add to your .cursorrules file:
{
"mcpServers": {
"SourceNavigator": {
"url": "http://localhost:8010/sse"
}
}
}The extension automatically starts the MCP server process, and AI assistants can immediately access external dependency source code.
Find class files by class name and return source code information. Supports both local project classes and third-party library classes.
{
"name": "class_source",
"arguments": {
"workspace_path": "/path/to/your/workspace",
"class_name": "MyClass",
"line_offset": 0,
"line_limit": 500
}
}Features:
- Supports short class names and fully qualified class names
- Automatic decompilation for third-party classes without source code
- Returns all matching fully qualified class names when multiple classes have the same name
- Default returns first 500 lines, customizable with
line_offsetandline_limit - Works with both local project classes and external dependencies
Configure the server port globally in VSCode settings:
- Open VSCode Settings (Ctrl/Cmd + ,)
- Search for "SourceNavigator"
- Set SourceNavigator: Port (default: 8010)
Or add to your settings.json:
{
"sourceNavigator.port": 8010
}When AI assistants need to understand third-party libraries used in projects, they can directly read and analyze their source code.
Develop different projects simultaneously in multiple VSCode windows, each with independent code analysis services.
Analyze complex dependency relationships in projects, enabling AI assistants to provide more accurate code suggestions.
- Port Conflicts: Ensure the configured port is not occupied
- Language Support: Ensure appropriate language extensions are installed
- Project Loading: Ensure projects are correctly loaded in VSCode
- Server Process: Check if the MCP server process is running properly
Welcome to submit Issues and Pull Requests to the GitHub repository.
This project was inspired by and references the following excellent open-source projects:
- VSCode MCP - MCP server for VSCode/Cursor/Windsurf with real-time LSP diagnostics and code navigation capabilities
- BifrostMCP - Original MCP server implementation that provided the foundation for intelligent code analysis tools
Special thanks to the maintainers and contributors of these projects for their pioneering work in the MCP ecosystem.
This project is licensed under the APGL-3.0 License.