Kiro LSP MCP
Fork of vsc-lsp-mcp, with additional features and optimizations for Kiro IDE.
🔍 Overview
Kiro LSP MCP is a VSCode/Kiro extension that exposes Language Server Protocol (LSP) features through the Model Context Protocol (MCP). It gives AI assistants access to the same code intelligence that your IDE uses internally — symbol definitions, references, type information, call hierarchies, and more.
🌟 Why This Extension?
AI coding assistants rely on text search (grep) to understand your codebase, which leads to:
- False matches from same-named symbols across modules
- No understanding of type hierarchies or inheritance
- Inability to trace call chains accurately
- Missing type information for generics, interfaces, and annotations
- No access to dependency source code (e.g., Java library classes in JARs), forcing AI to guess API signatures and behaviors
This extension bridges that gap by giving AI tools direct access to LSP capabilities.
⚙️ Features
- 🔄 LSP → MCP Bridge: All major LSP features exposed as MCP tools
- 🌐 Gateway Architecture: Multiple IDE windows share a single MCP endpoint (port 9527)
- 🔁 Auto Failover: If the gateway window closes, another window takes over automatically
- 🔄 Session Recovery: MCP clients reconnect seamlessly after gateway migration
- 🧠 Rich Code Intelligence: Hover, definitions, references, implementations, call hierarchy, and more
- ☕ Java Dependency Source Viewer: Decompile and read source code of Java dependency classes (via
jdt:// URI), enabling AI to understand library internals without manual JAR extraction
| Tool |
Description |
get_definition |
Jump to symbol definition |
get_references |
Find all references to a symbol |
get_hover |
Get type signature and documentation |
get_implementation |
Find interface/abstract class implementations |
get_document_symbol |
Get file outline (all symbols) |
get_workspace_symbol |
Search symbols across the workspace |
get_incoming_calls |
Find all callers of a function |
get_outgoing_calls |
Find all functions called by a function |
get_class_file_contents |
Get decompiled source of Java .class files (jdt://) |
rename_symbol |
Rename a symbol across the workspace |
🚀 Quick Start
1. Install the Extension
- Download the
.vsix from Releases
- In Kiro/VSCode:
Ctrl+Shift+P → Install from VSIX
- Restart the IDE
Kiro
Edit ~/.kiro/settings/mcp.json or .kiro/settings/mcp.json in your project:
{
"mcpServers": {
"lsp": {
"url": "http://127.0.0.1:9527/mcp"
}
}
}
Cursor
{
"mcpServers": {
"lsp": {
"url": "http://127.0.0.1:9527/mcp"
}
}
}
Roo Code (Cline)
{
"mcpServers": {
"lsp": {
"type": "streamable-http",
"url": "http://127.0.0.1:9527/mcp",
"disabled": false
}
}
}
3. Verify
Visit http://127.0.0.1:9527/gateway/health — you should see your workspace listed.
📋 Configuration
| Key |
Description |
Type |
Default |
lsp-mcp.enabled |
Enable or disable the LSP MCP server |
boolean |
true |
lsp-mcp.port |
Gateway port |
number |
9527 |
lsp-mcp.maxRetries |
Max port retry attempts |
number |
10 |
lsp-mcp.cors.enabled |
Enable CORS |
boolean |
true |
lsp-mcp.cors.allowOrigins |
Allowed origins (* or comma-separated list) |
string |
* |
lsp-mcp.cors.withCredentials |
Allow credentials in CORS |
boolean |
false |
lsp-mcp.cors.exposeHeaders |
Exposed response headers |
string |
Mcp-Session-Id |
🏗️ Architecture
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Kiro AI │ │ Cursor AI │ │ Other MCP │
│ Assistant │ │ Assistant │ │ Client │
└──────┬───────┘ └──────┬──────┘ └──────┬──────┘
│ │ │
└────────────┬───────┴────────────────────┘
│ MCP (HTTP :9527)
┌─────▼─────┐
│ Gateway │ (one IDE window)
│ Window │
└─────┬──────┘
┌────────┼────────┐
│ │ │
┌─────▼──┐ ┌───▼───┐ ┌─▼───────┐
│ LSP │ │ LSP │ │ LSP │
│ :random│ │:random│ │ :random │
│ Window1│ │Window2│ │ Window3 │
└────────┘ └───────┘ └─────────┘
Multiple IDE windows register with the gateway. The gateway routes MCP requests to the correct LSP instance based on file URI matching.
💻 Development
git clone <repo-url>
pnpm install
# Press F5 in VSCode/Kiro to debug
📄 License
MIT — see LICENSE.md
Based on vsc-lsp-mcp by 寅时码.