# Opensolr MCP server

> Provides managed Apache Solr search with hybrid BM25+kNN retrieval, server-side embeddings, and grounded RAG answers for AI agents.

- Repository: https://github.com/phpcip/opensolr-mcp
- Page: https://hostedmcp.org/servers/phpcip/opensolr-mcp
- Transport: stdio
- Stars: 0
- License: MIT
- Latest version: 0.8.1

## Install

### Claude Code

```sh
claude mcp add --env 'OPENSOLR_API_KEY=<YOUR_OPENSOLR_API_KEY>' --env 'OPENSOLR_EMAIL=<OPENSOLR_EMAIL>' opensolr-mcp -- uvx opensolr-mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "opensolr-mcp": {
      "command": "uvx",
      "args": [
        "opensolr-mcp"
      ],
      "env": {
        "OPENSOLR_API_KEY": "<YOUR_OPENSOLR_API_KEY>",
        "OPENSOLR_EMAIL": "<OPENSOLR_EMAIL>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "opensolr-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "opensolr-mcp"
      ],
      "env": {
        "OPENSOLR_API_KEY": "<YOUR_OPENSOLR_API_KEY>",
        "OPENSOLR_EMAIL": "<OPENSOLR_EMAIL>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"opensolr-mcp","type":"stdio","command":"uvx","args":["opensolr-mcp"],"env":{"OPENSOLR_API_KEY":"<YOUR_OPENSOLR_API_KEY>","OPENSOLR_EMAIL":"<OPENSOLR_EMAIL>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "opensolr-mcp": {
      "command": "uvx",
      "args": [
        "opensolr-mcp"
      ],
      "env": {
        "OPENSOLR_API_KEY": "<YOUR_OPENSOLR_API_KEY>",
        "OPENSOLR_EMAIL": "<OPENSOLR_EMAIL>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add opensolr-mcp --env 'OPENSOLR_API_KEY=<YOUR_OPENSOLR_API_KEY>' --env 'OPENSOLR_EMAIL=<OPENSOLR_EMAIL>' -- uvx opensolr-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.opensolr-mcp]
command = "uvx"
args = ["opensolr-mcp"]

[mcp_servers.opensolr-mcp.env]
OPENSOLR_API_KEY = "<YOUR_OPENSOLR_API_KEY>"
OPENSOLR_EMAIL = "<OPENSOLR_EMAIL>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'OPENSOLR_API_KEY=<YOUR_OPENSOLR_API_KEY>' -e 'OPENSOLR_EMAIL=<OPENSOLR_EMAIL>' opensolr-mcp uvx -- opensolr-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "opensolr-mcp": {
      "command": "uvx",
      "args": [
        "opensolr-mcp"
      ],
      "env": {
        "OPENSOLR_API_KEY": "<YOUR_OPENSOLR_API_KEY>",
        "OPENSOLR_EMAIL": "<OPENSOLR_EMAIL>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `OPENSOLR_API_KEY` | yes | yes | Opensolr API key, found under Account > API in the control panel; the shared demo account's key is 420b8b23e7b12dc8ab838932145a5065 (preloaded index mcp_demo_d1__dense with 300 news articles, limits per index are 200 MB bandwidth and 50 MB disk, anything created is deleted after 3 days and other people can change or delete it) |
| `OPENSOLR_EMAIL` | yes | no | Opensolr account email; try the shared demo account mcp@opensolr.com, whose indexes are deleted after 3 days and can be changed or deleted by anyone else using it, or get your own at https://opensolr.com/register (free forever, no card) |

## Tools (13)

- `opensolr_search`
- `opensolr_search_by_image`
- `opensolr_read_document`
- `opensolr_ai_answer`
- `opensolr_index_files`
- `opensolr_extract_text`
- `opensolr_describe_image`
- `opensolr_add_documents`
- `opensolr_delete_documents`
- `opensolr_create_index`
- `opensolr_vector_regions`
- `opensolr_check_schema`
- `opensolr_apply_schema`

## FAQ

### Do I need to configure an embedding model or run a vector database?

No, the service handles embeddings server-side and requires no vector database management.

### Can I search using images?

Yes, you can search with photos; the system reads visual labels, OCR text, and barcodes/QR codes to perform the search.

### Is there a way to try the service without creating an account?

Yes, a public demo account is available that allows immediate searching and indexing with a shared API key.
