home / mcp / solr mcp server

Solr MCP Server

Provides MCP-based access to Solr actions: search, index, manage collections, and schema retrieval.

Installation
Add the following to your MCP client configuration file.

Configuration

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

You can use this MCP server to interact with Apache Solr through the MCP protocol. It lets you search, index, manage, and inspect Solr collections from AI assistants or MCP clients, enabling streamlined data access and governance inside your Solr deployments.

How to use

Connect your MCP client (for example Claude Desktop) to the Solr MCP Server using the STDIO transport. Run the server locally, then use its tools to search collections, index documents, manage collections, and retrieve schema information. You will interact with a stable set of MCP tools that map to common Solr operations.

How to install

Prerequisites you need before starting:

  • Java 25 or higher
  • Docker and Docker Compose (for running Solr)
  • Gradle 9.1.0+ (wrapper included in project)

Step-by-step setup:

# 1. Clone the repository
git clone https://github.com/yourusername/solr-mcp-server.git
cd solr-mcp-server

# 2. Start Solr using Docker Compose
docker-compose up -d

# 3. Build the project
./gradlew build

# Build without tests (faster)
./gradlew assemble

# Clean and rebuild
./gradlew clean build

Security considerations and deployment notes

STDIO transport is the recommended option for local deployments because all communication happens within the same machine and avoids network exposure. This keeps credentials from traversing a network. If you explore HTTP mode for remote access, you must implement proper security controls to protect endpoints and data.

Troubleshooting

If you run into issues, verify Solr is accessible at its default URL or any URL you configure via the SOLR_URL environment variable. Check the server logs for error messages, confirm the Solr collections exist, and ensure the STDIO command points to the correct executable JAR. For STDIO mode with Claude Desktop, ensure the JAR path is absolute and correctly referenced in your client configuration.

Notes

The server exposes a defined set of MCP tools for Solr operations, including searching, indexing, listing collections, getting collection stats, checking health, and retrieving schemas. These tools map to common Solr actions and are designed to be invoked from MCP clients in a pluggable, language-agnostic manner.

Available tools

Search

Query a Solr collection with optional filters, facets, sorting, and pagination.

Indexing

Index documents into a Solr collection from JSON, CSV, or XML formats.

ListCollections

List all available Solr collections.

GetCollectionStats

Retrieve detailed statistics and metrics for a Solr collection.

CheckHealth

Check the health status of a Solr collection.

GetSchema

Retrieve the schema information for a Solr collection.