MCP servers
Every model and tool in the aixplain Marketplace is also a hosted MCP server that any MCP client can call with your API key.
The Marketplace has 1,000+ models, tools and integrations. You need no server setup and no separate account with each provider.
Find the asset
Each server URL ends with an asset path or asset ID. Copy it from the asset's card in the Marketplace, or search with the SDK:
from aixplain import Aixplain
aix = Aixplain(api_key="YOUR_API_KEY")
page = aix.Tool.search(query="tavily", page_size=3)
for tool in page.results:
print(tool.id, tool.path)
To search the Marketplace from inside your MCP client, add the Marketplace search tool as a server: https://models-mcp.aixplain.com/mcp/6960f934f316da19e5f22494.
Build the server URL
https://models-mcp.aixplain.com/mcp/<ASSET_ID_OR_ENCODED_PATH>
| Form | Example |
|---|---|
| URL-encoded asset path (recommended) | https://models-mcp.aixplain.com/mcp/openai%2Fgpt-5.4%2Fopenai |
| Asset ID | https://models-mcp.aixplain.com/mcp/69b7e5f1b2fe44704ab0e7d0 |
| Raw asset path | https://models-mcp.aixplain.com/mcp/openai/gpt-5.4/openai |
Paths with underscores in place of slashes do not resolve.
Add the server to your client
Every request needs two headers: Authorization: Bearer YOUR_API_KEY and Accept: application/json, text/event-stream.
Clients that accept a URL
Claude Code, VS Code and current versions of Cursor connect to the URL directly. Add one entry per asset to the client's MCP settings, such as .cursor/mcp.json for Cursor:
{
"mcpServers": {
"gpt_5_4": {
"url": "https://models-mcp.aixplain.com/mcp/openai%2Fgpt-5.4%2Fopenai",
"headers": {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json, text/event-stream"
}
}
}
}
In Claude Code, add the same server from the terminal:
claude mcp add --transport http gpt_5_4 https://models-mcp.aixplain.com/mcp/openai%2Fgpt-5.4%2Fopenai \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Accept: application/json, text/event-stream"
Clients that need a command
Claude Desktop reads only command servers from claude_desktop_config.json. Bridge the URL with mcp-remote, which needs Node.js 18 or later:
{
"mcpServers": {
"gpt_5_4": {
"command": "npx",
"args": [
"-y", "mcp-remote",
"https://models-mcp.aixplain.com/mcp/openai%2Fgpt-5.4%2Fopenai",
"--header", "Authorization:${AUTH_HEADER}"
],
"env": {
"AUTH_HEADER": "Bearer YOUR_API_KEY"
}
}
}
}
Keep the key in env: a space inside an args entry breaks mcp-remote. Restart Claude Desktop after you save the file.
Test the connection
Check the server from a terminal with tools/list:
curl -s https://models-mcp.aixplain.com/mcp/tavily%2Ftavily-web-search%2Ftavily \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json, text/event-stream" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}'
Responses arrive as server-sent events. In your own client, read the data: line, list the tools to get the exact tool name, then call it:
import json
import httpx
HEADERS = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json, text/event-stream",
"Content-Type": "application/json",
}
def mcp_call(endpoint, method, params=None):
response = httpx.post(
endpoint,
headers=HEADERS,
json={"jsonrpc": "2.0", "id": 1, "method": method, "params": params or {}},
timeout=60,
)
line = next(l for l in response.text.splitlines() if l.startswith("data:"))
return json.loads(line[5:])
endpoint = "https://models-mcp.aixplain.com/mcp/openai%2Fgpt-5.4%2Fopenai"
tool = mcp_call(endpoint, "tools/list")["result"]["tools"][0]
print(tool["name"], tool["inputSchema"]["required"])
result = mcp_call(endpoint, "tools/call", {"name": tool["name"], "arguments": {"text": "What is the capital of France?"}})
print(result["result"]["content"][0]["text"])
The same helper calls a tool. Tool names and inputs differ per asset, so always list first:
endpoint = "https://models-mcp.aixplain.com/mcp/tavily%2Ftavily-web-search%2Ftavily"
tool = mcp_call(endpoint, "tools/list")["result"]["tools"][0]
print(tool["name"], tool["inputSchema"]["required"])
result = mcp_call(endpoint, "tools/call", {"name": tool["name"], "arguments": {"query": "Model Context Protocol specification", "num_results": 2}})
print(result["result"]["content"][0]["text"][:300])
Use several assets
Add one server per asset, each under its own key. Your client picks the server that fits each task.
{
"mcpServers": {
"gpt_5_4": {
"url": "https://models-mcp.aixplain.com/mcp/openai%2Fgpt-5.4%2Fopenai",
"headers": {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json, text/event-stream"
}
},
"whisper_large": {
"url": "https://models-mcp.aixplain.com/mcp/66311fda6eb563279c574b71",
"headers": {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json, text/event-stream"
}
},
"tavily_search": {
"url": "https://models-mcp.aixplain.com/mcp/tavily%2Ftavily-web-search%2Ftavily",
"headers": {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json, text/event-stream"
}
}
}
}
Errors
| Symptom | Cause | Fix |
|---|---|---|
HTTP 406, Not Acceptable | The Accept header is missing | Send Accept: application/json, text/event-stream |
HTTP 500, Internal server error | The Authorization header is missing | Send Authorization: Bearer YOUR_API_KEY on every request |
JSON-RPC error -32603, upstream status 403 | The API key is wrong or revoked | Create a key in the aixplain app |
JSON-RPC error -32603, upstream status 400 | The asset path or ID does not exist, or uses underscores | Copy the path from the Marketplace and URL-encode the slashes |
Next steps
- Marketplace search: find assets by keyword from an agent or MCP client.
- REST API: call the same models and tools over plain HTTP.
- Remote MCP: connect an external MCP server to an aixplain agent.