Get the FREE Ultimate OpenClaw Setup Guide →

local_faiss_mcp

Local FAISS vector store as an MCP server – drop-in local RAG for Claude / Copilot / Agents.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio nonatofabio-local_faiss_mcp python -m local_faiss_mcp --index-dir /path/to/index

How to use

The Local FAISS MCP Server provides a self-contained vector store powered by FAISS for retrieval-augmented generation workflows. It ingests documents, builds a local vector index, and serves MCP-compatible tool calls for ingestion and querying. You can use the ingest_document tool to add content to the vector store and the query_rag_store tool to retrieve relevant document chunks based on a natural language query. Optional built-in prompts like extract-answer and summarize-documents help you generate structured, citation-backed responses from the retrieved chunks. The server exposes three main usage modes: running the installed CLI, running as a Python module, or running the server directly for development/testing. When running, you specify an index directory where FAISS and metadata are stored, and you can customize the embedding model and re-ranking options via command-line arguments.

To interact with the MCP server, use:

  • ingest_document to add new content to the index (e.g., local and remote documents).
  • query_rag_store to search the vector store for relevant chunks.
  • Then apply prompts like extract-answer to generate a formatted answer with citations, or summarize-documents to create focused summaries from multiple chunks.

How to install

Prerequisites:

  • Python 3.10+ installed on your system
  • Pip available for installing Python packages

Install the MCP server package from PyPI:

pip install local-faiss-mcp

Usage variants after installation:

  1. Run the server using the installed CLI (easiest):
local-faiss-mcp --index-dir /path/to/index/directory
  1. Run the server as a Python module (recommended for MCP workflows):
python -m local_faiss_mcp --index-dir /path/to/index/directory
  1. For development or testing, run the server module directly:
python local_faiss_mcp/server.py --index-dir /path/to/index/directory

Optional to enable broader file format support, install pandoc if you plan to ingest DOCX, HTML, EPUB, and more formats:

# macOS
brew install pandoc

# Linux
sudo apt install pandoc

Note: PDF, TXT, and MD ingestion works without pandoc. To upgrade later:

pip install --upgrade local-faiss-mcp

Additional notes

Tips and common considerations:

  • The index directory is created automatically if it does not exist. Ensure the path has read/write permissions.
  • By default, embeddings use the configured Hugging Face model; you can pass --embed to customize the model (e.g., all-MiniLM-L6-v2, all-mpnet-base-v2).
  • Re-ranking can improve results. Use --rerank to enable the default cross-encoder-based reranker, or specify a model with --rerank <model-name>.
  • The server listens for MCP tool calls via stdin/stdout. When integrating with an MCP client, ensure proper I/O handling in your environment.
  • If you encounter memory issues with large corpora, consider reducing top_k during query_rag_store or using smaller embedding models for resource-constrained setups.

Related MCP Servers

Sponsor this space

Reach thousands of developers