Purpose
opensolr-mcp is the MCP (Model Context Protocol) server for Opensolr, whose goal is to make the search capabilities of hosted Apache Solr available as tools for any AI agent to use. It wraps hybrid retrieval, server-side embeddings, document indexing, and RAG answers into agent-callable tools, so agents do not need to set up their own vector database or configure embedding models.
Main Capabilities
- Hybrid retrieval: BM25 keyword retrieval fused with kNN vector retrieval, scored by document fusion.
- Server-side embeddings: Embeddings are computed on the Opensolr server (GPU), with no need for users to configure embedding models.
- Document indexing: Supports local files and entire folders; PDFs are indexed by page (one document per page); scanned documents are read via OCR (supporting more than 100 languages); Word, RTF, OpenDocument, text, HTML, and image files are each treated as one document.
- Grounded RAG answers: Generates grounded answers based on retrieval results.
- Search by image:
opensolr_search_by_imageAllows agents to query with images instead of text. Opensolr reads images from three aspects—visual labels, OCR text, and barcodes/QR codes—converts them to text, and then performs a regular search, without storing image vectors. - Text extraction:
opensolr_extract_textReads only without indexing, returning the text of each file; PDFs are returned by page (page, text, is_ocr, lang). - Image description:
opensolr_describe_imageReturns an image content description (caption), OCR text, labels, and barcodes/QR codes. - Search operators: Query strings support
+、-, phrases, and other operators, and are available in keyword, hybrid, and pure vector modes; prefixed words or phrases are converted into filters that apply to the entire result set. - Date range:
date_fromanddate_to(YYYY-MM-DD, inclusive) filter by document creation_date. - Freshness bias:
fresh_biasmultiplies scores by a time curve based on creation_date, only re-ranking without filtering, and is off by default. - PDF page grouping:
group_pagescontrols whether PDFs are returned by best page;opensolr_read_documentcan read the complete results. - Pure keyword mode: When vectors are not needed, embedding calls can be skipped, consuming zero AI quota.
How to Use
- Register for a free account at opensolr.com/register (free forever, no credit card required), and copy the API key from Account.
- Run the command in an MCP client with stdio transport
uvx opensolr-mcp(orpipx run opensolr-mcp), and setOPENSOLR_EMAILandOPENSOLR_API_KEYin the environment variables. - Supports Claude Desktop, Claude Code, Cursor, Windsurf, and any MCP client.
- Provides a public demo account
mcp_demo_d1__dense, preloaded with 300 news articles; you can try search, filtering, and grounded answers without registering, and you can also create your own index on an account to write and query. - Writing is performed asynchronously through Opensolr's Data Ingestion API: after documents are queued, the server computes derived fields such as embeddings, sentiment, and language, and they become searchable in about one minute; progress can be viewed in Control Panel → Data Ingestion, or queried through the ingest_status API.
- Each index is also a standard Apache Solr with a native /select API.
- There is also a Python LangChain integration: langchain-opensolr.
Applicable scenarios
- Let AI agents retrieve and answer questions over their own documents, FAQs, contracts, scanned invoices, or report folders.
- Search applications that need hybrid keyword and semantic retrieval, cross-language queries, or pure semantic hits.
- Scenarios that need search by image or extraction of text and barcodes from images.
- RAG applications that need to generate grounded answers based on retrieval results.
Limitations
- The demo account is a shared account: created content is automatically deleted after 3 days without warning or export; the index is visible to everyone, and others can add documents; under this key the index cannot be deleted or reconfigured; each index is limited to 200 MB bandwidth and 50 MB disk.
- The vector index is located in the vector zone (the Opensolr server running the web crawler), and the available zones are returned in real time by
opensolr_vector_regions; additional dedicated zones are a paid add-on and require contacting support@opensolr.com. - Features in the package require the index to be located in the vector zone and to have the Opensolr vector schema; when this is not satisfied, related operations are blocked and an OpensolrSchemaError is thrown.
apply_schemacan install the configuration for an index whose configuration in the vector zone has been changed or not set; indexes with existing documents requireforce=Trueand documents must be resent; indexes outside the vector zone cannot apply it. - Images read via OCR count as 0.5 AI requests each; files that have been read before are free.
- Large files are read in the background; those that are still not completed after wait_seconds will appear in pending, and must be called again with the same path.
- Specific charges, prices, and more platform details are not provided for now.