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

# MCP Reference

> Complete tool reference, input schemas, scopes, and JSON-RPC specifications for Posttu's first-party Model Context Protocol (MCP) server.

The **Model Context Protocol (MCP)** server allows AI assistants, autonomous agents, and IDEs to interact directly with your Posttu workspace. The MCP server is available at:

```text theme={null}
https://posttu.com/api/v1/mcp
```

***

## Tool Suites Overview

Posttu's MCP server exposes **679 tools** grouped into three specialized suites:

| Tool Suite | Count | Purpose | Authentication |
| :- | :- | :- | :- |
| **[Core Workspace Tools](https://docs.posttu.com/mcp-reference/core/posts.md)** | 53 tools | Manage posts, calendars, unified inbox threads, workflows, and workspace tags. | Developer API Key or OAuth 2.1 token |
| **[Connected Platform Tools](https://docs.posttu.com/mcp-reference/platforms/mastodon.md)** | 462 tools | Native channel operations on 18 connected platforms (Instagram, TikTok, YouTube, Fanvue, etc.). | Scoped API Key / OAuth token + Connected Channel |
| **[Public Scrapers](https://docs.posttu.com/mcp-reference/scrapers/overview.md)** | 164 tools | Public, unauthenticated extraction across 27+ social networks (profiles, transcripts, metrics). | Developer API Key or OAuth 2.1 token |

Tools returned by `tools/list` are automatically filtered to the caller's authorized scopes and paginated (`cursor` / `nextCursor`, 100 tools per page).

***

## JSON-RPC 2.0 Calling Protocol

All MCP tool invocations use the standard JSON-RPC 2.0 `tools/call` method sent via HTTP POST to `/api/v1/mcp`:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "list_posts",
    "arguments": {
      "limit": 10
    }
  }
}
```

### Successful Response Format

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "[{\"id\":\"pst_123\",\"content\":\"Draft post\",\"status\":\"DRAFT\"}]"
      }
    ],
    "structuredContent": {
      "data": [
        { "id": "pst_123", "content": "Draft post", "status": "DRAFT" }
      ]
    }
  }
}
```

***

## Protocol Transports & Versions

Posttu implements **stateless Streamable HTTP** powered by the official Model Context Protocol SDK across two supported protocol eras:

1. **Modern Streamable HTTP (`2026-07-28`)**: Stateless JSON-RPC HTTP `POST` requests to `/api/v1/mcp` with `MCP-Protocol-Version: 2026-07-28`, `Accept: application/json, text/event-stream`, and `Authorization: Bearer <token>`. Supports `server/discover`, per-request `_meta`, header mirroring, and native **MCP Skills** (`skills/list`, `skills/get`).
2. **Backwards-Compatible Streamable HTTP (`2025-11-25`)**: Stateless JSON-RPC HTTP `POST` requests with `initialize` handshake and `MCP-Protocol-Version: 2025-11-25`.

***

## Authentication & Authorization

Every request requires valid credentials passed in the HTTP `Authorization` header:

```http theme={null}
Authorization: Bearer <POSTTU_API_KEY_OR_OAUTH_TOKEN>
```

* **Developer API Keys**: Generated in **Dashboard → Settings → API Keys** (recommended for IDEs and scripts).
* **OAuth 2.1 Access Tokens**: Acquired dynamically via the RFC 9728 Protected Resource Metadata endpoint at `/.well-known/oauth-protected-resource/api/v1/mcp`.

***

## Protocol Error Codes

When a request fails, the server returns standard HTTP Bearer challenges (`401` / `403` with `WWW-Authenticate`) or JSON-RPC protocol error codes:

| Error Code | Constant | Meaning | Recovery Action |
| :- | :- | :- | :- |
| **`-32020`** | `HeaderMismatch` | Header values (`Mcp-Method`, `Mcp-Name`) do not match the request body. | Ensure mirrored HTTP headers match the JSON-RPC request body. |
| **`-32021`** | `MissingCapability` | Client attempted an operation unsupported by declared client capabilities. | Declare required client capabilities in `_meta` or during `initialize`. |
| **`-32022`** | `UnsupportedProtocolVersion` | Requested protocol version is not supported. | Use protocol version `2026-07-28` or `2025-11-25`. |
| **`-32601`** | `MethodNotFound` | Unknown JSON-RPC method requested. | Verify the MCP method name is supported. |
| **`-32602`** | `InvalidParams` | Unknown tool/resource URI, invalid cursor, or argument schema validation error. | Check tool name, URI, and parameter types against the input schema. |
| **`403`** | `insufficient_scope` | Caller token is missing the required scope for the requested tool. | Re-authorize or create an API key with the scope listed in `WWW-Authenticate`. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.