Skip to main content

Solr MCP

A Python package for accessing Apache Solr indexes via Model Context Protocol (MCP). This integration allows AI assistants like Claude to perform powerful search queries against your Solr indexes, combining both keyword and vector search capabilities.

Features

  • MCP Server: Implements the Model Context Protocol for integration with AI assistants
  • Hybrid Search: Combines keyword search precision with vector search semantic understanding
  • Vector Embeddings: Generates embeddings for documents using Ollama with nomic-embed-text
  • Unified Collections: Store both document content and vector embeddings in the same collection
  • Docker Integration: Easy setup with Docker and docker-compose
  • Optimized Vector Search: Efficiently handles combined vector and SQL queries by pushing down SQL filters to the vector search stage, ensuring optimal performance even with large result sets and pagination

Architecture

Vector Search Optimization

The system employs an important optimization for combined vector and SQL queries. When executing a query that includes both vector similarity search and SQL filters:

  1. SQL filters (WHERE clauses) are pushed down to the vector search stage
  2. This ensures that vector similarity calculations are only performed on documents that will match the final SQL criteria
  3. Significantly improves performance for queries with:
    • Selective WHERE clauses
    • Pagination (LIMIT/OFFSET)
    • Large result sets

This optimization reduces computational overhead and network transfer by minimizing the number of vector similarity calculations needed.

Quick Start

  1. Clone this repository
  2. Start SolrCloud with Docker:
    docker-compose up -d
    
  3. Install dependencies:
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    pip install poetry
    poetry install
    
  4. Process and index the sample document:
    python scripts/process_markdown.py data/bitcoin-whitepaper.md --output data/processed/bitcoin_sections.json
    python scripts/create_unified_collection.py unified
    python scripts/unified_index.py data/processed/bitcoin_sections.json --collection unified
    
  5. Run the MCP server:
    poetry run python -m solr_mcp.server
    

For more detailed setup and usage instructions, see the QUICKSTART.md guide.

Requirements

  • Python 3.10 or higher
  • Docker and Docker Compose
  • SolrCloud 9.x
  • Ollama (for embedding generation)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Metadata

Release files for iflow-mcp_solr-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_solr-mcp 0.1.0
File Size Uploaded
iflow_mcp_solr_mcp-0.1.0.tar.gz 35.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_solr-mcp 0.1.0
File Interpreter ABI Platform
iflow_mcp_solr_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 87.3 kB

Release files / iflow_mcp_solr_mcp-0.1.0.tar.gz

Download URL iflow_mcp_solr_mcp-0.1.0.tar.gz
Size 35.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e46176633695a24f18908f2c7b0c7821953f2fb3cb5eddeca8ea8c6a228352b8
BLAKE2b-256 checksum
How to use checksums
e53aa81a11e230f6843abcdd87ffd973a64657910502f9910262537f171d5f0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / iflow_mcp_solr_mcp-0.1.0-py3-none-any.whl

Download URL iflow_mcp_solr_mcp-0.1.0-py3-none-any.whl
Size 51.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab7971c8624403b076c87649e397db8c8adbab291cc9f5772a18e520d993ed92
BLAKE2b-256 checksum
How to use checksums
8830e54f627d07185978ef56c6b175e4f48e64808c187a41234d4f5b14d5f99d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page