A Visual Studio Code extension that exposes any Language Server Protocol (LSP) capabilities as Model Context Protocol (MCP) tools and GitHub Copilot Language Model Tools. This universal extension works with any programming language that has an active language server in VSCode.
I created this because I work on an incredibly large C++ project (with clangd) and Copilot is not able find objects efficiently.
π₯ Install from VS Code Marketplace
Or install directly in VS Code: Press Ctrl+Shift+X, search for "LSP MCP Bridge", and click Install
Here's a quick example of how the extension enhances GitHub Copilot's understanding of a C++ codebase.
A small excerpt of the C++ project used in the demo.
This extension bridges the gap between any existing language server's capabilities and MCP clients + GitHub Copilot, enabling AI models and tools to:
- Navigate codebases intelligently across any programming language
- Provide context-aware code suggestions and analysis
- Answer questions about code structure and functionality
- Assist with code refactoring and analysis
- Automatically enhance GitHub Copilot with deep language server insights
The extension exposes comprehensive LSP capabilities as GitHub Copilot tools that can be used automatically:
lsp_definition- Find symbol definitionslsp_references- Find all references to a symbollsp_hover- Get symbol information and documentationlsp_completion- Get code completion suggestionslsp_workspace_symbols- Search symbols across the workspacelsp_document_symbols- Get document structure/outlinelsp_rename_symbol- Preview symbol rename impactlsp_code_actions- Get available quick fixes and refactoringslsp_format_document- Preview document formattinglsp_signature_help- Get function signature and parameter help
Works with any programming language that has an active language server in VSCode:
- Python (Pylance, Jedi)
- TypeScript/JavaScript (Built-in)
- Rust (rust-analyzer)
- Go (Go extension)
- C/C++ (C/C++ extension, clangd)
- Java (Language Support for Java)
- C# (.NET extension)
- PHP (Intelephense)
- Ruby (Solargraph)
- And many more...
Method 1: Direct Link
- Click here: Install LSP MCP Bridge
- Click "Install" on the marketplace page
- VS Code will open and install the extension automatically
Method 2: In VS Code
- Open VS Code
- Press
Ctrl+Shift+X(orCmd+Shift+Xon Mac) to open Extensions - Search for "LSP MCP Bridge" or "sehejjain.lsp-mcp-bridge"
- Click "Install"
Method 3: Command Line
code --install-extension sehejjain.lsp-mcp-bridge- Visual Studio Code 1.75.0 or later
- Any language server configured in your VSCode environment (automatically works with existing setups)
For development or testing purposes:
- Download the latest
lsp-mcp-bridge-0.0.1.vsixrelease - Install the extension:
code --install-extension lsp-mcp-bridge-0.0.1.vsix
- Reload VSCode
- The tools are automatically available to GitHub Copilot!
-
Clone this repository:
git clone <repository-url> cd lsp-mcp-bridge
-
Install dependencies:
npm install
-
Compile and package:
npm run compile npx @vscode/vsce package
-
Install the extension:
code --install-extension lsp-mcp-bridge-0.0.1.vsix
Once installed, all LSP tools are automatically available to GitHub Copilot. Copilot will use them automatically when:
- You ask about code structure or symbols
- You need to understand unfamiliar code
- You want to find references or definitions
- You're working on refactoring tasks
- You ask for code suggestions or improvements
Example: Just ask Copilot "What does this function do?" while your cursor is on a function, and it will automatically use the hover and definition tools to provide a comprehensive answer.
The extension automatically registers itself with VS Code's MCP system, so:
- No manual startup required - Tools are immediately available
- Automatic tool discovery - VS Code finds the extension's capabilities automatically
- Seamless integration - Works with VS Code's built-in MCP support
Use the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
- "LSP MCP: Test MCP Tools at Cursor" - Test the core tools at your cursor position
- "LSP MCP: List Language Model Tools" - See all 10 registered tools
The extension also automatically registers with VS Code's MCP system, making it discoverable by external MCP clients without any additional configuration.
No additional configuration required! The extension automatically works with any language servers you have configured in VSCode.
The extension works with any LSP-compliant language server installed in VSCode:
| Language | Language Server | Extension |
|---|---|---|
| C/C++ | C/C++ extension, clangd | C/C++ or clangd extension |
| Python | Pylance, Jedi | Python extension |
| TypeScript/JavaScript | Built-in TS Server | Built-in |
| Rust | rust-analyzer | rust-analyzer extension |
| Go | gopls | Go extension |
| Java | Eclipse JDT | Language Support for Java |
| C# | OmniSharp | C# Dev Kit |
| PHP | Intelephense | PHP Intelephense |
| Ruby | Solargraph | Ruby LSP |
Run the comprehensive test suite:
npm testThe test suite includes:
- Unit tests for all LSP client methods
- Mock implementations for testing
- Integration tests for MCP server functionality
- Type validation tests
- GitHub Copilot tool registration tests
All tools are automatically registered with GitHub Copilot and can be referenced by their toolReferenceName:
| Tool | Reference Name | Description |
|---|---|---|
lsp_definition |
#definition |
Find symbol definitions |
lsp_references |
#references |
Find symbol references |
lsp_hover |
#hover |
Get symbol information |
lsp_completion |
#completion |
Get completions |
lsp_workspace_symbols |
#workspace_symbols |
Search workspace symbols |
lsp_document_symbols |
#document_symbols |
Get document outline |
lsp_rename_symbol |
#rename |
Preview rename impact |
lsp_code_actions |
#code_actions |
Get quick fixes |
lsp_format_document |
#format |
Preview formatting |
lsp_signature_help |
#signature_help |
Get function signatures |
All tools use consistent input schemas based on LSP specifications:
Position-based tools (definition, references, hover, completion, signature_help):
{
uri: string; // File URI (e.g., "file:///path/to/file.py")
line: number; // 0-based line number
character: number; // 0-based character offset
}Workspace symbol search:
{
query: string; // Search query for symbol names
}Document symbols:
{
uri: string; // File URI
}Code actions:
{
uri: string;
range: {
start: { line: number; character: number };
end: { line: number; character: number };
};
}- Extension Activation: Registers all 10 LSP tools with VSCode's Language Model API
- GitHub Copilot Integration: Tools are automatically available to Copilot via
toolReferenceName - LSP Bridge: Uses VSCode's
executeCommandAPI to access any active language server - Universal Support: Works with any LSP-compliant language server
- No Extra Processes: Reuses existing language server connections
- Ensure VSCode is version 1.103.0 or later
- Reload VSCode after installation
- Check that the extension is enabled in Extensions view
- Ensure you have a language server active for your file type
- Check that the file is saved and language server is initialized
- Verify cursor position is on a valid symbol
- Install the appropriate language extension for your programming language
- Check VSCode's Output panel for language server logs
- Ensure your project is properly configured (e.g.,
package.jsonfor Node.js)
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-capability - Make your changes and add tests
- Run the test suite:
npm test - Submit a pull request
MIT License - see LICENSE file for details.
- Built on top of VSCode's excellent Language Server Protocol support
- Inspired by the Model Context Protocol specification
- Designed to enhance GitHub Copilot's capabilities

