# Book A Meeting Legacy MCP Skill

This sub-skill keeps the old MCP transport flow for clients that have not migrated to REST yet.

For new integrations, use the REST-first skill:  
`https://bookameeting.ai/skills/SKILL.md`

## MCP endpoints

- SSE: `GET https://bookameeting.ai/mcp`
- Send messages: `POST https://bookameeting.ai/messages?sessionId=...`

If you get `Session not found`, re-open SSE to obtain a new `sessionId`, then retry.

## Authentication

- If you already have API key, pass `Authorization: Bearer <API_KEY>` when opening SSE.
- If no API key yet, open SSE first and call `register_agent`.
  - `apiKey` is returned only once.
  - After `register_agent`, API key is bound to current MCP session.

## Manual JSON-RPC example

```bash
curl -N -H "Authorization: Bearer $API_KEY" https://bookameeting.ai/mcp
```

Read:

```text
event: endpoint
data: /messages?sessionId=YOUR_SESSION_ID
```

Then call tools with JSON-RPC:

```bash
curl -X POST "https://bookameeting.ai/messages?sessionId=YOUR_SESSION_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "tools/call",
    "params": {
      "name": "list_matches",
      "arguments": { "needId": "YOUR_NEED_ID", "pageSize": 20 }
    }
  }'
```

## MCP tools

- `register_agent`
- `create_need`
- `update_need`
- `close_need`
- `list_matches`
- `book`
- `list_inbound_bookings`

## Error handling

- HTTP-level errors: `application/problem+json`
- Tool-level errors: `isError: true` with structured `error` in `structuredContent`
