Expand description
§mcpls-core
Core library for MCP (Model Context Protocol) to LSP (Language Server Protocol) translation.
This crate provides the fundamental building blocks for bridging AI agents with language servers, enabling semantic code intelligence through MCP tools.
§Architecture
The library is organized into several modules:
lsp- LSP client implementation for communicating with language serversmcp- MCP tool definitions and handlersbridge- Translation layer between MCP and LSP protocolsconfig- Configuration types and loadingerror- Error types for the library
§Example
ⓘ
use mcpls_core::{serve, serve_with, Transport, ServerConfig};
#[tokio::main]
async fn main() -> Result<(), mcpls_core::Error> {
let config = ServerConfig::load()?;
// Stdio (default):
serve(config).await
// HTTP (requires `transport-http` feature):
// serve_with(config, Transport::Http(mcpls_core::HttpConfig {
// bind: "127.0.0.1:3000".parse().unwrap(),
// path: "/mcp".to_string(),
// })).await
}Re-exports§
pub use config::ServerConfig;pub use error::Error;pub use transport::Transport;
Modules§
- bridge
- Translation layer between MCP and LSP protocols.
- config
- Configuration types and loading.
- error
- Error types for mcpls-core.
- lsp
- LSP client implementation.
- mcp
- MCP tool definitions and handlers.
- transport
- Transport selection for the MCP server.
Functions§
- serve
- Start the MCPLS server with the given configuration over stdio.
- serve_
with - Start the MCPLS server with an explicit transport.