mcp-corporate-kb
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-corporate-kbHow many vacation days do I accumulate per year?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-corporate-kb
Why this project exists
Across current job postings for Agentic AI / LLM engineering roles, one requirement shows up again and again: "having built or operated an MCP server, not just consumed one" — and, right next to it, "evaluation as a first-class deliverable" (golden datasets, faithfulness scoring, hallucination detection, quality gates in CI).
This project is a direct, hands-on answer to both. It's not a LangChain tutorial with a new coat of paint — it's an MCP server built around a real enterprise pain point (scattered policies and contracts nobody wants to re-read), with a measurement pipeline that proves the system is trustworthy enough for that use case.
Related MCP server: RAG Knowledge Base MCP Server
What it does
An employee (or an agent acting on their behalf) asks a natural-language question — "how many vacation days do I accumulate?", "what's the termination notice period with CloudTech?" — and gets back an answer grounded in an exact document and fragment, never a confident-sounding guess.
Repo structure
groundedkb/
├── README.md
├── pyproject.toml
├── .github/workflows/ci.yml # lint + tests + eval as a CI gate
│
├── corpus/ # 7 synthetic corporate documents
│ ├── politica_vacaciones.md
│ ├── politica_home_office.md
│ ├── manual_onboarding.md
│ ├── contrato_proveedor_cloudtech.md
│ ├── contrato_proveedor_soporte_ti.md
│ ├── faq_soporte_ti.md
│ ├── politica_gastos.md
│ └── codigo_conducta.md
│
├── ingestion/ # chunking, embeddings, vector store build
│ ├── chunking.py
│ ├── embeddings.py
│ ├── vectorstore.py
│ └── build_index.py
│
├── mcp_server/ # the MCP server — knows nothing about "agents"
│ ├── server.py
│ ├── tools/
│ │ ├── buscar_politica.py
│ │ ├── resumir_documento.py
│ │ ├── citar_fuente.py
│ │ └── listar_documentos.py
│ └── guardrails.py # scoping, structured logging
│
├── agent_client/ # thin consumer of the MCP server
│ ├── agent.py
│ └── prompts.py
│
├── eval/ # the differentiator
│ ├── golden_set.json # 16 questions (14 factual + 2 trick)
│ ├── run_eval.py # runs v0 vs v1 against the golden set
│ ├── metrics.py # faithfulness, hallucination rate, etc.
│ └── results/ # versioned output of each run
│
└── tests/
├── test_mcp_tools.py
└── test_ingestion.pyKey features
MCP server, not a wrapper —
mcp_server/implements the official MCP SDK directly, with 4 real tools (search, summarize, cite-source, list-by-category), permission scoping per document category, and structured audit logging on every tool call.Citation is not optional — every answer must resolve to a specific document + fragment. If it can't, the system says so instead of guessing.
Two measured versions, not one —
v0(naive similarity search) vsv1(hybrid retrieval + reranking + forced citation), so the improvement is a number, not a claim.Hallucination is explicitly tested for — the golden set includes trick questions with no real answer in the corpus, specifically to catch a system that fabricates one.
Evaluation wired into CI —
eval/run_eval.pyruns as part of the pipeline, so a regression in faithfulness or hallucination rate is caught before merge, not after a customer complaint.
Quickstart
git clone https://github.com/<your-username>/groundedkb.git
cd groundedkb
pip install -e .
# 1. Build the vector index from the corpus
python -m ingestion.build_index
# 2. Run the MCP server
python -m mcp_server.server
# 3. In another terminal, run the agent client
python -m agent_client.agentFull setup should take under 5 minutes on a clean environment.
Evaluation methodology
The same 16-question golden set (eval/golden_set.json) is run against two system configurations. Results below are populated by eval/run_eval.py — not hand-written.
Metric | v0 (naive RAG) | v1 (MCP + hybrid + reranking) | Delta |
Answer Correctness | pending first run | pending first run | — |
Faithfulness / Groundedness | pending first run | pending first run | — |
Citation Precision | pending first run | pending first run | — |
Retrieval Precision@3 | pending first run | pending first run | — |
Hallucination Rate | pending first run | pending first run | — |
Latency (p95) | pending first run | pending first run | — |
Metrics computed with RAGAS where applicable (faithfulness, context precision), plus custom scoring for citation accuracy and the trick-question hallucination check.
Roadmap
Phase 1 — Synthetic corpus (7 docs) + golden set (16 Q&A pairs, incl. 2 trick questions)
Phase 2 — Ingestion pipeline (chunking, embeddings, vector store)
Phase 3 — MCP server with 4 tools + guardrails
Phase 4 — Agent client (LangGraph) consuming the MCP server
Phase 5 — Evaluation pipeline (v0 vs v1, CI-gated)
Phase 6 — Packaging: architecture diagram, demo recording, CI green
Tech stack
Python · MCP SDK · LangGraph · Chroma/pgvector · RAGAS · GitHub Actions
Why this exists (short version, for the skim-readers)
Built to close a specific, named gap in current Agentic AI job postings: real MCP server experience, paired with evaluation rigor instead of vibes-based "it seems to work."
This server cannot be deployed
Maintenance
Related MCP Connectors
Your company's brain for AI agents. Cited, permission-aware knowledge across every system.
- KumbukaOAuthai.kumbuka
Governed, auditable knowledge your team curates for its AI assistants, self-hostable
Fact-checks generated content against your sources of truth showing what to trust, change, & verify.
Shared, permission-aware company context for AI agents, with provenance, approvals and audit.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables secure role-based querying of company documents across different departments (Engineering, Finance, HR, Marketing) with access control that restricts data visibility based on user roles. Provides retrieval-augmented generation with source citations and metadata for trusted corporate knowledge access.4-
- FlicenseNot gradedqualityDmaintenanceEnables searching a knowledge base and asking grounded questions with hybrid retrieval, reranking, and cited answers.-
- FlicenseNot gradedqualityBmaintenanceEnables traceable, version-aware question answering over product documentation, combining vector and graph retrieval to return cited evidence and support agentic workflows.-
- FlicenseAqualityBmaintenanceEnables AI assistants to answer high-trust sales questions with cited, vetted facts or explicit refusals, grounded in a local knowledge base.1-