Skip to main content
Glama
Personal Knowledge-Base MCP Server

Personal Knowledge-Base MCP Server

Personal Knowledge-Base MCP Server & Web App

F6-Zeppelin Fellowship β€” Project 3
A multi-tenant Model Context Protocol (MCP) server and web application enabling semantic search and AI answer synthesis over personal document corpora backed by Qdrant vector search, FastMCP, and OpenRouter.


πŸš€ Overview

Static keyword search fails when notes, research papers, and technical documents use different wording for the same concepts. This project implements a protocol-level FastMCP server paired with a Qdrant Vector Database to enable context-aware semantic search over real-world documents.

The system supports dual modes of interaction:

  1. MCP Client Integration: Native tools callable from MCP-compliant clients like Claude Desktop or Claude Code.

  2. Multi-Tenant Web UI: A web dashboard providing isolated document management, uploading, vector search, and AI-synthesized RAG answers generated via OpenRouter API.


Related MCP server: qdrant-mcp

✨ Key Features

  • Protocol-Level Integration (FastMCP): Exposes structured MCP tools (search_notes, get_document, list_sources) for native AI agent invocation.

  • Multi-Tenant Isolation: Payload-level tenant isolation in Qdrant ensures document chunks and search results are strictly scoped per user.

  • Strict Relevance Cutoff: Rejects low-confidence vector matches below similarity thresholds to prevent low-relevance hallucination propagation.

  • Automated Ingestion Pipeline: Handles PDF, Markdown, and TXT parsing, dynamic chunking, and embedding generation.

  • LLM Answer Synthesis (RAG): Integrates OpenRouter API (openrouter/free) to generate unified, context-grounded AI answers directly over retrieved vector chunks within the web dashboard.

  • Quantitative Retrieval Benchmarking: Hand-labeled evaluation suite tracking Mean Reciprocal Rank (MRR) and Precision@K across test queries.


πŸ› οΈ Architecture & Tech Stack

Layer

Technology

Purpose

Protocol

FastMCP (Python)

Tool registry and JSON-RPC over STDIO / HTTP transport

Backend API

FastAPI

User authentication (JWT), file upload, REST search endpoints

Vector DB

Qdrant

HNSW similarity search with payload-based user isolation

Embeddings

sentence-transformers / OpenAI

Dense vectorization of document chunks

LLM / Synthesis

OpenRouter API (openrouter/free)

RAG answer generation over retrieved context chunks

Frontend

React / Tailwind CSS

Web dashboard for uploading documents, search, and AI answer view


πŸ“Š Evaluation & Metrics

Metric

Target

Result

Precision@3

β‰₯ 80%

TBD

MRR (Mean Reciprocal Rank)

β‰₯ 0.85

TBD

Relevance Threshold

Cosine β‰₯ 0.72

Enforced


⚑ Quick Start

1. Environment Setup

cd backend
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env

Ensure your backend/.env file contains your OpenRouter key:

OPENROUTER_API_KEY=sk-or-v1-your-api-key-here

2. Configure Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "personal-kb": {
      "command": "python",
      "args": ["-m", "app.mcp_server.server"],
      "env": {
        "QDRANT_URL": "http://localhost:6333",
        "QDRANT_API_KEY": "your-api-key",
        "OPENROUTER_API_KEY": "your-openrouter-key"
      }
    }
  }
}

πŸ“‚ Repository Structure

KNOWLEDGE_BASE-MCP_SERVER/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/             # FastAPI REST endpoints (Auth, Documents, Search)
β”‚   β”‚   β”œβ”€β”€ core/            # App configuration & JWT security settings
β”‚   β”‚   β”œβ”€β”€ db/              # Qdrant vector database initialization & schemas
β”‚   β”‚   β”œβ”€β”€ eval/            # Precision@K and MRR benchmark scripts
β”‚   β”‚   β”œβ”€β”€ mcp_server/      # FastMCP server definition & tool implementations
β”‚   β”‚   └── services/        # Ingestion, embedding, similarity search, & LLM service (llm_service.py)
β”‚   β”œβ”€β”€ tests/               # Backend API and retrieval test suite
β”‚   β”œβ”€β”€ main.py              # Application entry point
β”‚   β”œβ”€β”€ requirements.txt     # Python backend dependencies
β”‚   └── .env.example         # Template for environment variables
β”œβ”€β”€ data/
β”‚   └── sample_docs/         # Document corpus for local testing
β”œβ”€β”€ docs/                    # Architecture diagrams & project documentation
β”œβ”€β”€ frontend/                # React / Tailwind web application for multi-user management
β”‚   └── src/
β”‚       β”œβ”€β”€ components/      # UI components (Uploaders, Search bar, Answer card)
β”‚       β”œβ”€β”€ context/         # Auth & Session state providers
β”‚       β”œβ”€β”€ pages/           # Document dashboard & Search playground
β”‚       └── services/        # API client bindings
β”œβ”€β”€ .gitignore               # Ignored files (venvs, keys, vector storage)
β”œβ”€β”€ docker-compose.yml       # Local Qdrant & FastAPI orchestration
└── README.md                # Project documentation

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      A high-performance MCP server for semantic search and codebase indexing using the Qdrant vector database. It features optimized embedding pipelines, AST-aware chunking, and git metadata enrichment for fast, privacy-focused local or remote search.
      786 npm
      31
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for document ingestion and semantic search on Qdrant. Enables ingesting local documents, generating embeddings with OpenAI, and performing vector search with metadata filters.
      Apache 2.0
    • A
      license
      A
      quality
      D
      maintenance
      Local-first RAG indexing and semantic search MCP server. Enables document retrieval and context-aware queries using local embedding models.
      3
      8 npm
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that enables searching and retrieving ACL NLP conference papers from a Qdrant vector database using semantic search and structured filters like year, venue, and field of study.
      4
      MIT