Tools
MCP
Connect MCP-compatible agents to Melious tools over the Model Context Protocol
Melious speaks the Model Context Protocol, so an MCP-compatible client — Claude Desktop, a custom agent, anything that talks the protocol — can discover and run our tools without any Melious-specific glue. It's the same tools as the Tools API, reached over MCP instead of plain REST.
Base path: /v1/mcp
Auth: Bearer token or x-api-key. Requires scope kit.mcp.
Two transports
- JSON-RPC (
POST /v1/mcp/jsonrpc) — the standard MCP transport. This is what MCP clients expect; use it unless you have a reason not to. - REST (
/v1/mcp/initialize,/v1/mcp/tools/list,/v1/mcp/tools/call) — a plain-HTTP convenience surface for hand-rolled clients that don't want to wrap JSON-RPC.
Both expose the same tools and return the same content shapes. The endpoints:
| Method | Path | What it does |
|---|---|---|
POST | /v1/mcp/jsonrpc | JSON-RPC 2.0 transport (initialize, tools/list, tools/call, ping) |
POST | /v1/mcp/initialize | REST: start a session |
POST | /v1/mcp/tools/list | REST: list tools |
POST | /v1/mcp/tools/call | REST: run a tool |
GET | /v1/mcp/ping | Health check |
Connect Claude Desktop
Claude Desktop connects to a remote MCP server through the mcp-remote bridge, which handles the transport and forwards your auth header. Add this to your config:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"melious": {
"command": "npx",
"args": [
"-y", "mcp-remote",
"https://api.melious.ai/v1/mcp/jsonrpc",
"--header", "Authorization:${AUTH_HEADER}"
],
"env": {
"AUTH_HEADER": "Bearer sk-mel-<YOUR_API_KEY>"
}
}
}
}No space after the colon in args — Claude Desktop on Windows mangles arguments that contain spaces, so the value with the space lives in env.
Your API key sits in this file in plaintext. Don't commit it. Treat the config like any other secret-bearing dotfile.
Restart Claude Desktop and the Melious tools show up in its tool list. The Claude Desktop guide covers this alongside the larger option — pointing Desktop's own inference at Melious through its third-party gateway mode.
JSON-RPC transport
Standard JSON-RPC 2.0. List the tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list",
"params": {}
}Call one:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "web-search",
"arguments": { "query": "Hanseatic League history" }
}
}The result wraps tool output in MCP content blocks:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"content": [{ "type": "text", "text": "[{\"title\": \"...\", \"url\": \"...\"}]" }],
"isError": false
}
}A failed call uses the same shape with isError: true and the message as the text block; the HTTP status stays 201.
initialize and ping work as the spec describes. initialize takes protocolVersion, capabilities, and clientInfo, and returns the server's capabilities and serverInfo.
REST transport
If you'd rather not wrap JSON-RPC, the REST endpoints do the same work with the same field names:
curl https://api.melious.ai/v1/mcp/initialize \
-H "Authorization: Bearer sk-mel-<YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"protocolVersion": "2024-11-05",
"capabilities": { "tools": {} },
"clientInfo": { "name": "my-agent", "version": "1.0.0" }
}'List and call follow the same pattern. POST /v1/mcp/tools/list (optional {"cursor": "..."} for pagination) returns {"tools": [{"name", "description", "inputSchema"}]}. POST /v1/mcp/tools/call takes {"name", "arguments"} and returns {"content", "isError"}.
curl https://api.melious.ai/v1/mcp/tools/call \
-H "Authorization: Bearer sk-mel-<YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"name": "web-search", "arguments": {"query": "Hanseatic League history"}}'Available tools
The same tools as the Tools API — web search, URL scraping, code execution, image generation, and the utility tools. The chat-only tools (search-knowledge, describe-images, transcribe-audio) are listed but return an error result outside a chat. Call tools/list for the live set with current schemas. Document conversion isn't exposed over MCP; it takes file uploads, which the protocol's JSON tool-call shape doesn't carry.
Errors
Three things fail at the HTTP level, with the flat Melious error body {"code", "message", "request_id"}:
code | Status | When |
|---|---|---|
AUTH_1007 | 401 | No API key. |
AUTH_1015 | 403 | The key lacks the kit.mcp scope. |
VALIDATION_4002 | 400 | REST tools/call without name. |
Everything else is a protocol-level result, not an HTTP error:
- A tool that doesn't exist, bad arguments, a rate limit, an empty balance, or a tool that fails while running all come back as a normal
tools/callresult withisError: trueand the message incontent[0].text. The HTTP status is201. - Over JSON-RPC, an unknown method returns
{"error": {"code": -32601, "message": "Method not found: …"}}; a failure ininitialize,tools/list, orpingreturns{"error": {"code": -32000, "message": …}}. There is nodatamember. A notification (a request withoutid) gets202with an empty body.
Related
Tools API for the same tools over plain REST • Tool calling for letting a chat model drive tools directly.