KB-Bridge
A Model Context Protocol (MCP) server for intelligent knowledge base search and retrieval with support for multiple backend providers.
Alimenter votre agent
Installation de l'éditeur. Ce n'est pas un endpoint PlugMCP.
Host a copy with our keys and logs.
Pas encore de version packagée dans le registre. Suivez le README du dépôt.
URL distante ou commande sur votre machine ? Ce qui distingue les deux installations
Exécuter sur PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
Lancerpip install kbbridge
Create a .env file with your retrieval backend credentials:
# Required - Retrieval Backend Configuration
RETRIEVAL_ENDPOINT=https://api.dify.ai/v1 # Example: Dify endpoint
RETRIEVAL_API_KEY=your-retrieval-api-key
LLM_API_URL=https://your-llm-service.com/v1
LLM_MODEL=gpt-4o
LLM_API_TOKEN=your-token-here
# Optional
RERANK_URL=https://your-rerank-api.com
RERANK_MODEL=your-rerank-model
Supported Backends:
See env.example for all available configuration options.
# Start server
python -m kbbridge.server --host 0.0.0.0 --port 5210
# Or using Makefile (if available)
make start
Server runs on http://0.0.0.0:5210 with MCP endpoint at http://0.0.0.0:5210/mcp.
For local development or simple single-container deployments:
# Build the image
docker build -t kbbridge:latest .
# Run with environment variables
docker run -d \
--name kbbridge \
-p 5210:5210 \
--env-file .env \
kbbridge:latest
For production deployments, use container orchestration platforms like Kubernetes with your preferred deployment method.
KB-Bridge follows a multi-stage pipeline to ensure high-quality answers:
flowchart LR
Start([User Query]) --> Preprocess[Query Preprocessing<br/>Rewriting & Understanding]
Preprocess --> FileDiscovery[File Discovery<br/>Find Relevant Files]
FileDiscovery --> Search[Search Stages]
Search --> Direct[Direct Approach<br/>Simple Retrieval]
Search --> Advanced[Advanced Approach<br/>File-level Processing]
Direct --> Candidates
Advanced --> Candidates[Collect Candidates]
Candidates --> Synthesis[Answer Synthesis<br/>Rerank & Format]
Synthesis --> Reflection{Reflection<br/>Enabled?}
Reflection -->|Yes| Reflect[Quality Check<br/>& Refinement]
Reflection -->|No| Final
Reflect --> Final([Final Answer])
style Start fill:#e1f5ff
style Final fill:#c8e6c9
style FileDiscovery fill:#fff9c4
style Direct fill:#fff9c4
style Advanced fill:#fff9c4
style Reflect fill:#ffccbc
style Synthesis fill:#e1bee7
Query Preprocessing (Optional)
File Discovery
Search Stages (Parallel)
Answer Synthesis
Quality Reflection (Optional)
The orchestrator (DatasetProcessor) currently implements stages 1-3, 5-8. File Discovery Quality Evaluation (stage 4) is implemented but not yet integrated into the pipeline. See .doc/FILE_DISCOVERY_EVALUATION_CONFIG.md for details.
assistant: Intelligent search and answer extraction from knowledge basesfile_discover: Discover relevant files using retriever + optional rerankingfile_lister: List files in knowledge base datasetskeyword_generator: Generate search keywords using LLMretriever: Retrieve information using various search methodsfile_count: Get file count in knowledge base datasetimport asyncio
from fastmcp import Client
async def main():
async with Client("http://localhost:5210/mcp") as client:
result = await client.call_tool(
"assistant",
{
"resource_id": "resource-id",
"query": "What are the safety protocols?",
},
)
print(result.content[0].text)
asyncio.run(main())
await client.call_tool("assistant", {
"resource_id": "hr_dataset",
"query": "What is the maternity leave policy?",
"custom_instructions": "Focus on HR compliance and legal requirements."
})
await client.call_tool("assistant", {
"resource_id": "resource-id",
"query": "What are the safety protocols?",
"enable_query_rewriting": True # Enables LLM-based query expansion/relaxation
})
await client.call_tool("assistant", {
"resource_id": "resource-id",
"query": "What are the safety protocols?",
"document_name": "safety_manual.pdf" # Limit search to specific document
})
You can plug KB-Bridge into a Dify Agent Workflow instead of calling MCP tools directly:
http://localhost:5210/mcpX-RETRIEVAL-ENDPOINT, X-RETRIEVAL-API-KEY, X-LLM-API-URL, X-LLM-MODELassistantresource_id, query, and other tool parametersassistant tool → Structured answer with citations# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/
# Format code
black kbbridge/ tests/
# Lint code
ruff check kbbridge/ tests/
Apache-2.0
MCP server for enhancing knowledge base search and retrieval
Outils
Pas encore de liste d'outils. Les serveurs distants en obtiennent une après le premier contrôle d'état.
FAQ
Copiez sur cette page la configuration stdio pour Cursor, Claude Desktop, Claude Code ou VS Code. Elle utilise l'installation de l'éditeur, pas un proxy PlugMCP.
Aucune variable d'environnement requise n'est indiquée sur cette fiche.
Kb Bridge s'exécute en local via stdio.
Dernière vérification : 2026-10-28. MCP server for enhancing knowledge base search and retrieval