[metadata]
description: Query documentation with the DocSearch MCP server.
docsearch:docusaurus_tag: docs-default-current
docsearch:language: en
docsearch:version: current
docusaurus_locale: en
docusaurus_tag: docs-default-current
docusaurus_version: current
generator: Docusaurus v3.10.2
google-site-verification: 23yIHmCD_xnJb_6e3s-w7M29Kydahk-d86ObMWOrvRg
og:description: Query documentation with the DocSearch MCP server.
og:image: https://docsearch.algolia.com/img/og_image.png
og:locale: en
og:title: Use DocSearch MCP | DocSearch by Algolia
og:url: https://docsearch.algolia.com/docs/mcp/usage
twitter:card: summary_large_image
twitter:image: https://docsearch.algolia.com/img/og_image.png
viewport: width=device-width,initial-scale=1

[canonical-links]
https://docsearch.algolia.com/docs/mcp/usage

[document-links]
/
Agent Studio: /docs/agent-studio/getting-started
Algolia Blog: https://algolia.com/blog/
Algolia Crawler: /docs/create-crawler
DOCSEARCH by: /
Discord: https://discord.com/invite/W7kYfh7FKQ
DocSearch v3: /docs/v3/docsearch
DocSearch v4: /docs/v4/docsearch
DocSearch v5: /docs/packages/overview
Documentation: /docs/what-is-docsearch
Edit this page: https://github.com/algolia/docsearch/edit/main/packages/website/docs/mcp/usage.mdx
FAQ: /docs/docsearch-program
Getting Started: /docs/what-is-docsearch
GitHub: https://github.com/algolia/docsearch
Installation: /docs/mcp/installation
Introduction: /docs/what-is-docsearch
Issues: https://github.com/algolia/docsearch/issues
Legacy (v1.x - v2.x): /docs/legacy/dropdown
Legacy (v3.x): /docs/v3/what-is-docsearch
Legacy (v4.x): /docs/v4/what-is-docsearch
MCP: /docs/mcp/overview
MCP: https://docsearch.algolia.com/mcp
Migrate from v4: /docs/migrating-from-v4
Miscellaneous: /docs/migrating-from-legacy
Next Create a new crawler: /docs/create-crawler
Overview: /docs/mcp/overview
Packages: /docs/packages/overview
Previous Installation: /docs/mcp/installation
Privacy: https://www.algolia.com/policies/privacy/
Requirements, tips, FAQ: /docs/crawler
Sign up: https://dashboard.algolia.com/users/sign_up?selected_plan=docsearch&utm_source=docsearch.algolia.com&utm_medium=referral&utm_campaign=docsearch&utm_content=apply
Stable (v5.x): /docs/mcp/usage
Twitter: https://twitter.com/docsearch_
Under the hood: /docs/how-does-it-work
Usage: /docs/mcp/usage
choose a package: /docs/packages/overview
https://github.com/algolia/docsearch
installation guide: /docs/mcp/installation

[structured-data]
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","item":"https://docsearch.algolia.com/docs/mcp/usage","name":"Usage","position":1}]}

