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.
docker compose up -d
./gradlew bootRun
./gradlew build java -jar build/libs/solr-mcp-1.0.0-SNAPSHOT.jar
docker run -i --rm ghcr.io/apache/solr-mcp:latest
PROFILES=http ./gradlew bootRun
PROFILES=http java -jar build/libs/solr-mcp-1.0.0-SNAPSHOT.jar
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
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-1.0.0-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-1.0.0-SNAPSHOT.jar" ], "env": { "PROFILES": "http", "SOLR_URL": "http://localhost:8983/solr/" } } } }
Connecting to a running HTTP server
If you already have the MCP server running in HTTP mode (via Gradle, JAR, or Docker), you can connect Claude Desktop to it using mcp-remote:
Running via Gradle:
PROFILES=http ./gradlew bootRun
Running locally (JAR):
PROFILES=http java -jar build/libs/solr-mcp-1.0.0-SNAPSHOT.jar
Running via Docker:
docker run -p 8080:8080 --rm -e PROFILES=http ghcr.io/apache/solr-mcp:latest
Then add to your claude_desktop_config.json:
{ "mcpServers": { "solr-mcp-http": { "command": "npx", "args": [ "mcp-remote", "http://localhost:8080/mcp" ] } } }
More configuration options: docs/DEPLOYMENT.md#docker-images-with-jib
The Solr MCP server supports OAuth2 authentication when running in HTTP mode, providing secure access control for your MCP tools.
http profileConfigure Auth0 (see detailed guide: docs/AUTH0_SETUP.md)
Set Environment Variable:
export OAUTH2_ISSUER_URI=https://your-tenant.auth0.com/ export PROFILES=http
Run the Server:
./gradlew bootRun
Get Access Token (using convenience script):
./scripts/get-auth0-token.sh --domain your-tenant.auth0.com \ --client-id YOUR_CLIENT_ID \ --client-secret YOUR_CLIENT_SECRET \ --audience https://solr-mcp-api
Use the Token:
curl -H "Authorization: Bearer YOUR_TOKEN" \ http://localhost:8080/mcp
For complete setup instructions, see docs/AUTH0_SETUP.md
| Tool | Description |
|---|---|
search | Search Solr collections with advanced query options |
index_documents | Index documents from JSON, CSV, or XML |
listCollections | List all available Solr collections |
getCollectionStats | Get statistics and metrics for a collection |
checkHealth | Check the health status of a collection |
getSchema | Retrieve schema information for a collection |
MCP Resources provide a way to expose data that can be read by MCP clients. The Solr MCP Server provides the following resources:
| Resource URI | Description |
|---|---|
solr://collections | List of all Solr collections available in the cluster |
solr://{collection}/schema | Schema definition for a specific collection (supports autocompletion) |
The solr://{collection}/schema resource supports autocompletion for the {collection} parameter. MCP clients can use the completion API to get a list of available collection names.
Claude Desktop (STDIO):
MCP Inspector (HTTP):
MCP Inspector (HTTP with OAuth2 - Success):
MCP Inspector (HTTP with OAuth2 - Failure):
MCP Inspector (STDIO):
We welcome contributions!
Apache License 2.0 — see LICENSE
Built with: