notes-rag-mcp
Leverages Google Gemini for semantic search, question answering, and summarization based on note content.
Provides tools for managing notes in PostgreSQL, including adding, deleting, listing, and summarizing notes.
Click on "Install 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., "@notes-rag-mcpask: what is GIL in Python?"
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.
Table of Contents
Related MCP server: RAGandLLM-MCP
Overview
Notes RAG MCP Server is a Model Context Protocol server that turns a personal note collection into a knowledge base an AI agent can query. Notes are persisted in PostgreSQL (source of truth), their embeddings stored in ChromaDB, and answers generated by Google Gemini through a declarative LangChain LCEL chain.
Any MCP-compatible client — Claude Desktop, Claude Code, the MCP Inspector, or a custom agent — can call the six exposed tools to add, search, ask, summarize, list, and delete notes.
Features
Semantic search — vector similarity search via ChromaDB returns the most relevant notes for any query
RAG Q&A — a full LCEL pipeline (
retriever | prompt | llm | parser) grounds answers strictly in stored notes, never hallucinating beyond contextConsistent dual store — every write and delete keeps PostgreSQL and ChromaDB in sync automatically
Note summarization — dedicated LCEL chain condenses any note to 2–3 sentences on demand
MCP resource — notes are also exposed as
notes://<id>resources for direct content accessLazy initialization — Gemini and ChromaDB clients are created only on first use; importing the module requires no API key
Idempotent setup — the database schema is applied at startup with
IF NOT EXISTS; safe to restart at any time
Architecture
MCP Client (Claude Desktop / Inspector / Claude Code)
│ stdio transport
▼
┌─────────────────────────────┐
│ server.py │
│ FastMCP — 6 tools + │
│ notes://{id} resource │
└────────┬────────────────────┘
│
┌────┴────┐
▼ ▼
┌────────┐ ┌──────────────────────────────────────┐
│ db.py │ │ rag_chain.py │
│ │ │ GoogleGenerativeAIEmbeddings │
│ psycopg│ │ ChatGoogleGenerativeAI (Gemini) │
│ 3 │ │ Chroma (langchain-chroma) │
│ │ │ │
│ Source │ │ LCEL: retriever | prompt | llm | │
│ of │ │ StrOutputParser │
│ truth │ └──────────────────────────────────────┘
└───┬────┘ │
│ │
▼ ▼
┌──────────┐ ┌───────────┐
│PostgreSQL│ │ ChromaDB │
│ (notes │ │ (vector │
│ table) │ │ index) │
└──────────┘ └───────────┘RAG question flow (ask tool):
{"context": retriever | format_docs, "question": RunnablePassthrough()}
| prompt | llm | StrOutputParser()The ChromaDB retriever fetches the most similar notes → format_docs merges them into a context block → Gemini answers only from that context.
Tech Stack
Layer | Technology |
MCP server | FastMCP ( |
LLM | Google Gemini 2.5 Flash ( |
Embeddings | Gemini Embedding 001 ( |
RAG pipeline | LangChain LCEL ( |
Vector store | ChromaDB ( |
Relational DB | PostgreSQL 15 ( |
Config |
|
Getting Started
Prerequisites
Python ≥ 3.12
PostgreSQL running locally (e.g.
postgresql@15via Homebrew)A Google AI Studio API key
Installation
# 1. Clone the repository
git clone https://github.com/konradxmalinowski/project-rag-mcp.git
cd project-rag-mcp
# 2. Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# 3. Install dependencies
pip install -e .
# 4. Create the database
createdb notes_mcp
# 5. Configure environment variables
cp .env.example .env
# Edit .env — set GEMINI_API_KEY and verify DATABASE_URLThe notes table is created automatically on first server startup. You can also apply the schema manually:
psql -d notes_mcp -f schema.sqlConfiguration
Variable | Required | Default | Description |
| Yes | — | Google AI Studio API key |
| Yes | — | PostgreSQL connection string |
| No |
| Persistent ChromaDB directory |
| No |
| Chat model for generation |
| No |
| Embedding model |
Copy .env.example to .env and fill in the required values. Never commit .env.
MCP Tools
Tool | Description |
| Persist a note to PostgreSQL and index its embedding in ChromaDB |
| Semantic similarity search — returns title, snippet, and distance |
| Full RAG: retrieve relevant notes → generate a grounded answer via Gemini |
| Return all notes (id, title, created_at), newest first |
| Summarize a single note in 2–3 sentences using Gemini |
| Remove a note from both PostgreSQL and ChromaDB |
MCP resource: notes://{note_id} — exposes raw note content for direct read access.
Connecting to MCP Clients
MCP Inspector (browser UI — easiest for testing)
mcp dev server.pyOpen the Inspector in your browser. In the Tools tab:
add_note("Python GIL", "The GIL is a mutex that protects access to Python objects...")Add 2–3 more notes on different topics.
search_notes("what is the GIL")→ the GIL note should rank first.ask("explain the GIL based on my notes")→ grounded answer citing note titles.summarize_note(1), thendelete_note(1)→ verify PostgreSQL ↔ ChromaDB consistency.
Claude Desktop
Add the following entry to your Claude Desktop MCP config (claude_desktop_config.json):
{
"mcpServers": {
"notes-rag": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["/absolute/path/to/server.py"]
}
}
}Claude Code (CLI)
claude mcp add notes-rag /absolute/path/to/.venv/bin/python -- /absolute/path/to/server.pyProject Structure
project-rag-mcp/
├── server.py # FastMCP entry point — 6 tools + notes resource
├── rag_chain.py # LangChain LCEL: Gemini + ChromaDB + RAG chain
├── db.py # PostgreSQL data layer (psycopg3)
├── schema.sql # notes table DDL
├── pyproject.toml # project metadata and dependencies
├── .env.example # environment variable template
└── LICENSELicense
MIT © 2025 Konrad Malinowski
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/konradxmalinowski/mcp-notes'
If you have feedback or need assistance with the MCP directory API, please join our Discord server