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

# AI Agent Integration

> Connect AI agents to SlideKit via MCP — generate branded slides from natural language.

# AI Agent Integration

SlideKit includes an MCP (Model Context Protocol) server that gives AI agents direct access to template management, slide generation, and download.

End users can ask for slides in natural language. The agent handles the mechanical workflow behind the scenes: finding available templates, reading template analysis, selecting compatible template slides, structuring `slide_data`, setting rendering options, starting generation, polling status, and downloading the finished `.pptx`.

The user does not need to write JSON payloads by hand. The agent does need access to the MCP tools and enough template analysis context to choose the right `slideId`.

## How agents use the API

A typical agent run looks like this:

1. List available templates.
2. Read the selected template's analysis.
3. Choose actual analyzed template slides whose shapes match the user's requested content.
4. Build `slide_data` from the user's natural-language request and source data.
5. Call `generate_slide` or `generate_deck`.
6. Poll `get_generation_status` until the job is ready.
7. Return the download URL or save the `.pptx` with `download_presentation`.

## Setup

The MCP server supports three transports. Pick the one that matches your environment.

<Tabs>
  <Tab title="Claude Desktop">
    Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):

    ```json theme={"dark"}
    {
      "mcpServers": {
        "slidekit": {
          "command": "python",
          "args": ["mcp_server.py"],
          "cwd": "/path/to/powerpoint_api",
          "env": {
            "POWERPOINT_API_URL": "http://localhost:8000",
            "POWERPOINT_API_KEY": "your-api-key"
          }
        }
      }
    }
    ```

    Restart Claude Desktop after saving. The SlideKit tools appear in the tool picker.
  </Tab>

  <Tab title="Claude Code">
    Add a `.mcp.json` file to your project root:

    ```json theme={"dark"}
    {
      "mcpServers": {
        "slidekit": {
          "type": "stdio",
          "command": "python",
          "args": ["/path/to/powerpoint_api/mcp_server.py"],
          "env": {
            "POWERPOINT_API_URL": "http://localhost:8000",
            "POWERPOINT_API_KEY": "your-api-key"
          }
        }
      }
    }
    ```

    Claude Code loads this automatically when you open the project directory.
  </Tab>

  <Tab title="Remote agents (SSE / HTTP)">
    For custom agent frameworks or remote deployments, run the server in network-accessible mode:

    ```bash theme={"dark"}
    # If the SlideKit API is also on port 8000, choose another MCP port.
    export FASTMCP_PORT=8001

    # SSE transport
    python mcp_server.py --sse

    # Streamable HTTP transport
    python mcp_server.py --streamable-http
    ```

    Point your agent at the server URL:

    ```json theme={"dark"}
    {
      "mcpServers": {
        "slidekit": {
          "url": "https://your-server.com/sse"
        }
      }
    }
    ```

    For streamable HTTP, use the `/mcp` endpoint instead:

    ```json theme={"dark"}
    {
      "mcpServers": {
        "slidekit": {
          "url": "https://your-server.com/mcp"
        }
      }
    }
    ```
  </Tab>
</Tabs>

Set `POWERPOINT_API_URL` to the address of your running SlideKit instance and `POWERPOINT_API_KEY` to a valid API key. If the API is running locally on the default development port, `http://localhost:8000` works.

## MCP tools

The server exposes the following tools:

| Tool                    | What it does                                                                                         |
| ----------------------- | ---------------------------------------------------------------------------------------------------- |
| `upload_template`       | Upload a `.pptx` template file                                                                       |
| `analyze_template`      | Extract slide layouts, placeholder shapes, table styles, and chart presets from an uploaded template |
| `get_analysis_status`   | Poll template analysis progress                                                                      |
| `list_templates`        | List available templates, filtered by status or category                                             |
| `get_template`          | Get metadata for a single template                                                                   |
| `get_template_analysis` | Get full analysis results — every slide's shapes, dimensions, and placeholder positions              |
| `get_slide_details`     | Inspect a specific slide's placeholders                                                              |
| `generate_slide`        | Start an async single-slide generation job                                                           |
| `generate_deck`         | Start an async multi-slide presentation job                                                          |
| `get_generation_status` | Poll generation progress                                                                             |
| `download_presentation` | Download a generated `.pptx` to a local path or as base64                                            |
| `update_charts`         | Update chart data in an existing presentation without regenerating                                   |
| `delete_template`       | Remove a template                                                                                    |

There is no separate MCP matching tool today. Agents choose slides by inspecting `get_template_analysis` and comparing the user's requested content to each analyzed slide's shapes, dimensions, tables, charts, and text regions.

## Skills for Claude Code

We provide four skills that teach the agent how to use the API. Copy `.claude/skills/` into your project — Claude Code loads them automatically.

* **generation-workflow** — template discovery, layout matching, single-slide vs multi-slide generation
* **text-blocks** — headers, bullets, text formatting, rendering options
* **chart-blocks** — bar and column charts, series, axes, legends, data rows
* **table-blocks** — multi-paragraph cells, logo cells, conditional formatting, pagination
