> ## 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.

# Building Autonomous Social Media Agents with MCP

> How to connect Claude Desktop, Cursor, and custom agentic frameworks to Posttu's Model Context Protocol (MCP) server for multi-channel scheduling, listening, and inbox triage.

The **Model Context Protocol (MCP)** standardizes how AI models discover and invoke external tools. Posttu provides a first-party, enterprise-grade MCP server at:

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

This guide explains how to equip your AI agents with the ability to query past performance, draft multi-channel campaigns, monitor brand sentiment, and triage incoming messages autonomously.

***

## 1. Connecting Claude Desktop & Cursor

For desktop AI tools and developer IDEs, connect using a Developer API Key generated from your Posttu dashboard (**Dashboard → Settings → API Keys**):

### Claude Desktop Configuration

Add the following to your `claude_desktop_config.json`:

```json theme={null}
{
  "mcpServers": {
    "posttu": {
      "url": "https://posttu.com/api/v1/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_POSTTU_API_KEY"
      }
    }
  }
}
```

### Cursor Configuration

In **Cursor Settings → MCP Servers**, add a new server:

* **Name**: `Posttu`
* **Type**: `command` or `url`
* **URL**: `https://posttu.com/api/v1/mcp`
* **Headers**: `Authorization: Bearer YOUR_POSTTU_API_KEY`

***

## 2. Multi-Tenant AI Agents via OAuth 2.1

For cloud-based multi-tenant AI agents (such as custom GPTs or hosted agent runtimes), Posttu supports **RFC 9728 Dynamic Protected Resource Discovery**:

1. Your agent sends an unauthenticated `POST https://posttu.com/api/v1/mcp`.
2. Posttu responds with `401 Unauthorized` and points to:
   ```text theme={null}
   WWW-Authenticate: Bearer resource_metadata="https://posttu.com/.well-known/oauth-protected-resource/api/v1/mcp"
   ```
3. Your agent discovers authorization endpoints and performs a standard PKCE authorization code exchange.

***

## 3. Practical Agent Workflows

### Workflow A: Natural Language Analytics Query

Your agent can inspect past engagement before drafting content:

> *"Claude, check our top 5 best performing posts on LinkedIn and X over the past 30 days and summarize our highest-converting topics."*

Claude invokes `list_posts` with engagement filters and receives structured performance statistics.

### Workflow B: Autonomous Draft Creation & Approval

Agents can create drafts that require team review before going live:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "create_post",
    "arguments": {
      "postDetails": {
        "base": {
          "text": "Introducing our latest developer API enhancements! 🚀",
          "timestamp": "2026-03-20T15:00:00Z"
        },
        "channels": {
          "chn_x_primary": {
            "text": "Introducing our latest developer API enhancements! Read the thread 🧵"
          }
        }
      },
      "isDraft": true
    }
  }
}
```

### Workflow C: Unified Inbox Triage

Agents can scan unread comments and suggest responses grounded in your brand voice:

1. Agent invokes `list_inbox` to retrieve unresolved customer inquiries.
2. Evaluates sentiment and priority flags.
3. Suggests replies or updates thread pin/priority state (`update_thread_pin`, `update_thread_priority`).

***

## 4. Security & Guardrails

* **Scope Isolation**: Restrict agent API keys strictly to the channels and resources they need (e.g., `posts:read`, `inbox:read`).
* **Draft Safeguards**: Configure agent prompt instructions to always create posts with `isDraft: true` unless an explicit human confirmation is received.
* **Audit Trails**: Every action executed via MCP is logged with the calling credential ID in your Posttu audit stream.


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