Get the FREE Ultimate OpenClaw Setup Guide →

solr

MCP server for Apache Solr integration

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio adityamparikh-solr-mcp-server java -jar /absolute/path/to/solr-mcp-server/build/libs/solr-mcp-server-0.0.1-SNAPSHOT.jar \
  --env PROFILES="stdio" \
  --env SOLR_URL="http://localhost:8983/solr/"

How to use

This Solr MCP Server exposes a set of MCP tools to interact with an Apache Solr cluster. It provides capabilities for searching collections, indexing documents in JSON, inspecting collection metadata and schema, and monitoring health and statistics. Tools include search (with filters, facets, and pagination), indexing (supporting JSON documents), listing collections, retrieving collection stats, checking health, and getting the Solr schema. Clients can invoke these tools through the MCP protocol in STDIO mode for local use or via HTTP transport for remote testing. To use with Claude Desktop or other MCP clients, configure the MCP server in your application or client settings, then call the available tools with the required parameters such as collection name, query, and document payload. The server uses SolrJ under the hood to communicate with Solr instances and supports nested JSON structures and multi-valued fields. You can also inspect and monitor Solr schemas and collection health via dedicated tools.

How to install

Prerequisites:

  • Java 25 or higher installed on your system
  • Docker and Docker Compose (optional, for running Solr in a container)
  • Gradle 9.1.0 or higher (wrapper included in project)

Installation steps:

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

  2. Start Solr (optional, if you want to run Solr via Docker Compose) docker-compose up -d

    Wait for SolrCloud to initialize and create sample collections (books, films)

  3. Build the MCP server ./gradlew build

    Produces jar files in build/libs/

  4. Run the server java -jar build/libs/solr-mcp-server-0.0.1-SNAPSHOT.jar

  5. Verify functionality

    • Ensure SOLR_URL is reachable (e.g., http://localhost:8983/solr/)
    • Use Claude Desktop or MCP Inspector to connect using the provided mcp_config

Notes:

  • The project uses Gradle version catalogs for dependency management (gradle/libs.versions.toml).
  • The fat JAR includes all dependencies; the plain JAR excludes them.
  • If you prefer running Solr via Docker, ensure ZooKeeper is accessible and the sample collections are created as described in the README.

Additional notes

Tips and common issues:

  • Ensure your SOLR_URL is correct and Solr is reachable from the MCP server process.
  • When using HTTP transport, be mindful of security; consider enabling TLS and authentication in production.
  • The Transport profile can be configured via application-stdio.properties or application-http.properties as described in the README.
  • If you modify document formats, ensure the Solr schema aligns with the sanitized field names produced by the Document Creators (see FieldNameSanitizer in the project).
  • For Claude Desktop integration, update the mcpServers settings to point to the built JAR path and set SOLR_URL and PROFILES environment variables accordingly.

Related MCP Servers

Sponsor this space

Reach thousands of developers