[content]
Use DocSearch MCP | DocSearch by Algolia
Skip to main content
DocSearch 5.0.0 is available.
Migrate from v4
or
choose a package
DOCSEARCH
by
Documentation
MCP
Stable (v5.x)
Stable (v5.x)
Legacy (v4.x)
Legacy (v3.x)
Legacy (v1.x - v2.x)
Go on, give it a search...
Sign up
Introduction
Packages
Agent Studio
MCP
Overview
Installation
Usage
Algolia Crawler
Requirements, tips, FAQ
Under the hood
Miscellaneous
MCP
Usage
Version: Stable (v5.x)
On this page
Use DocSearch MCP
Ask focused questions about public documentation. Include the official product name, topic, and version when the version affects the answer.
How do I configure middleware matchers in Next.js?
Show me the Stripe webhook signature verification documentation.
What is the setup for Algolia InstantSearch React?
If your client doesn't select MCP tools on its own, name the server in your request:
Use DocSearch MCP to look up React Server Components data fetching.
Ask the client to include source URLs when you need to inspect the supporting documentation.
Use the Claude Code command
​
The Claude Code plugin provides this command:
/algolia-docsearch:docs <library-or-product> [topic]
For example:
/algolia-docsearch:docs Next.js middleware matcher
/algolia-docsearch:docs Stripe webhook signature verification
/algolia-docsearch:docs Algolia InstantSearch React configure search client
Search from the terminal
​
@docsearch/cli
can call the hosted MCP tools without a separate MCP client. Use
docs
for most questions:
docsearch docs Next.js "how do middleware matchers work"
Limit the number of results or documentation sets when needed:
docsearch docs Next.js "cache revalidation" --max-results 3 --max-docsets 2
For explicit documentation-set selection, resolve a product and then query its returned ID:
docsearch resolve "Algolia InstantSearch React"
docsearch query repo/algolia/instantsearch "configure the React search client"
Limit resolver candidates with
--top-n
:
docsearch resolve Next.js --top-n 3
Add
--json
to print the raw MCP result as JSON:
docsearch docs Next.js "cache revalidation" --json
Machine-readable results go to standard output. Progress and errors go to standard error.
Choose a tool workflow
​
DocSearch MCP provides a one-shot search and a two-step search. Use natural-language questions rather than lists of keywords.
Search in one call
​
Use
algolia_docsearch_search_docs
for most questions. Keep the product name in
library
and the question in
query
:
{
"library"
:
"Next.js"
,
"query"
:
"how do middleware matchers work"
}
The tool resolves the best documentation set and returns ranked content. If
library
doesn't identify a clear match, it returns candidate sets instead of searching the wrong one.
Resolve and query documentation sets
​
Use the two-step workflow when the product is ambiguous, you want to inspect the candidates, or the question covers multiple products.
Call
algolia_docsearch_resolve_docset
with the product or platform name:
{
"query"
:
"Next.js app router"
}
Select the best
docset_id
from the response.
Call
algolia_docsearch_query_docs
with the selected ID and a focused question:
{
"query"
:
"middleware matcher configuration"
,
"docsetIds"
:
[
"nextjs"
]
}
Pass more than one
docsetIds
value when the question covers multiple products. Don't guess IDs. Use only IDs returned by
algolia_docsearch_resolve_docset
or
algolia_docsearch_search_docs
.
Troubleshooting
​
The client doesn't call DocSearch MCP
​
Confirm that the server is enabled and named
algolia-docsearch
. If you installed a plugin, confirm that the plugin is enabled. Then ask the client to use DocSearch MCP explicitly.
The client can't connect
​
Confirm that the client supports remote HTTP MCP servers and uses this exact HTTPS URL:
https://mcp.algolia.com/1/docsearch/mcp
The public endpoint doesn't require authentication. Remove application IDs, API keys, headers, or authentication settings that the client doesn't require.
CLI setup doesn't detect an agent
​
Pass the agent flag directly, or use
--all
with the setup command from the
installation guide
.
docsearch setup --project --cursor --yes
docsearch setup --global --all --yes
Supported flags are
--cursor
,
--claude
,
--codex
,
--opencode
, and
--gemini
.
CLI setup reports an invalid configuration
​
Fix the reported JSON, JSONC, or TOML error before running setup again. The CLI stops instead of replacing an invalid configuration. It also rejects duplicate
[mcp_servers.algolia-docsearch]
sections in Codex configuration.
The result covers the wrong product
​
Use the official product or vendor name. For example, use
Algolia InstantSearch
instead of
search
. If the name remains ambiguous, resolve the documentation set first and query the selected ID.
The result is too broad or empty
​
Add the product version and narrow the question to one task. Run separate searches for unrelated topics. If a narrower search still returns no useful content, the requested documentation might not be in the public DocSearch corpus.
Private documentation isn't returned
​
DocSearch MCP searches public developer documentation only. It doesn't search private company docs, internal repositories, or unpublished APIs.
Edit this page
Last updated
on
Aug 6, 2026
by
Paul Jankowski
Previous
Installation
Next
Create a new crawler
Use the Claude Code command
Search from the terminal
Choose a tool workflow
Search in one call
Resolve and query documentation sets
Troubleshooting
The client doesn't call DocSearch MCP
The client can't connect
CLI setup doesn't detect an agent
CLI setup reports an invalid configuration
The result covers the wrong product
The result is too broad or empty
Private documentation isn't returned
Docs
Getting Started
FAQ
DocSearch v3
DocSearch v4
DocSearch v5
DocSearch
Sign up
Issues
Privacy
Community
Discord
Social
GitHub
Twitter
Algolia Blog
DOCSEARCH
by
2015–2026 — Built with
♥
by Algolia
