A Model Context Protocol (MCP) server that enables LLMs to interact directly the documents that they have on-disk through agentic RAG and hybrid search in LanceDB. Ask LLMs questions about the dataset as a whole or about specific documents.
A Model Context Protocol (MCP) server that enables LLMs to interact directly the documents that they have on-disk through agentic RAG and hybrid search in LanceDB. Ask LLMs questions about the dataset as a whole or about specific documents.
To get started, create a local directory to store the index and add this configuration to your Claude Desktop config file:
MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{ "mcpServers": { "lancedb": { "command": "npx", "args": [ "lance-mcp", "PATH_TO_LOCAL_INDEX_DIR" ] } } }
ollama pull snowflake-arctic-embed2
ollama pull llama3.1:8b
{ "mcpServers": { "lancedb": { "command": "node", "args": [ "PATH_TO_LANCE_MCP/dist/index.js", "PATH_TO_LOCAL_INDEX_DIR" ] } } }
Use npm run build
to build the project.
Use npx @modelcontextprotocol/inspector dist/index.js PATH_TO_LOCAL_INDEX_DIR
to run the MCP tool inspector.
The seed script creates two tables in LanceDB - one for the catalog of document summaries, and another one - for vectorized documents' chunks. To run the seed script use the following command:
npm run seed -- --dbpath --filesdir
You can use sample data from the docs/ directory. Feel free to adjust the default summarization and embedding models in the config.ts file. If you need to recreate the index, simply rerun the seed script with the --overwrite
option.
Try these prompts with Claude to explore the functionality:
"What documents do we have in the catalog?" "Why is the US healthcare system so broken?"
The server provides these tools for interaction with the index:
catalog_search
: Search for relevant documents in the catalogchunks_search
: Find relevant chunks based on a specific document from the catalogall_chunks_search
: Find relevant chunks from all known documentsThis project is licensed under the MIT License - see the LICENSE file for details.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!