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.
Notatki RAG — przykładowy serwer MCP
Serwer MCP (Model Context Protocol) w Pythonie, który łączy LLM + bazę danych w pełny przepływ RAG zbudowany na LangChain (LCEL). Notatki trafiają do PostgreSQL (system zapisu), ich treść+embeddingi do ChromaDB, a odpowiedzi generuje Google Gemini. Ćwiczenie do kursu IBM Build AI Agents using MCP.
Architektura
Warstwa | Rola | Plik |
PostgreSQL | system zapisu dla notatek ( |
|
ChromaDB ( | vector store: treść + embeddingi → retriever |
|
Gemini ( | embeddingi ( |
|
LCEL | łańcuch RAG: |
|
MCP / FastMCP | wystawia narzędzia klientowi MCP (stdio) |
|
Przepływ pytania (ask) jako łańcuch LCEL:
{"context": retriever | format_docs, "question": RunnablePassthrough()}
| prompt | llm | StrOutputParser()retriever (Chroma) zwraca dopasowane notatki → format_docs skleja kontekst → Gemini
odpowiada tylko na jego podstawie. PostgreSQL pozostaje źródłem prawdy dla treści
i pozwala odbudować indeks (rag_chain.reindex_all).
Related MCP server: AI Sticky Notes
Narzędzia MCP
Narzędzie | Opis |
| zapis do Postgresa + embedding do Chromy |
| wyszukiwanie semantyczne (tytuł, fragment, dystans) |
| pełny RAG: retrieval + odpowiedź Gemini |
| lista wszystkich notatek |
| streszczenie notatki przez Gemini |
| usuwa z Postgresa i z Chromy |
Dodatkowo zasób notes://{id} zwraca treść notatki.
Wymagania
Python ≥ 3.12 (przetestowane na 3.14)
PostgreSQL działający lokalnie (tu: Homebrew
postgresql@15na :5432)Klucz API Gemini: https://aistudio.google.com/apikey
Setup
# 1. Zależności (w aktywnym venv)
python -m pip install -e .
# 2. Baza danych (jeśli jeszcze nie istnieje)
createdb notes_mcp
# 3. Konfiguracja
cp .env.example .env
# → wpisz GEMINI_API_KEY w .env
# → sprawdź DATABASE_URL (domyślnie konto bieżącego usera, trust na localhost)Tabela notes tworzy się automatycznie przy starcie serwera (db.init_schema()).
Można też ręcznie: psql -d notes_mcp -f schema.sql.
Uruchomienie i test
Z inspektorem MCP (interaktywny GUI w przeglądarce — najwygodniej do nauki):
mcp dev server.pyW Inspectorze (zakładka Tools):
add_note("Python GIL", "GIL to globalna blokada interpretera CPython...")dodaj jeszcze 2–3 notatki na różne tematy,
search_notes("czym jest GIL")→ trafienie wskazuje notatkę o GIL,ask("wyjaśnij GIL na podstawie moich notatek")→ odpowiedź ugruntowana w treści,summarize_note(1), potemdelete_note(1)→ sprawdź spójność Postgres ↔ Chroma.
Podpięcie do klienta MCP (np. Claude Desktop) — wpis w configu:
{
"mcpServers": {
"notes-rag": {
"command": "/pełna/ścieżka/.venv/bin/python",
"args": ["/pełna/ścieżka/server.py"]
}
}
}Pliki
server.py # FastMCP + narzędzia MCP (entry point)
rag_chain.py # LangChain: Gemini + Chroma + łańcuch LCEL (RAG)
db.py # PostgreSQL (psycopg3) — system zapisu
schema.sql # tabela notes
pyproject.toml # zależności
.env(.example) # konfiguracjaPoza zakresem (świadomie)
Chunking długich dokumentów, autoryzacja/multi-user, testy automatyczne — ćwiczenie skupia się na integracji RAG + MCP.
This server cannot be installed
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
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/notes-rag-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server