Solr MCP Server

Clone this repo:

Branches

  1. 9f47616 deps: Spring Boot v3.5.7, Spring AI v1.1.0 GA (#20) by Aditya Parikh · 3 weeks ago main
  2. f9668e2 docs: enhance README with comprehensive STDIO and HTTP mode setup instructions (#16) by Aditya Parikh · 5 weeks ago
  3. e68709b docs: Break up readme (#14) by Aditya Parikh · 5 weeks ago
  4. 3b71d12 refactor: Fix jib build and docs (#13) by Aditya Parikh · 5 weeks ago
  5. d924d42 Fix yaml, learn lesson on what review matters! (#9) by Eric Pugh · 5 weeks ago

Project Status: Incubating

Solr MCP Server

A Spring AI Model Context Protocol (MCP) server that provides tools for interacting with Apache Solr. Enables AI assistants like Claude to search, index, and manage Solr collections through the MCP protocol.

What’s inside

  • 🔍 Search Solr collections with filtering, faceting, and pagination
  • 📝 Index documents in JSON, CSV, and XML
  • 📊 Manage collections and view statistics
  • 🔧 Inspect schema
  • 🔌 Transports: STDIO (Claude Desktop) and HTTP (MCP Inspector)
  • 🐳 Docker images built with Jib

Get started (users)

  • Prerequisites: Java 25+, Docker (and Docker Compose), Git
  • Start Solr with sample data:
    docker compose up -d
    
  • Run the server:
    • STDIO mode (default):
      • JAR:
        ./gradlew build
        java -jar build/libs/solr-mcp-0.0.1-SNAPSHOT.jar
        
      • Docker:
        docker run -i --rm ghcr.io/apache/solr-mcp:latest
        
    • HTTP mode:
      • JAR:
        PROFILES=http java -jar build/libs/solr-mcp-0.0.1-SNAPSHOT.jar
        
      • Docker:
        docker run -p 8080:8080 --rm -e PROFILES=http ghcr.io/apache/solr-mcp:latest
        

For more options (custom SOLR_URL, Linux host networking) see the Deployment Guide: docs/DEPLOYMENT.md

Claude Desktop

Add this to your Claude Desktop config (macOS path shown); then restart Claude.

STDIO mode (default)

Using Docker:

{
  "mcpServers": {
    "solr-mcp": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "ghcr.io/apache/solr-mcp:latest"],
        "env": {
            "SOLR_URL": "http://localhost:8983/solr/"
        }
    }
  }
}

Using JAR:

{
    "mcpServers": {
        "solr-mcp": {
            "command": "java",
            "args": [
                "-jar",
                "/absolute/path/to/solr-mcp-0.0.1-SNAPSHOT.jar"
            ],
            "env": {
                "SOLR_URL": "http://localhost:8983/solr/"
            }
        }
    }
}

HTTP mode

Using Docker:

{
    "mcpServers": {
        "solr-mcp": {
            "command": "docker",
            "args": [
                "run",
                "-p",
                "8080:8080",
                "--rm",
                "ghcr.io/apache/solr-mcp:latest"
            ],
            "env": {
                "PROFILES": "http",
                "SOLR_URL": "http://localhost:8983/solr/"
            }
        }
    }
}

Using JAR:

{
    "mcpServers": {
        "solr-mcp": {
            "command": "java",
            "args": [
                "-jar",
                "/absolute/path/to/solr-mcp-0.0.1-SNAPSHOT.jar"
            ],
            "env": {
                "PROFILES": "http",
                "SOLR_URL": "http://localhost:8983/solr/"
            }
    }
  }
}

More configuration options: docs/DEPLOYMENT.md#docker-images-with-jib

Available MCP tools

ToolDescription
searchSearch Solr collections with advanced query options
index_documentsIndex documents from JSON, CSV, or XML
listCollectionsList all available Solr collections
getCollectionStatsGet statistics and metrics for a collection
checkHealthCheck the health status of a collection
getSchemaRetrieve schema information for a collection

Screenshots

  • Claude Desktop (STDIO):

    Claude Desktop STDIO

  • MCP Inspector (HTTP):

    MCP Inspector HTTP

  • MCP Inspector (STDIO):

    MCP Inspector STDIO

Documentation

  • Architecture: docs/ARCHITECTURE.md
  • Development (build, run, test, add features): docs/DEVELOPMENT.md
  • Deployment (Docker, HTTP vs STDIO, CI/CD, MCP Registry): docs/DEPLOYMENT.md
  • Troubleshooting: docs/TROUBLESHOOTING.md

Contributing

We welcome contributions!

  • Start here: CONTRIBUTING.md
  • Developer workflows, coding standards, and tests: docs/DEVELOPMENT.md

Support

License

Apache License 2.0 — see LICENSE

Acknowledgments

Built with: