MCP Knowledge Viz
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 Knowledge Vizadd fact: Paris is the capital of France."
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 Knowledge Viz
A knowledge-base chatbot with semantic search and interactive embedding visualisation, built as a hybrid of REST microservices (browser UI) and a proper MCP stdio server (Claude Desktop / Cursor integration).
Store facts in natural language, ask questions, and explore the embedding space in 2D (matplotlib) or interactive 3D (Plotly) — all backed by ChromaDB and SentenceTransformers.
Architecture Overview
The system has two independent access paths that share the same business logic:
Layer | Transport | Use case |
REST servers ( | HTTP | Browser chatbot UI |
MCP stdio server ( | stdin/stdout JSON-RPC | Claude Desktop, Cursor, any MCP client |
Both layers delegate to kb_core.py — the single module that owns the ChromaDB client and the SentenceTransformer embedder. Neither layer duplicates data-access logic.
Key Design Principles
Single source of truth for data access — only
kb_core.pytalks to ChromaDB. REST endpoints and MCP tools are thin wrappers.No HTTP for MCP —
mcp_tools.pycallskb_coredirectly; the REST servers do not need to be running for an MCP client to use the tools.SOLID / Pydantic structure — the Visualization package uses typed Pydantic models at every boundary (
EmbeddingPayload,VisualizationRequest,ReducedEmbeddings).
Related MCP server: AgentBase
Diagrams
Module Structure
QnA Request Flow (REST)
Visualization Flow (2D + 3D)
MCP Tools Flow (stdio)
Regenerating diagrams
plantuml -tsvg docs/architecture/uml/*.puml -o ../images
plantuml -tpng docs/architecture/uml/*.puml -o ../imagesREST API Reference
Knowledge Base Server — port 8000
Central data service. Also serves the chatbot browser UI.
Method | Endpoint | Description |
|
| Browser UI (two-column layout) |
|
| Embed and store a fact in ChromaDB |
|
| Embed and store a query in ChromaDB |
|
| Semantic search — returns top-k facts + distances. Body: |
|
| Return all facts + queries with raw embeddings (used by Viz server) |
QnA Server — port 8001
Thin HTTP wrapper. Calls the KB server; no direct DB access.
Method | Endpoint | Description |
|
| Stores query via |
Visualization Server — port 8002
Generates embedding plots via PCA dimensionality reduction.
Method | Endpoint | Query params | Returns |
|
|
|
|
|
|
|
|
|
|
|
|
MCP Tools Reference
mcp_tools.py is a FastMCP stdio server. Configure it in your MCP client and the three tools below appear automatically — no REST servers needed.
Tool | Arguments | Description |
|
| Embed and persist a fact in ChromaDB |
|
| Semantic search; also records the query for visualisation |
|
| Returns a Plotly 3D figure as a JSON string |
Connecting to Claude Desktop / Cursor
Copy mcp.json.example to mcp.json, fill in your absolute paths, then copy the mcpServers block into your client's config file:
Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.jsonCursor:
~/.cursor/mcp.json
// mcp.json.example — fill in your local paths
{
"mcpServers": {
"knowledge-viz": {
"command": "/path/to/your/project/.venv/bin/python",
"args": ["-m", "mcp_servers.mcp_tools"],
"cwd": "/path/to/your/project"
}
}
}
mcp.jsonis gitignored because it contains absolute local paths. Always editmcp.json.examplefor committed changes.
Getting Started
Prerequisites
Python 3.11+
PlantUML (optional, only to regenerate diagrams)
Setup
git clone <repository-url>
cd mcp-knowledge-viz
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txtRun the REST + browser UI stack
chmod +x run_all.sh
./run_all.shStarts three servers:
Server | Port | Role |
Knowledge Base | 8000 | Data + chatbot UI |
QnA | 8001 | Question answering |
Visualization | 8002 | Embedding plots |
Open http://127.0.0.1:8000/chatbot in your browser.
Visualisation tuning parameters
Parameter | Default | Range | Effect |
|
|
| PCA target dimensions |
|
| bool | Draw search-radius circle / sphere around latest query |
|
| 1–50 | Neighbour count used to compute the radius |
|
| float | Matplotlib figure width (inches) |
|
| float | Matplotlib figure height (inches) |
|
| int | Matplotlib output resolution |
|
| 1–50 | Facts returned per search |
Project Structure
mcp-knowledge-viz/
├── app/
│ ├── static/
│ │ ├── chatbot.css # Two-column layout, vis viewport
│ │ └── chatbot.js # Fetch facts/QnA, Plotly 3D, spinner
│ └── templates/
│ └── chatbot.html # Bootstrap 5 two-column UI
├── docs/
│ └── architecture/
│ ├── images/ # Generated SVG + PNG diagrams
│ └── uml/ # PlantUML sources
├── mcp_servers/
│ ├── kb_core.py # ★ Shared ChromaDB + embedder logic
│ ├── knowledge_base_server.py # REST :8000 — delegates to kb_core
│ ├── qna_server.py # REST :8001 — HTTP wrapper
│ ├── visualization_server.py # REST :8002 — delegates to visualization/
│ ├── mcp_tools.py # ★ MCP stdio server (add_fact, ask, visualize)
│ └── visualization/
│ ├── models.py # Pydantic models
│ ├── kb_client.py # HTTP client → KB server
│ ├── reducer.py # PCA 2D/3D
│ ├── renderer.py # matplotlib (2D/3D static PNG)
│ ├── plotly_renderer.py # Plotly interactive 3D JSON
│ └── service.py # Orchestrator
├── chroma_db/ # Persistent vector store (gitignored)
├── mcp.json # Local MCP config (gitignored)
├── mcp.json.example # Template — commit this, not mcp.json
├── run_all.sh # Start all three REST servers
└── requirements.txtTech Stack
Concern | Library |
REST framework | FastAPI + uvicorn |
Vector store | ChromaDB (persistent) |
Embeddings | SentenceTransformers |
Dimensionality reduction | scikit-learn PCA |
2D/3D static plots | matplotlib |
Interactive 3D plots | Plotly (JS CDN + Python) |
MCP server |
|
HTTP client | httpx |
Frontend | Bootstrap 5, vanilla JS |
This server cannot be deployed
Maintenance
Related MCP Connectors
- KogniteOAuthdev.kognite
Hosted agent memory: store, search, and recall facts across sessions from any MCP client.
The knowledge base your AI reads and writes, under your rules — over MCP, EU-hosted.
Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.
Personal knowledge graph as an AI memory layer over MCP - read, save, and link your memories.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceProvides AI agents with persistent knowledge storage, enabling them to store, search, and retrieve text, documents, and files using semantic and keyword search via MCP tools.32Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to persistently store and semantically search shared knowledge via MCP tools.2MIT
- AlicenseNot gradedqualityBmaintenanceProvides MCP tools for semantic search over personal knowledge sources using pluggable embeddings and local vector indexing.1MIT
- AlicenseAqualityBmaintenanceProvides persistent, multi-tenant knowledge graph memory for MCP-capable AI tools, allowing them to recall and store entities, observations, and relations across sessions with keyword search.1045 npm3MIT