How bug-ops/mcpls works
mcpls is a command-line MCP-to-LSP bridge that gives AI coding assistants semantic code intelligence. The main workflow is an MCP client calling a tool, the MCP server dispatching it through the translator, and the translator routing an LSP request to a language server and returning translated results. Separate branches expose push diagnostics, workspace resources, and server monitoring. Source excerpts are partial, so uncertain internal wiring is omitted; additional tool capabilities are documented in the README.
Main entry points: mod.rs LSP translator · server.rs MCP server · routing.rs Tool routing · main.rs CLI startup
Components 21
Startup and transport
- CLI startup
crates/mcpls-cli/src/main.rs - Server configuration
crates/mcpls-core/src/config/server.rs - MCP transport
crates/mcpls-core/src/transport.rs
MCP interface
- MCP server
crates/mcpls-core/src/mcp/server.rs - Handler context
crates/mcpls-core/src/mcp/handlers.rs
Translation and state
- LSP translator
crates/mcpls-core/src/bridge/translator/mod.rs - Tool routing
crates/mcpls-core/src/bridge/translator/routing.rs - Server selection
crates/mcpls-core/src/config/routing.rs - Document state
crates/mcpls-core/src/bridge/state.rs - Protocol encoding
crates/mcpls-core/src/bridge/encoding.rs - Code navigation
crates/mcpls-core/src/bridge/translator/navigation.rs - Symbol lookup
crates/mcpls-core/src/bridge/translator/symbols.rs - Diagnostics tools
crates/mcpls-core/src/bridge/translator/diagnostics.rs - Edits and actions
crates/mcpls-core/src/bridge/translator/edits.rs - Call hierarchy
crates/mcpls-core/src/bridge/translator/call_hierarchy.rs - Notification cache
crates/mcpls-core/src/bridge/notifications.rs - Workspace resources
crates/mcpls-core/src/bridge/resources.rs
Language servers
- Server lifecycle
crates/mcpls-core/src/lsp/lifecycle.rs - LSP client
crates/mcpls-core/src/lsp/client.rs
Other components
- AI assistant
- Language server
Connections 22
- AI assistant → MCP transport: sends MCP requests
- CLI startup → Server configuration: loads settings
- CLI startup → MCP transport: starts service
- MCP transport → MCP server: dispatches requests
- MCP server → Handler context: uses context
- MCP server → LSP translator: invokes tools
- LSP translator → Tool routing: routes requests
- Tool routing → Server selection: selects server
- Tool routing → Document state: prepares documents
- Tool routing → LSP client: sends LSP calls
- LSP translator → Code navigation: handles navigation
- LSP translator → Symbol lookup: handles symbol queries
- LSP translator → Diagnostics tools: handles diagnostics
- LSP translator → Edits and actions: handles edits
- LSP translator → Call hierarchy: handles call hierarchy
- LSP client → Protocol encoding: uses negotiated encoding
- Server lifecycle → Language server: starts process
- LSP client → Language server: exchanges LSP messages
- CLI startup → Server lifecycle: initializes servers
- Language server → Notification cache: publishes diagnostics
- MCP server → Notification cache: serves cached diagnostics
- MCP server → Workspace resources: serves workspace resources