kb-rag-mcp
Standalone MCP server exposing agentic-RAG tools (hybrid search, article retrieval, category listing) over a pgvector-backed knowledge base with bearer-token auth, designed for deployment on Render.
README
kb-rag-mcp
Standalone MCP server exposing agentic-RAG tools over a pgvector-backed knowledge base. Designed for public internet deployment (Render) with bearer-token auth; embeddings via Azure OpenAI; LLM/agent side lives in Azure AI Foundry (or any MCP-capable client).
Tools
| Tool | Purpose |
|---|---|
kb_search |
Hybrid retrieval (vector + full-text, RRF-fused, MMR-diversified). Returns chunks + citations + confidence. |
kb_get_article |
Full article body by kb_number — for drilling into a promising hit. |
kb_list_categories |
Categories + article counts — for scoping a refined search. |
kb_health |
Chunk/article counts + last ingest time — distinguishes "empty KB" from "no match". |
The agentic loop lives in the client agent: search → check low_confidence → refine query /
scope by category / fetch full article → answer with citations.
Setup
cp .env.example .envand fill in every value (see comments in that file).- Create the schema: paste
scripts/schema.sqlinto the Neon SQL editor (orpsql "$DATABASE_URL" -f scripts/schema.sql). - Ingest articles:
python scripts/ingest.py scripts/data/kb_dummy_200.json - Run locally:
uvicorn server:app --port 8080
Auth
Every /mcp request needs Authorization: Bearer <key> where <key> is listed in
MCP_API_KEYS (comma-separated; one key per client, rotate by adding/removing).
No keys configured = all requests rejected. /health is open (used by Render health checks).
Deploy (Render)
- Push this directory to a GitHub repo.
- Render → New → Blueprint → select the repo (
render.yamlis picked up automatically). - Fill the
sync: falseenv vars in the Render dashboard (same values as your local.env). - Your MCP endpoint:
https://<service>.onrender.com/mcp
Free-tier note: Render spins the service down after idle; first request after idle takes ~30-60s. Fine for testing; use a paid instance for a client-facing demo.
Smoke test
curl https://<service>.onrender.com/health
curl -X POST https://<service>.onrender.com/mcp \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.