> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onerep.life/llms.txt
> Use this file to discover all available pages before exploring further.

# OneRep MCP: Connect Any MCP-Compatible AI Assistant

> Connect any MCP-compatible AI assistant to your OneRep training and nutrition log using streamable HTTP, JSON-RPC 2.0, and your existing API keys.

OneRep speaks the [Model Context Protocol](https://modelcontextprotocol.io), which lets an AI assistant read your training and nutrition log and — if you allow it — add to it. You use the same API keys, the same scopes, and the same rate limits as the REST API, so there is nothing new to provision. The endpoint is a single `POST` URL that your assistant calls to discover tools and invoke them.

## Endpoint and protocol

Your MCP endpoint is:

```
POST https://<your-convex-deployment>.convex.site/mcp
```

Find your exact URL under **Settings → API & MCP** in the app. Copy it from there — do not assemble it by hand.

| Property         | Value                                                    |
| ---------------- | -------------------------------------------------------- |
| Transport        | Streamable HTTP                                          |
| Message format   | JSON-RPC 2.0                                             |
| Protocol version | `2025-06-18`                                             |
| Auth             | Bearer API key, or OAuth 2.1 for clients that support it |

## Authentication

Pass your API key as a bearer token in every request:

```
Authorization: Bearer onerep_sk_…
```

You create and manage keys under **Settings → API & MCP**. Each key is either **Read only** (scope: `read`) or **Read & write** (scope: `write`). Scopes, rate limits, and key management work the same way here as they do for the REST API.

<Note>
  A read-only token lists only 5 tools — the read tools. The 6 write tools are hidden from it entirely, and calling one directly is refused. If `tools/list` returns only 5 entries, you have a read-only token. Create a read & write token to unlock all 11 tools.
</Note>

## Connecting an AI assistant

<Tabs>
  <Tab title="Claude Code">
    Run this command once to register OneRep as an MCP server. Replace the URL with your deployment URL and the key with your API key.

    ```sh theme={null}
    claude mcp add --transport http onerep https://<deployment>.convex.site/mcp \
      --header "Authorization: Bearer onerep_sk_…"
    ```
  </Tab>

  <Tab title="JSON config">
    Add this block to your MCP client's configuration file. Replace the URL and key with your own values.

    ```json theme={null}
    {
      "mcpServers": {
        "onerep": {
          "type": "http",
          "url": "https://<deployment>.convex.site/mcp",
          "headers": { "Authorization": "Bearer onerep_sk_…" }
        }
      }
    }
    ```
  </Tab>
</Tabs>

## Quick connection test

To confirm the endpoint is reachable and your token is valid, call `tools/list` directly:

```sh theme={null}
curl -s https://<deployment>.convex.site/mcp \
  -H "Authorization: Bearer onerep_sk_…" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | jq
```

A working response lists the tools available to your token. A missing or revoked token returns a `401` with a `WWW-Authenticate` header — it does not return an empty list — so a misconfigured client will tell you immediately rather than silently appearing to be an empty account.
