Crate mcp_langbase_reasoning

Crate mcp_langbase_reasoning 

Source
Expand description

§MCP Langbase Reasoning Server

A Model Context Protocol (MCP) server that provides structured reasoning capabilities by delegating to Langbase Pipes for LLM-powered cognitive processing.

§Features

  • Linear Reasoning: Sequential step-by-step thought processing
  • Tree Reasoning: Branching exploration with multiple reasoning paths
  • Divergent Reasoning: Creative exploration with multiple perspectives
  • Reflection: Meta-cognitive analysis and quality improvement
  • Backtracking: Checkpoint-based state restoration for exploration
  • Auto Routing: Intelligent mode selection based on content analysis
  • Graph-of-Thoughts (GoT): Advanced graph-based reasoning with scoring and pruning
  • Bias & Fallacy Detection: Cognitive bias and logical fallacy identification
  • Workflow Presets: Composable multi-step reasoning workflows
  • Self-Improvement: Autonomous system health monitoring and optimization

§Architecture

MCP Client → MCP Server (Rust) → Langbase Pipes (HTTP)
                   ↓
             SQLite (State)

§Example

use std::sync::Arc;
use mcp_langbase_reasoning::{Config, AppState, McpServer};
use mcp_langbase_reasoning::langbase::LangbaseClient;
use mcp_langbase_reasoning::storage::SqliteStorage;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = Config::from_env()?;
    let storage = SqliteStorage::new(&config.database_path).await?;
    let langbase = LangbaseClient::new(&config)?;
    let state = Arc::new(AppState::new(config, storage, langbase));
    let server = McpServer::new(state);
    server.run().await?;
    Ok(())
}

Re-exports§

pub use config::Config;
pub use error::AppError;
pub use error::AppResult;
pub use server::AppState;
pub use server::McpServer;
pub use server::SharedState;

Modules§

config
Configuration management for the MCP server. Configuration management for the MCP server.
error
Error types and result aliases for the application. Error types and result aliases for the application.
langbase
Langbase API client and types for pipe communication.
modes
Reasoning mode implementations (linear, tree, divergent, etc.). Reasoning mode implementations.
presets
Workflow preset system for composable reasoning workflows. Workflow preset system for composing reasoning modes into higher-level workflows.
prompts
System prompts for Langbase pipes. Centralized prompt definitions for reasoning modes
self_improvement
Self-improvement system for autonomous optimization. Self-Improvement System for the MCP Reasoning Server.
server
MCP server implementation and request handling. Server module for MCP protocol handling.
storage
SQLite storage layer for persistence. Storage layer for reasoning session persistence.