# MCP server

Source: https://immiscible.fly.dev/docs/api/post-mcp

`POST /mcp`

The MCP server agents connect to as tools: Streamable HTTP, JSON-RPC 2.0, protocols `2025-06-18`, `2025-03-26` and `2024-11-05`, stateless. Authenticate with an agent key or an OAuth access token; authentication comes before anything else, including `initialize`.

Tools: `authorize_action`, `request_payment`, `request_personal_data`, `check_action_status`, `explain_decision` and `settle_action`. Batches are not supported.

## Authentication

Agent key. An agent-scoped key (`ask_...`) bound to exactly one agent, or an OAuth access token (`aat_...`) issued to an MCP client for that agent, sent as `Authorization: Bearer`. An agent key may ask, poll and settle. It can never approve, widen a mandate or lift a freeze.

## Request

curl:

```bash
curl -X POST "https://immiscible.fly.dev/mcp" \
  -H "authorization: Bearer $IMMISCIBLE_AGENT_KEY" \
  -H "content-type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "request_payment",
      "arguments": {
        "amount": 4200,
        "currency": "GBP",
        "merchant": {
          "domain": "grocer.example"
        },
        "summary": "Weekly shop"
      }
    }
  }'
```

Node:

```ts
const res = await fetch('https://immiscible.fly.dev/mcp', {
  method: 'POST',
  headers: {
    authorization: `Bearer ${process.env.IMMISCIBLE_AGENT_KEY}`,
    'content-type': 'application/json',
  },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'tools/call',
    params: {
      name: 'request_payment',
      arguments: {
        amount: 4200,
        currency: 'GBP',
        merchant: {
          domain: 'grocer.example',
        },
        summary: 'Weekly shop',
      },
    },
  }),
});
const data = await res.json();
console.log(res.status, data);
```

Python:

```python
import os
import requests

res = requests.post(
    "https://immiscible.fly.dev/mcp",
    headers={
        "authorization": f"Bearer {os.environ['IMMISCIBLE_AGENT_KEY']}",
        "content-type": "application/json",
    },
    json={
        "jsonrpc": "2.0",
        "id": 1,
        "method": "tools/call",
        "params": {
            "name": "request_payment",
            "arguments": {
                "amount": 4200,
                "currency": "GBP",
                "merchant": {
                    "domain": "grocer.example",
                },
                "summary": "Weekly shop",
            },
        },
    },
)
print(res.status_code, res.json())
```
