# MCP

> The MCP server your coding agent talks to: one endpoint, JSON-RPC over HTTP, the same key as every other route.

`POST /v1/mcp` is the Model Context Protocol server of Rytiv (Streamable HTTP, protocol revision 2026-07-28). Every JSON-RPC message is its own POST; a request is answered with `application/json`, a notification with `202` and no body. There are no sessions. `GET`, `PUT`, `PATCH` and `DELETE` on the path answer `405`.

The tools it offers are on [MCP tools](https://docs.rytiv.com/reference/mcp-tools.md), generated from the server's own table. To connect an agent, see the [quickstart](https://docs.rytiv.com/quickstart.md); a client that cannot carry a key connects through [OAuth](https://docs.rytiv.com/reference/api/oauth.md).

## Endpoints

- [`POST /v1/mcp`](#post-v1mcp): The MCP endpoint: a JSON-RPC message in, its answer out

## POST /v1/mcp

The MCP endpoint: a JSON-RPC message in, its answer out.

**Auth:** API key with full access (a key with scopes cannot call this route). For an agent token, the tool inside the call decides.

### Example request

```bash
curl -X POST "https://api.rytiv.app/v1/mcp" \
  -H "Authorization: Bearer $RYTIV_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```

### Response

`202` (accepted, the work continues) with a JSON body.

### Errors

| Status | Code | Meaning |
| --- | --- | --- |
| 401 | `unauthenticated` | No API key, or one that does not work. |
| 403 | `token-scope` | The key's scopes do not cover this route. |
