mcp-moe-hybrid-sdk
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-moe-hybrid-sdk
Production-grade, zero-bloat Python AI SDK & Full-Stack Server uniting Model Context Protocol (MCP 2025-11-25 JSON-RPC 2.0), Hardware- & SLA-Aware Sparse Top-2 Mixture-of-Experts (MoE) Query Routing, SQLite WAL + FTS5 BM25 + Cosine Vector Reciprocal Rank Fusion (RRF) Hybrid RAG, and Deterministic Secret/PII Redaction.
System Architecture
flowchart LR
Client["SDK / Bento Web UI / Agent Host"] -->|"JSON-RPC 2.0 POST /mcp"| Guard["RedactionGuard (API Key / Bearer / Email Scrub)"]
Guard --> Disp["McpJsonRpcDispatcher (2025-11-25)"]
Disp -->|"moe_route_query"| Router["SparseTop2MoeRouter (VRAM + Latency SLA)"]
Disp -->|"rag_upsert / rag_hybrid_search"| Vault["HybridKnowledgeVault (SQLite WAL)"]
Vault --> FTS["FTS5 BM25 Lexical Index"]
Vault --> Vec["L2 Dense N-Gram Vector Cosine"]
FTS --> RRF["Reciprocal Rank Fusion (k=60)"]
Vec --> RRFRelated MCP server: memo-mcp
Empirical Golden-Suite Benchmarks (benchmarks/run_golden_eval.py)
Subsystem | Golden Queries | Accuracy / Recall@1 | $p_{50}$ Latency | $p_{95}$ Latency | External Runtime Dependencies |
Hybrid RAG ( |
|
|
|
|
|
Sparse Top-2 MoE Router ( |
|
|
|
|
|
Quickstart
1. Local Install & Test Gate
pip install -e .
python -m unittest discover -s tests -v
python benchmarks/run_golden_eval.py2. Launch Full-Stack MCP Server + Interactive Bento Web Showcase
python -m mcp_moe_sdk.server
# Open http://127.0.0.1:8090 for the interactive UI or query GET /health & POST /mcp3. Containerized Deployment
docker build -t mcp-moe-hybrid-sdk:1.0.0 .
docker run --rm -p 8090:8090 mcp-moe-hybrid-sdk:1.0.0Python SDK Usage
from mcp_moe_sdk import HybridKnowledgeVault, McpJsonRpcDispatcher, SparseTop2MoeRouter
vault = HybridKnowledgeVault(":memory:")
vault.upsert(
doc_id="rfc-01",
title="SQLite WAL FTS5 + Dense Vector RRF",
body="Fuses exact BM25 keyword matches with cosine similarity.",
tags=["rag", "sqlite", "fts5"],
)
router = SparseTop2MoeRouter()
decision = router.route(
"Prove Black-Scholes convexity theorem and MoE invariant",
max_vram_gib=6.0,
latency_sla_ms=1200.0,
)
print(decision["selected_tier"], decision["top2_sparse_gates"])
mcp = McpJsonRpcDispatcher(vault=vault, router=router)
resp = mcp.handle({
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {"name": "rag_hybrid_search", "arguments": {"query": "BM25 cosine RRF", "top_k": 3}},
})License
Released under the MIT License.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Cloud or self-hosted knowledge for AI agents: hybrid search, reranking, GraphRAG, scoped MCP tools.
Private, multimodal knowledge store for agents: hybrid search with cited, provenance-backed results.
AI routing, memory, guardrails, and governance. Routes across Claude, GPT, Gemini.
Persistent memory, hybrid search and a goal graph for AI agents, over stdio or remote HTTP.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables agents to retrieve relevant context via a zero-dependency hybrid search engine that blends sparse keyword-based lexical ranking with dense vector similarity scores into one fused result set, then refines it with knowledge graph triplet expansion and lost-in-the-middle context reordering. It also provides episodic memory consolidation, recency decay, and semantic query caching, exposed as a JSON-RPC 2.0 stdio MCP server for clients such as Claude Desktop, Cursor, and Windsurf.MIT
- FlicenseNot gradedqualityBmaintenanceEnables agents to store documents and atomic facts with provenance in a local SQLite knowledge base, then search them through fused keyword, exact, semantic, entity, graph and fact retrieval arms that return one ranked list where every result carries its address, trust level and a reason for its rank. A read-only terminal and loopback web view let humans inspect the same searches, timelines, entity neighbourhoods and agent-written pages without being able to alter the knowledge base.-
- AlicenseNot gradedqualityAmaintenanceGives every AI agent a shared, persistent memory by ingesting Obsidian vaults, code, transcripts, bookmarks and terminal sessions into a three-tier SQLite FTS5 store, then serving token-optimized hybrid retrieval, classification, promotion and cross-source synthesis over MCP and REST. This lets multiple agents read from and write to one compounding brain so each session starts with better context than the last.10 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients like Claude, Cursor, and Windsurf to search a local document knowledge base using four-layer retrieval fusion (vector similarity, BM25 keywords, knowledge graph traversal, and metadata filtering) with cross-encoder reranking. Also lets agents index documents, add single documents, list indexed sources, and run health diagnostics, with models kept warm between queries so no GPU, PyTorch, or API keys are needed.100 PyPI12MIT