study-mcp
Converts study materials like PDFs, slides, and DOCX into a searchable vector database with semantic search, summarization, and flashcard generation, integrated with Notion.
README
๐ study-mcp
A Model Context Protocol (MCP) server that turns video transcripts and study materials into a searchable, AI-powered knowledge base โ directly inside Claude Desktop.
โจ What it does
Paste a video transcript or point to a PDF, slide deck, DOCX, or image and instantly:
- ๐ฌ Ingest video transcripts โ paste raw text or load
.srt/.vttcaption files; timestamps are preserved so you can jump back to the exact moment in the video - ๐ Search semantically โ ask questions in natural language across all your materials, powered by local embeddings (no API cost)
- ๐ฏ Generate quizzes โ sample representative context from any material so Claude can quiz you on it
- ๐ง Summarize & create flashcards โ saved directly to Notion
- ๐ Track your library โ list materials, inspect overviews, view stats, delete what you no longer need
Everything runs locally by default (ChromaDB + HuggingFace embeddings). Set a single environment variable to switch to pgvector on Supabase/Postgres.
๐งฐ Tech Stack
| Layer | Technology |
|---|---|
| Language | Python 3.13 |
| MCP server | MCP Python SDK (FastMCP) |
| Embeddings | sentence-transformers + HuggingFace models (local inference, PyTorch) |
| Vector stores | ChromaDB (local) ยท pgvector on Supabase/Postgres (cloud) |
| Document parsing | Docling (PDF, DOCX, PPTX, HTML, images) + native SRT/VTT parser |
| Integrations | Notion API (notion-client) |
| Configuration | pydantic-settings (typed, env-based) |
| Tooling | Poetry ยท pytest (+coverage) ยท ruff ยท mypy --strict ยท pre-commit ยท commitizen |
| CI | GitHub Actions (lint, type check, tests on every push/PR) |
๐๏ธ Architecture
study-mcp/
โโโ src/study_mcp/
โ โโโ core/
โ โ โโโ config.py # Settings via environment variables (pydantic-settings)
โ โ โโโ embeddings.py # sentence-transformers, local inference, E5 prefixing
โ โ โโโ chunker.py # Heading โ paragraph โ sentence-aware chunking
โ โ โโโ transcript.py # SRT/VTT parser with timestamp preservation
โ โโโ db/
โ โ โโโ __init__.py # VectorRepository protocol + backend auto-detection
โ โ โโโ chroma.py # Local vector store (ChromaDB, zero setup)
โ โ โโโ pgvector.py # Cloud vector store (Supabase/Postgres, HNSW index)
โ โโโ tools/
โ โ โโโ ingest.py # File & raw-text ingestion (Docling + native parsers)
โ โ โโโ search.py # Semantic search
โ โ โโโ materials.py # Overview, quiz context, stats, deletion
โ โ โโโ list_materials.py
โ โ โโโ notion.py # Notion integration (summaries & flashcards)
โ โโโ server.py # FastMCP server: tools, resource, prompt, lifespan
โโโ tests/ # 60 tests, ~96% coverage, no model download needed
โโโ docs/
โโโ claude_desktop_config.json
Design highlights:
- Repository pattern โ both vector backends implement the same
VectorRepositoryprotocol; the backend is chosen at startup fromDATABASE_URLwith no code changes. - E5 query/passage prefixing โ
intfloat/multilingual-e5-*models are trained withquery:/passage:prefixes; applying them measurably improves retrieval quality. Applied automatically when an E5 model is configured. - Sentence-aware chunking โ text is split by heading, then paragraph, then grouped by whole sentences with sentence-level overlap. Chunks never cut a word or sentence in half.
- Idempotent ingestion โ
material_idis a SHA-256 content hash, so re-ingesting the same material is a no-op (already_indexed) instead of a duplicate. - Timestamp-aware transcripts โ SRT/VTT cues are grouped into paragraphs by speech pauses; search results on transcripts carry a
start_timeso you can jump back into the video.
๐ ๏ธ Available Tools
| Tool | Description |
|---|---|
ingest_text_tool |
Ingest raw text โ e.g. a pasted video transcript โ into the vector store |
ingest_file_tool |
Convert and index a file: PDF, DOCX, PPTX, HTML, images, .txt, .md, .srt, .vtt |
search_tool |
Semantic search across all indexed materials (optionally scoped to one) |
list_materials_tool |
List all indexed materials |
get_material_overview_tool |
Preview the first chunks of a material before summarizing or quizzing |
generate_quiz_context_tool |
Sample chunks spread across a material so Claude can write quiz questions |
study_stats_tool |
Totals: materials, chunks, chunks per material |
delete_material_tool |
Remove a material and all of its chunks |
save_summary_tool |
Save a summary to Notion |
save_flashcards_tool |
Save Q&A flashcards to Notion |
create_quiz_tool |
Create an interactive quiz page in Notion (open or multiple-choice, answer in Notion then paste back for checking) |
The three Notion tools also accept related_pages (a list of
notion_url values from earlier saves in the same conversation) to
link a new page to related materials via Notion's native mentions -
see docs/NOTION_SETUP.md.
The server also exposes an MCP resource (study://materials, the current library as JSON) and a prompt (study_prompt, a ready-made study-plan workflow for any material).
๐ Quick Start
1. Clone and install
git clone https://github.com/italoo97/study-mcp.git
cd study-mcp
poetry install
2. Configure environment
cp .env.example .env
All variables have sensible defaults โ the server works out of the box with ChromaDB and no external services. See .env.example for every option.
3. Configure Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (see docs/claude_desktop_config.json for a full example):
{
"mcpServers": {
"study-mcp": {
"command": "poetry",
"args": [
"--directory", "/absolute/path/to/study-mcp",
"run", "python", "-m", "study_mcp.server"
],
"env": {
"CHROMA_PATH": "/absolute/path/to/study-mcp/chroma_db"
}
}
}
}
โ ๏ธ Claude Desktop launches the server from its own working directory, so relative paths (like the
.envfile or the default./chroma_db) won't resolve to the project folder. SetCHROMA_PATHto an absolute path as above, and pass any other variables (NOTION_TOKEN,DATABASE_URL, ...) in theenvblock โ seedocs/claude_desktop_config.jsonfor a complete example.
Vector backend is auto-detected:
DATABASE_URLempty โ ChromaDB locally (zero setup)DATABASE_URLset โ pgvector on Supabase/Postgres (free tier works; table and HNSW index are created automatically)
4. Restart Claude Desktop
The tools appear automatically.
๐ฌ Ingesting video transcripts
The main workflow this server was built for:
- Open a video (YouTube, a recorded lecture, a course platform) and copy its transcript โ or download the captions as
.srt/.vtt. - Paste it into Claude: "Ingest this transcript as 'Linear Algebra โ Lecture 3': ..." โ Claude calls
ingest_text_tool. - Ask anything: "According to my lecture, what is an eigenvector?" โ
search_toolreturns the most relevant passages, each with astart_timewhen available, so you can jump back to that moment in the video. - Study actively: "Quiz me on this lecture" โ
generate_quiz_context_toolsamples passages spread across the whole material and Claude writes the questions.
.srt/.vtt files are parsed natively: cue numbers and markup are stripped, consecutive cues are merged into paragraphs at natural speech pauses, and paragraph start times are preserved as metadata.
๐ง Embedding Models
Set EMBEDDING_MODEL to any sentence-transformers compatible model:
| Model | Languages | Dims |
|---|---|---|
intfloat/multilingual-e5-small (default) |
PT + EN + 90 more | 384 |
intfloat/multilingual-e5-base |
PT + EN + 90 more | 768 |
BAAI/bge-small-en-v1.5 |
EN only | 384 |
Update
EMBEDDING_DIMto match โ the server validates the dimension at startup and fails fast on a mismatch.
๐ Notion Setup (optional)
Only needed for save_summary_tool and save_flashcards_tool. Full
walkthrough (including a script that creates the database for you)
in docs/NOTION_SETUP.md.
Quick version:
- Create an integration at notion.so/my-integrations
- Create the database โ either run
poetry run python scripts/create_notion_database.py <parent_page_id>(creates it with the right schema and shares it automatically), or create it by hand with these properties:Name(Title),Type(Select),Material(Rich text),Tags(Multi-select) โ then share it with your integration manually. - Set
NOTION_TOKENandNOTION_DATABASE_IDin theenvblock of your Claude Desktop config (not.envโ seedocs/claude_desktop_config.json).
๐ก Example usage in Claude
"Ingest this transcript as 'ML Course โ Gradient Descent': [pasted transcript]"
"Ingest this file: /Users/me/Downloads/algorithms_lecture.pdf"
"Search my materials: what is dynamic programming?"
"Give me an overview of material a1b2c3d4"
"Quiz me with 10 questions about my gradient descent lecture"
"Summarize it and save to Notion with tags: ML, optimization"
"Show my study stats"
๐ง Development
poetry install
poetry run task lint # ruff check
poetry run task format # ruff format
poetry run task type_check # mypy --strict
poetry run task test # pytest (60 tests, coverage gate at 80%)
The test suite runs without downloading any embedding model โ embeddings are faked with deterministic vectors and the repository layer is tested against an in-memory double plus a real ChromaDB instance in a temp directory.
CI (GitHub Actions) runs lint, strict type checking, and the full test suite on every push and PR.
๐ License
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.