AI agents (MCP)

MCP setup

Connect Claude Code or any MCP client to Zaproo Search and manage indices, documents, profiles, synonyms and ranking rules from your agent.

The server

The MCP server is part of the API, at https://api.zaproo-search.com/mcp. It speaks Streamable HTTP and uses the same secret keys as the REST API. The key's project is the project every tool acts on, and a key with an index scope reaches only those indices. In the cabinet, the project's MCP connection page shows the endpoint and the ready-to-paste command.

The MCP connection page with the endpoint, the claude mcp add command with a Copy button and the start of the list of 27 toolsThe project's MCP connection page

Create a secret key

In the cabinet, open API keys and create a secret key (zs_sk_…). A key with read access can call the read tools only; writes need full access. Public keys (zs_pk_…) are refused with 403. See errors.

Add the server to Claude Code

claude mcp add --transport http zaproo-search https://api.zaproo-search.com/mcp --header "Authorization: Bearer zs_sk_YOUR_KEY"

Or add it to another client

{
  "mcpServers": {
    "zaproo-search": {
      "type": "http",
      "url": "https://api.zaproo-search.com/mcp",
      "headers": { "Authorization": "Bearer zs_sk_YOUR_KEY" }
    }
  }
}

Tools

Each tool runs the same service as the matching REST route, with the same checks and the same audit log. Writes are asynchronous: they return a task id, and get_task tells when the work is done.

MCP tools
ToolWhat it does
list_indicesList the indices of the project with status and document count
get_indexOne index: status, document count and versions
create_indexCreate an index; by default its mapping is inferred from the first upload
get_mappingThe language and every field of an index with its flags
update_mappingReplace the mapping; the answer says whether a reindex is needed
get_facetsThe facets of an index, which profiles without their own show
update_facetsReplace the index facets, labels and order included
reindexRebuild the index into a new version and swap it in without downtime
index_documentsAdd or replace up to 1000 documents (asynchronous, returns a task id)
delete_documentsDelete up to 1000 documents by id (asynchronous)
get_taskPoll an asynchronous write: status, counts and per-document errors
get_documentRead one stored document by id
searchSearch with a saved profile or an inline one, with filters, sort and facets
list_profilesThe search profiles of an index and their profile keys
upsert_profileCreate or replace a search profile
preview_profileCompare an unsaved profile with the saved one for the same query
list_synonymsThe synonym rules of an index, page by page
upsert_synonymsCreate or replace a synonym rule (equivalent or one way)
delete_synonymsDelete one synonym rule
list_rulesThe ranking rules of an index in the order they run, with what needs attention
upsert_ruleCreate or replace a ranking rule: pin, hide, boost or filter products for chosen searches
delete_ruleDelete one ranking rule
reorder_rulesSet the order ranking rules run in
test_ruleRun a search with the rules that fire, and compare a draft rule before saving it
suggestAutocomplete a partial query, with facet hints
rebuild_suggestionsRebuild the autocomplete index from recent searches (asynchronous)
get_search_analyticsSearches, zero-result rate, latency, top and zero-result queries