Adverso
Browse all topics

Plain HTTP

Talk to the server from your own code, without an MCP library.

The server speaks the Model Context Protocol over ordinary HTTP. You send a JSON-RPC message with POST and get JSON back. There is no session to keep and no stream to hold open, so any HTTP client will do.

https://pcaaxwkkddgzmgptngdb.supabase.co/functions/v1/mcp
MethodPOST
Bodyone JSON-RPC 2.0 message, or a list of them
HeaderAuthorization: Bearer YOUR_API_KEY and Content-Type: application/json
Answerapplication/json
Protocol versions2025-06-18, 2025-03-26, 2024-11-05

A session in three requests

1. Say hello
curl -s https://pcaaxwkkddgzmgptngdb.supabase.co/functions/v1/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"my-app","version":"1.0"}}}'

The answer names the protocol version, the server, and a short instruction text for the AI. An MCP client then sends the notification notifications/initialized; the server answers it with 202 and no body. You can skip it.

2. List the tools
curl -s https://pcaaxwkkddgzmgptngdb.supabase.co/functions/v1/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'

Returns every tool with its description and the JSON Schema of its input. This is the same list as the Tool reference.

3. Call a tool
curl -s https://pcaaxwkkddgzmgptngdb.supabase.co/functions/v1/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_campaigns","arguments":{"date_from":"2026-11-11","date_to":"2026-11-17","limit":5}}}'

What a tool call returns

The result follows the MCP shape: a content list with one text item. That text is itself JSON, so parse it once more.

Example
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [
      { "type": "text", "text": "{\"level\":\"campaign\",\"ad_type\":\"SP\",\"total_rows\":212,\"rows\":[...]}" }
    ]
  }
}

When a tool cannot answer, the result has "isError": true and the text is a sentence that says what to change. See Limits and errors.

Notes for implementers

  • Stateless. Every request stands alone. You do not have to call initialize before tools/call.
  • Batches. Send a list of messages and you get a list of answers.
  • No server-sent events. A GET is answered with 405. The server never pushes messages.
  • CORS is open, so a browser can call it. Do not put a key in a public web page.