Knowledge MCP Server
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.
Knowledge MCP Server
A self-hosted RAG (Retrieval-Augmented Generation) knowledge base for AI coding assistants. Store knowledge entries, reusable skills (prompts), project metadata, and private notes in a vector database. Access everything via MCP (Model Context Protocol).
Works with Claude Code, OpenCode, and any MCP-compatible client. Powered by Qdrant + Ollama embeddings.
Architecture
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Claude Code │ │ OpenCode │ │ MCP Client │
└──────┬───────┘ └──────┬───────┘ └──────┬───────┘
│ │ │
└─────────────────┼─────────────────┘
│ MCP (stdio / HTTP+SSE)
▼
┌─────────────────────┐
│ Knowledge MCP │
│ Server (:8765) │
└──┬──────────────┬───┘
│ │
┌────────▼───┐ ┌──────▼──────┐
│ Qdrant │ │ Ollama │
│ (:6333) │ │ (:11434) │
│ Vector DB │ │ Embeddings │
└────────────┘ └─────────────┘Data flow: MCP tool call → Pydantic validation → Ollama embeddings → Qdrant vector search/storage
Collections: Four Qdrant collections with cosine similarity:
knowledge— documentation, how-tos, code snippets, referencesskills— reusable prompts and instructionsprojects— project metadata (name, path, description, status)private— personal notes, context, preferences
Related MCP server: ollqd
Quick Start
Docker (recommended)
Prerequisites: Docker and Docker Compose installed.
# 1. Clone the repository
git clone https://github.com/ximot/knowledge-mcp.git
cd knowledge-mcp
# 2. (Optional) Copy and edit config
cp .env.example .env
# 3. Start all services
docker compose up -dLocal with uv (recommended for development)
Prerequisites: uv installed, Qdrant and Ollama running.
# 1. Clone the repository
git clone https://github.com/ximot/knowledge-mcp.git
cd knowledge-mcp
# 2. Install dependencies
uv sync
# 3. Run the MCP server
uv run python -m knowledge_mcpLocal with pip (alternative)
git clone https://github.com/ximot/knowledge-mcp.git
cd knowledge-mcp
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m knowledge_mcpThis starts three containers:
knowledge-mcp — MCP server on port
8765qdrant — vector database on port
6333ollama — embedding model on port
11434(auto-pullsnomic-embed-texton first start)
Verify everything is running:
curl http://localhost:8765/health
# {"status":"ok","qdrant":true,"ollama":true,"model":"nomic-embed-text"}Configuration Reference
All settings are configured via environment variables. Set them in a .env file or export directly.
Variable | Default | Description |
|
| Qdrant server hostname |
|
| Qdrant REST API port |
| (empty) | API key for Qdrant Cloud or secured instances |
|
| Use HTTPS for Qdrant connection |
|
| Full Ollama server URL |
|
| Ollama embedding model name |
|
| Embedding vector dimensions (must match model) |
|
| HTTP server bind address |
|
| HTTP server port |
When using
docker-compose.yml(all-in-one),QDRANT_HOSTandOLLAMA_HOSTare automatically set to the container service names (qdrantandhttp://ollama:11434).
MCP Tools Reference
The server exposes 24 tools across four collections. All tools support markdown (default) and json response formats.
Knowledge
Tool | Description |
| Semantic search across knowledge entries. Filters: |
| Add a new entry (title, content, type, tags, source, metadata) |
| Retrieve a single entry by ID |
| Update fields of an existing entry (re-embeds on content change) |
| Permanently delete an entry by ID |
| List entries with pagination and optional type/tag filters |
Knowledge types: note, documentation, code_snippet, reference, howto, other
Skills
Tool | Description |
| Semantic search across skills |
| Add a new skill (name, description, prompt, tags, version, examples) |
| Retrieve a skill by exact name (includes full prompt) |
| Update skill fields |
| Permanently delete a skill by name |
| List all skills (names and descriptions, no prompts) |
Skill names must match: ^[a-z0-9][a-z0-9-]*[a-z0-9]$ (lowercase alphanumeric with hyphens)
Projects
Tool | Description |
| Semantic search for projects. Filters: |
| Add a project (name, path, description, status, tags, metadata) |
| Retrieve a project by exact name |
| Update project fields |
| Permanently delete a project by name |
| List projects with pagination and status/tag filters |
Project statuses: active, archived, planned
Private
Tool | Description |
| Semantic search across private entries. Filters: |
| Add a private entry (title, content, type, tags, metadata) |
| Retrieve a private entry by ID |
| Update private entry fields |
| Permanently delete a private entry by ID |
| List private entries with pagination and type/tag filters |
Private types: note, context, preference, secret_ref
Usage with Claude Code
Option 1: HTTP/SSE (recommended for Docker)
Add to ~/.claude/settings.json or your project's .claude/settings.json:
{
"mcpServers": {
"knowledge": {
"url": "http://localhost:8765/mcp"
}
}
}Option 2: stdio (local Python)
Add to ~/.claude/settings.json:
{
"mcpServers": {
"knowledge": {
"command": "python",
"args": ["-m", "knowledge_mcp.server"],
"cwd": "/path/to/knowledge-mcp",
"env": {
"QDRANT_HOST": "localhost",
"OLLAMA_HOST": "http://localhost:11434"
}
}
}
}Usage with Other Clients
OpenCode
Add to your OpenCode MCP configuration:
{
"mcpServers": {
"knowledge": {
"url": "http://localhost:8765/mcp"
}
}
}Generic MCP Client
The server supports two transports:
stdio — run
python -m knowledge_mcp.serveras a subprocessHTTP (Streamable HTTP) — connect to
http://<host>:8765/mcp
The HTTP mode is stateless (stateless_http=True), so multiple clients can connect simultaneously.
Advanced
External Qdrant and Ollama
If you already have Qdrant and Ollama running (on your host, another server, or Qdrant Cloud), use the external compose file:
# Set connection details
export QDRANT_HOST=your-qdrant-host
export OLLAMA_HOST=http://your-ollama-host:11434
# Start only the MCP server
docker compose -f docker-compose.external.yml up -dQdrant Cloud example:
QDRANT_HOST=abc123.us-east4-0.gcp.cloud.qdrant.io
QDRANT_PORT=6333
QDRANT_API_KEY=your-api-key-here
QDRANT_HTTPS=true
OLLAMA_HOST=http://localhost:11434Custom Embedding Models
You can use any Ollama-compatible embedding model. Change the model and update the vector size accordingly:
EMBEDDING_MODEL=mxbai-embed-large
VECTOR_SIZE=1024Make sure to pull the model first:
ollama pull mxbai-embed-largeChanging the embedding model requires re-indexing all existing data since vector dimensions and semantics will differ.
Importing Skills from SKILL.md Files
Bulk import skills from markdown files:
# Import all SKILL.md files from a directory (recursive)
python scripts/import_skills.py /path/to/skills/directory
# Import a single file
python scripts/import_skills.py /path/to/SKILL.mdSKILL.md format with optional YAML frontmatter:
---
name: code-reviewer
description: Expert code reviewer for quality analysis
tags: [coding, review]
---
You are an expert code reviewer. Analyze code for:
1. Logic errors
2. Security issues
3. Performance problems
...Health Check
The HTTP server exposes a /health endpoint that verifies connectivity to both Qdrant and Ollama:
curl http://localhost:8765/health{
"status": "ok",
"qdrant": true,
"ollama": true,
"model": "nomic-embed-text"
}Status is "ok" when both backends are reachable, "degraded" otherwise (returns HTTP 503).
Development
Local Setup (uv — recommended)
# Clone the repository
git clone https://github.com/ximot/knowledge-mcp.git
cd knowledge-mcp
# Install all dependencies (including dev tools: ruff, mypy)
uv sync --extra dev
# Start Qdrant (if not running)
docker run -d --name qdrant -p 6333:6333 qdrant/qdrant
# Ensure Ollama has the embedding model
ollama pull nomic-embed-text
# Run in stdio mode
uv run python -m knowledge_mcp.server
# Run in HTTP mode
uv run python knowledge_mcp/http_server.py
# Lint and format
uv run ruff check --fix .
uv run ruff format .
# Run tests
uv run pytestLocal Setup (pip — alternative)
git clone https://github.com/ximot/knowledge-mcp.git
cd knowledge-mcp
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m knowledge_mcp.serverProject Structure
knowledge-mcp/
├── knowledge_mcp/
│ ├── __init__.py
│ ├── __main__.py # python -m knowledge_mcp entry point
│ ├── server.py # MCP server — all 24 tools
│ ├── config.py # Settings from environment variables
│ ├── qdrant.py # Qdrant async client wrapper
│ ├── embeddings.py # Ollama embedding client
│ └── http_server.py # HTTP/SSE transport + /health endpoint
├── scripts/
│ ├── import_skills.py # Bulk SKILL.md importer
│ └── start.sh # Shell startup script
├── examples/ # Sample SKILL.md files and config snippets
├── docker-compose.yml # All-in-one (MCP + Qdrant + Ollama)
├── docker-compose.external.yml # BYO backend (MCP server only)
├── Dockerfile
├── .env.example
├── requirements.txt
├── LICENSE
├── CLAUDE.md
└── README.mdContributing
Contributions are welcome. Please:
Fork the repository
Create a feature branch (
git checkout -b feature/my-feature)Make your changes
Test with
docker compose upto verify the full stack worksSubmit a pull request
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
A second brain for your AI agent. Shared memory for your team's AI agents, plus public and private knowledge bases — works with ChatGPT, Claude, Cursor and any MCP client.
Ask your own documents and get answers that cite the source passage. Workspace knowledge bases over MCP for Cursor, Claude and any MCP client.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Private persistent memory for Claude, ChatGPT & Gemini via MCP - semantic search, zero-code setup.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceProvides persistent memory for AI coding agents via MCP, enabling agents to store and semantically recall facts, events, and lessons across sessions, all running locally without cloud dependencies.Apache 2.0
- AlicenseAqualityDmaintenanceEnables indexing and semantic search of codebases and documents via MCP, using Ollama embeddings and Qdrant vector store.5Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to persist and retrieve project knowledge using three MCP tools with local vector and full-text search.MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI coding agents to persistently store, semantically search, and recall project-specific and cross-project knowledge across sessions, with everything kept local in SQLite. It also exposes project context, guidelines, and preferences as MCP resources for agents to read and write directly.-