lsp-mcp 0.1.0

MCP server providing unified access to Language Server Protocol features
Documentation
//! LSP MCP Server - Entry Point
//!
//! Provides LSP features via MCP tools for AI agents.

use lsp_mcp::server::LspMcpServer;
use rmcp::ServiceExt;
use tracing::info;
use tracing_subscriber::{fmt, prelude::*, EnvFilter};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // Initialize logging (to stderr, stdout is for MCP protocol)
    tracing_subscriber::registry()
        .with(fmt::layer().with_writer(std::io::stderr))
        .with(EnvFilter::from_default_env().add_directive("lsp_mcp=info".parse()?))
        .init();

    info!("Starting LSP MCP Server v{}", env!("CARGO_PKG_VERSION"));

    // Create server
    let server = LspMcpServer::new();

    // Run with stdio transport
    let service = server
        .serve(rmcp::transport::stdio())
        .await?;

    info!("LSP MCP Server ready");

    // Wait for shutdown
    service.waiting().await?;

    info!("LSP MCP Server shutting down");

    Ok(())
}