MCP Server
Connect an AI assistant to your Search API account and manage it in plain language — create models, set up APIs and endpoints, deploy versions and hand out API keys without opening the admin panel.
The Model Context Protocol (MCP) is an open standard that lets AI assistants call external tools. Search API runs an MCP server that exposes the same actions you perform in the admin panel as tools. When you ask your assistant to "create a products model with a name and a price", it calls the matching tool on your behalf.
What You Can Do
-
Models — create models, add or update fields, set relations and required flags.
-
APIs & versions — create APIs, create new versions, deploy and track deploy progress.
-
Endpoints — connect models to API versions, choose HTTP methods, aggregations and field boosts.
-
API keys — create keys and grant or revoke access to endpoints.
-
Company & team — update company info and manage team members.
See the MCP Tools Reference for every tool and its parameters. There are intentionally no tools that delete models, APIs, endpoints or API keys — only a single model field can be deleted.
Create a Personal Access Token
The MCP server authenticates you with a personal access token. This is different from an API key: an API key queries your deployed endpoints, a personal access token acts as you in the admin panel.
Open MCP Access
In the admin panel, open the user menu and go to My Account → MCP Access.
Create a token
Click New Token and give it a name that tells you where it is used (e.g. Laptop – Claude Code).
Copy it right away
The token starts with sap_pat_ and is shown only once. If you lose it,
revoke it and create a new one.
Connection Settings
Any MCP client that supports the Streamable HTTP transport and lets you set a custom HTTP header can connect. These are the only three values you need:
| Setting | Value |
|---|---|
| Server URL | https://searchapi.net/mcp |
| Transport | Streamable HTTP (sometimes labelled http) |
| Header | Authorization: Bearer sap_pat_YOUR_TOKEN |
Test the connection with curl
Send an initialize request. A valid token returns 200 and an
Mcp-Session-Id response header:
curl -i https://searchapi.net/mcp \
-H "Authorization: Bearer sap_pat_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {
"protocolVersion": "2025-06-18", "capabilities": {},
"clientInfo": {"name": "curl", "version": "1.0"} } }'
Send the session id back on every following request, then list the available tools:
curl https://searchapi.net/mcp \
-H "Authorization: Bearer sap_pat_YOUR_TOKEN" \
-H "Mcp-Session-Id: SESSION_ID_FROM_ABOVE" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc": "2.0", "method": "notifications/initialized"}'
curl https://searchapi.net/mcp \
-H "Authorization: Bearer sap_pat_YOUR_TOKEN" \
-H "Mcp-Session-Id: SESSION_ID_FROM_ABOVE" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc": "2.0", "id": 2, "method": "tools/list"}'
Client Setup
Ready-to-use configuration for popular clients. Replace sap_pat_YOUR_TOKEN with your token.
Client configuration formats change often — if a snippet no longer works, check the client's own MCP
documentation linked under each one. Last verified: October 2026.
Claude Code
claude mcp add --transport http searchapi https://searchapi.net/mcp \
--header "Authorization: Bearer sap_pat_YOUR_TOKEN"
Cursor
Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project):
{
"mcpServers": {
"searchapi": {
"url": "https://searchapi.net/mcp",
"headers": {
"Authorization": "Bearer sap_pat_YOUR_TOKEN"
}
}
}
}
VS Code (GitHub Copilot)
Add to .vscode/mcp.json in your workspace:
{
"servers": {
"searchapi": {
"type": "http",
"url": "https://searchapi.net/mcp",
"headers": {
"Authorization": "Bearer sap_pat_YOUR_TOKEN"
}
}
}
}
Gemini CLI
Add to ~/.gemini/settings.json:
{
"mcpServers": {
"searchapi": {
"httpUrl": "https://searchapi.net/mcp",
"headers": {
"Authorization": "Bearer sap_pat_YOUR_TOKEN"
}
}
}
}
Or from the command line:
gemini mcp add --transport http searchapi https://searchapi.net/mcp \
-H "Authorization: Bearer sap_pat_YOUR_TOKEN"
Codex CLI
Add to ~/.codex/config.toml and keep the token in an environment variable:
[mcp_servers.searchapi]
url = "https://searchapi.net/mcp"
bearer_token_env_var = "SEARCHAPI_MCP_TOKEN"
export SEARCHAPI_MCP_TOKEN="sap_pat_YOUR_TOKEN"
Grok CLI
grok mcp add --transport http searchapi https://searchapi.net/mcp \
--header "Authorization: Bearer sap_pat_YOUR_TOKEN"
Claude Desktop
mcp-remote (requires
Node.js). This is not officially supported.
Add to claude_desktop_config.json:
{
"mcpServers": {
"searchapi": {
"command": "npx",
"args": [
"mcp-remote",
"https://searchapi.net/mcp",
"--header",
"Authorization:${AUTH_HEADER}"
],
"env": {
"AUTH_HEADER": "Bearer sap_pat_YOUR_TOKEN"
}
}
}
}
Your own agent (API)
If you build your own agent, LLM APIs with a remote MCP feature can call the server directly. For example, with the Anthropic Messages API:
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: mcp-client-2025-11-20" \
-H "content-type: application/json" \
-d '{
"model": "claude-opus-5-5",
"max_tokens": 4096,
"mcp_servers": [{
"type": "url",
"url": "https://searchapi.net/mcp",
"name": "searchapi",
"authorization_token": "sap_pat_YOUR_TOKEN"
}],
"tools": [{"type": "mcp_toolset", "mcp_server_name": "searchapi"}],
"messages": [{"role": "user", "content": "List my models"}]
}'
The OpenAI Responses API (mcp tool with headers) and the xAI API
(remote MCP tool with authorization) work the same way.
Unsupported Clients
Security
-
Tools run with your role. Team member tools, for example, only work for managers — exactly as in the admin panel.
-
Every tool is limited to your company; other companies' data is never visible.
-
Tokens are stored hashed and can never be displayed again after creation.
-
A token stops working as soon as it is revoked or its owner is deactivated. The MCP Access page shows when each token was last used.
-
Some actions cannot be undone, such as setting the subdomain or deploying a version. Assistants are instructed to confirm these with you first — review them before approving.
Troubleshooting
| Error | Cause |
|---|---|
401 with invalid_token |
The token is missing, mistyped, revoked or expired, or your user is deactivated. Check the
Authorization header format and create a new token if needed.
|
| Client asks you to sign in with OAuth | The client did not send the header. Check that the header is set in its configuration. |
| You do not have permission to perform this action. | Your role does not allow this tool (e.g. team member tools require manager access). |
| Not found. | The id does not exist or belongs to another company. Ask the assistant to list the items first. |
| Validation message from a tool | The request broke the same rule the admin panel enforces (e.g. editing a model already connected to an endpoint). The assistant sees the message and can usually correct itself. |