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

# MCP Server

> Connect your AI tools to Swoop via the Model Context Protocol

export const McpEndpoint = () => <pre><code>https://swoop.it/api/mcp</code></pre>;

The Swoop MCP server is a [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) implementation that provides AI assistants with programmatic access to Swoop's presentation creation capabilities. Instead of switching to the Swoop dashboard, you can create and manage presentations directly from Claude Desktop or any other MCP-compatible client.

## What is MCP?

The Model Context Protocol is an open standard that allows AI assistants to connect to external tools and data sources through a unified interface. MCP defines how clients discover available tools, authenticate, and exchange structured messages with servers — making it possible for any compatible AI client to use Swoop without custom integration work.

## Architecture

The Swoop MCP server sits between your AI client and the Swoop presentation engine:

```mermaid theme={null}
flowchart LR
    A["AI Client
    (Claude, etc.)"]
    B["MCP Server
    /api/mcp"]
    C["Swoop Agent"]
    D["Presentation
    Engine"]

    A -- MCP tool call --> B
    B -- Authenticate & route --> C
    C -- Create, edit, generate --> D
    D -- Stream response --> A
```

The server creates a fresh MCP server instance per request, making it fully stateless and compatible with serverless deployment environments.

## Protocol details

The Swoop MCP server implements the following protocol standards:

| Standard                  | Description                                                                                                                                                                                                                         |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Streamable HTTP**       | Primary transport — JSON-RPC 2.0 messages over HTTP with Server-Sent Events (SSE) for streaming responses                                                                                                                           |
| **JSON-RPC 2.0**          | Message format for all client-server communication                                                                                                                                                                                  |
| **OAuth 2.0**             | Authentication via authorization code flow with [RFC 9728](https://datatracker.ietf.org/doc/html/rfc9728) (Protected Resource Metadata) and [RFC 7591](https://datatracker.ietf.org/doc/html/rfc7591) (Dynamic Client Registration) |
| **MCP Structured Output** | Tool responses include both text content and machine-readable structured content validated against output schemas                                                                                                                   |

## Endpoint

The Swoop MCP server is available at:

<McpEndpoint />

## Session and thread management

The MCP server is stateless — it does not persist sessions between requests. Conversation continuity is managed through **thread IDs**:

* The first call to the Swoop agent returns a `threadId` in the response
* Pass this `threadId` back in subsequent requests to maintain conversation context
* The Swoop agent uses the thread to recall prior instructions, outlines, and edits

### Progress notifications

Presentation generation can take 30–60 seconds. To keep the connection alive during long-running operations, the server sends **heartbeat notifications** every 10 seconds using the MCP `notifications/progress` message with the client's `progressToken`. These heartbeats prevent proxies and load balancers from closing the connection prematurely.

## How it works

1. **Discovery** — Your AI client connects to the MCP server and discovers available tools via the MCP `tools/list` method
2. **Authentication** — The server authenticates your request via OAuth 2.0 or API key (see [Authentication](/mcp/authentication))
3. **Tool call** — Your client invokes `ask_swoopAgent` with a prompt and optional thread ID (see [Tools](/mcp/tools))
4. **Agent execution** — The Swoop agent processes your request, calling internal tools to create outlines, generate slides, edit content, and more
5. **Streaming response** — Results are streamed back via SSE with structured output including the agent's response, a dashboard link, and detailed tool results
6. **Continuation** — Use the returned `threadId` in follow-up requests to iterate on the same presentation

## Next steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="lock" href="/mcp/authentication">
    Set up OAuth or API key access.
  </Card>

  <Card title="Tools" icon="wrench" href="/mcp/tools">
    Explore available tools, parameters, and response fields.
  </Card>

  <Card title="Claude" icon="message-bot" href="/mcp/claude">
    Connect from Claude Desktop, web, or mobile.
  </Card>

  <Card title="Error handling" icon="triangle-exclamation" href="/mcp/error-handling">
    Understand error responses and common scenarios.
  </Card>

  <Card title="Troubleshooting" icon="circle-question" href="/mcp/troubleshooting">
    Fix common connection issues.
  </Card>
</CardGroup>
