localrag
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., "@localragsearch my notes for ideas on project planning"
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.
localrag
Zero-dependency local semantic search over your own files — plus a tiny MCP server so Claude (or any MCP client) can search them as a tool.
Nothing leaves your machine. Embeddings come from any OpenAI-compatible endpoint; point it at Ollama, LM Studio, llama.cpp, or vLLM running locally.
No dependencies. Pure standard library —
urllib,json,math. The index is one JSON file; search is plain cosine similarity.Two ways in: a
localragCLI, and an MCP server (search_docstool).
Install
pip install localragRelated MCP server: RAG MCP Server
Quick start
Assuming Ollama with an embedding model:
ollama pull nomic-embed-text
localrag build ~/notes ~/docs # index your files (.md/.txt/.rst)
localrag query "what did I decide about the deploy pipeline?"
localrag query "deploy pipeline" --answer # retrieve + let a chat model answerOutput:
=== top 5 for: deploy pipeline ===
[1] (0.812) notes/ops.md
We settled on blue/green with a manual approval gate before cutover...Use it from Claude / any MCP client (the search_docs tool)
Run the server:
python -m localrag.mcp_serverRegister it with an MCP client. For Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"localrag": {
"command": "python",
"args": ["-m", "localrag.mcp_server"],
"env": { "LOCALRAG_INDEX": "/home/you/notes/localrag-index.json" }
}
}
}Now the model can call search_docs("...") to ground its answers in your notes.
Configuration
All optional — sensible local defaults out of the box.
Env var | Meaning | Default |
| OpenAI-compatible base URL (incl. |
|
| embedding model |
|
| base URL for | = |
| chat model for |
|
| bearer token, if your server needs one | (none) |
| index file path |
|
Using a hosted endpoint instead of local? Point LOCALRAG_EMBED_URL at it and
set LOCALRAG_API_KEY — the same code path works with the OpenAI API.
How it works
Chunk — files are split on blank lines into ~800-char blocks with a small overlap so context isn't cut mid-thought.
Embed — each chunk is embedded once and stored with its vector in a JSON index.
Search — the query is embedded and ranked against every chunk by cosine similarity. For
--answer, the top chunks become the sole context for a grounded reply.
Small corpora (thousands of chunks) are the sweet spot: no database, no server, just a file you can commit or delete.
License
MIT — see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Agentic search over your Dewey document collections from any MCP-compatible client.
The Needle MCP server enables semantic search on documents stored in files like PDFs, DOCX, and XLSX by connecting AI applications to external data sources. It provides capabilities to create and manage document collections, perform natural language searches on stored content, and retrieve relevant information without requiring exact keyword matches.
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
- docs2mcpOAuthcom.docs2mcp
Query your own PDFs and documents from any MCP client. Every answer cites the page it came from.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides semantic search and management of shared documentation using ChromaDB and OpenAI embeddings. It enables users to query local documents by meaning, list files, and read content through natural language tools.-
- FlicenseNot gradedqualityDmaintenanceProvides tools for ingesting documents into a local vector database and retrieving relevant information via semantic search, enabling retrieval-augmented generation for MCP clients.7-
- FlicenseAqualityDmaintenanceA local-first document retrieval engine that mounts as an MCP tool for agents to index files, search for relevant passages, and let the agent's own LLM answer.4-
- AlicenseNot gradedqualityBmaintenanceEnables semantic search over a local knowledge base using MCP tools, allowing AI clients to retrieve relevant document chunks via the search_knowledge tool.191 npm2MIT