algolia_snippets_list_operations to find the operation for a task, then calls algolia_snippets_get_snippet with the language and client version to fetch the code.
Snippets cover all Algolia APIs, including Search, Analytics, Recommend, Insights, and Ingestion, in every API client language.
DevEx MCP doesn’t require you to sign in, and it doesn’t access data in your Algolia applications.
To search or analyze your indices from an AI assistant, pick a server in the MCP overview.
The examples on this page use JavaScript API client v5, Python API client v4, and Go API client v4.
If your project pins another version, name it in the prompt so the agent fetches the matching snippet.
Before you begin
To use DevEx MCP, make sure you have:- An Algolia account with an Application ID and API keys.
- A coding agent that supports remote MCP, such as Claude Code, Cursor, VS Code, Gemini CLI, ChatGPT, or Claude.
- A project where you want to add search, indexing, or both.
Connect from your MCP client
Add DevEx MCP as a remote HTTP server. You don’t sign in, and you don’t need an OAuth client ID or secret.- Claude Code
- Cursor
- VS Code
- Gemini CLI
- ChatGPT
- Claude AI & Desktop
Add Algolia to your app
Connect DevEx MCP, then tell the agent the language, the client version, and where credentials live. If you skip the version, agents often useinitIndex, which the JavaScript API client removed in v5.
Prompt
- “Show how to save records with the JavaScript API client v5.”
- “Get a Python v4 snippet for searching an index with filters.”
- “Return a Go v4 snippet for
setSettingswith searchable attributes and custom ranking.” - “Create a search-only API key with the C# API client.”
indexName with your index name, and swap demo records for your schema.
Store credentials
Create an environment file for local development. Use a Write API key for indexing and settings. Use a Search API key in the browser or any other client you don’t control..env.local
Initialize the API client
For example: “Initialize the Algolia API client in this language, matching the installed version.”SearchClientSync is the synchronous client.
In an asynchronous context, use SearchClient instead. It exposes the same methods, awaited.
For a search-only JavaScript bundle, import liteClient from algoliasearch/lite and alias it as algoliasearch.
The lite client can search, but it can’t index records or change settings.
JavaScript
Update index settings
For example: “Set searchable attributes, facets, and custom ranking on INDEX_NAME withsetSettings.”
Update settings before the first saveObjects call.
Changing searchable attributes later reindexes existing records.
Save records
For example: “Save these product records to INDEX_NAME withsaveObjects and wait for the task.”
saveObjects batches writes for you.
Pass waitForTasks: true so you don’t search before indexing finishes.
objectID.
Reuse the same objectID to update a record in place.
For bulk imports, keep saveObjects instead of writing your own batch loop, unless you need a custom batch size.
See Save records.
Search an index
For example: “Search INDEX_NAME for trail shoes that are in stock, using searchSingleIndex.” Use a client initialized withALGOLIA_SEARCH_API_KEY for this call.
filters only works on attributes listed in attributesForFaceting.
If a filter doesn’t return any hits, check that setting first.
For one request across several indices, use search instead of searchSingleIndex.
Restrict API keys
For example: “Create a search-only API key restricted to INDEX_NAME.” Creating keys requires an Admin API key. Run this on a server.JavaScript
Other Algolia tools
DevEx MCP writes API client calls. It doesn’t generate InstantSearch widgets, and it doesn’t query analytics on your account.Guidelines
- Name the version. Point the agent at
package.json,pyproject.toml,go.mod, or the lock file. - Treat snippets as starting code. OpenAPI samples often use placeholder names and demo records. Replace them with yours.
- Keep write operations on the server. Search API keys belong in the frontend. Write and Admin API keys don’t.
- Wait for indexing tasks. Don’t search records you just saved until the task finishes.
- Read the diff. If a method doesn’t exist on the installed client, reject it and ask the agent to fetch the snippet again.
See also
- Install the API clients
algolia-migrationskill for upgrading an API client across a major version