coderlib 0.1.0

A Rust library for AI-powered code assistance and agentic system
Documentation
//! Model Context Protocol (MCP) support for CoderLib
//!
//! This module provides MCP client and server functionality, including both
//! a simplified interface and the complete MCP protocol implementation.

// Simplified MCP interface (working now)
#[cfg(feature = "mcp")]
pub mod simple;

// Minimal working MCP implementation
#[cfg(feature = "mcp")]
pub mod minimal;

// Bridge between minimal and full implementations
#[cfg(feature = "mcp")]
pub mod bridge;

// Full MCP protocol implementation from rust-sdk
#[cfg(feature = "mcp-full-protocol")]
pub use rmcp;

// CoderLib-specific MCP implementations
#[cfg(feature = "mcp")]
pub mod types;
#[cfg(feature = "mcp")]
pub mod config;
#[cfg(feature = "mcp")]
pub mod error;

// Disable complex modules temporarily while fixing imports
#[cfg(all(feature = "mcp", feature = "mcp-full-protocol"))]
pub mod client;
#[cfg(all(feature = "mcp", feature = "mcp-full-protocol"))]
pub mod server;
#[cfg(all(feature = "mcp", feature = "mcp-full-protocol"))]
pub mod transport;
#[cfg(all(feature = "mcp", feature = "mcp-full-protocol"))]
pub mod transport_enhanced;
#[cfg(all(feature = "mcp", feature = "mcp-full-protocol"))]
pub mod websocket;
#[cfg(all(feature = "mcp", feature = "mcp-full-protocol"))]
pub mod tcp;
#[cfg(all(feature = "mcp", feature = "mcp-full-protocol"))]
pub mod transport_factory;
#[cfg(all(feature = "mcp", feature = "mcp-full-protocol"))]
pub mod tool_adapter;
#[cfg(all(feature = "mcp", feature = "mcp-full-protocol"))]
pub mod registry;

// Basic re-exports
#[cfg(feature = "mcp")]
pub use config::{McpConfig, McpServerConfig, McpTransportConfig};
#[cfg(feature = "mcp")]
pub use error::McpError;
#[cfg(feature = "mcp")]
pub use simple::*;
#[cfg(feature = "mcp")]
pub use minimal::*;
#[cfg(feature = "mcp")]
pub use bridge::*;

// Full protocol re-exports (disabled until imports are fixed)
#[cfg(all(feature = "mcp", feature = "mcp-full-protocol"))]
pub use client::McpClient;
#[cfg(all(feature = "mcp", feature = "mcp-full-protocol"))]
pub use server::{
    CoderLibServer, ServerConfig, ResourceProvider, PromptTemplate,
    FileSystemResourceProvider, MemoryResourceProvider, MemoryResource
};
#[cfg(all(feature = "mcp", feature = "mcp-full-protocol"))]
pub use transport_enhanced::{
    EnhancedTransportConfig, EnhancedTransport, TransportStats, TransportError
};
#[cfg(all(feature = "mcp", feature = "websocket", feature = "mcp-full-protocol"))]
pub use websocket::{WebSocketTransport, WebSocketServer, WebSocketClient};
#[cfg(all(feature = "mcp", feature = "mcp-full-protocol"))]
pub use tcp::{TcpTransport, TcpServer, TcpClient};
#[cfg(all(feature = "mcp", feature = "mcp-full-protocol"))]
pub use transport_factory::{
    TransportFactory, TransportFactoryConfig, ClientTransport, ServerTransport, TransportManager
};
#[cfg(all(feature = "mcp", feature = "mcp-full-protocol"))]
pub use tool_adapter::McpToolAdapter;
#[cfg(all(feature = "mcp", feature = "mcp-full-protocol"))]
pub use registry::McpRegistry;

#[cfg(not(feature = "mcp"))]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct McpConfig;
#[cfg(not(feature = "mcp"))]
impl Default for McpConfig {
    fn default() -> Self {
        Self
    }
}

#[cfg(not(feature = "mcp"))]
pub struct McpRegistry;
#[cfg(not(feature = "mcp"))]
impl McpRegistry {
    pub fn new(_config: McpConfig) -> Self {
        Self
    }
    
    pub async fn start_all_servers(&mut self) -> Result<(), Box<dyn std::error::Error>> {
        Ok(())
    }
    
    pub async fn register_tools_with_registry(&self, _tool_registry: &mut crate::tools::ToolRegistry) -> Result<(), Box<dyn std::error::Error>> {
        Ok(())
    }
}