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

# MCP Server

> Connect AI assistants to Pragmatiks using the Model Context Protocol

The Pragmatiks API exposes an [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that allows AI assistants to interact with your resources, providers, and operations directly.

## Why Use MCP?

MCP enables AI tools like Claude, Cursor, and GitHub Copilot to:

* **Manage resources** - List, create, update, and delete resources through natural language
* **Monitor status** - Check resource lifecycle states and troubleshoot issues
* **Deploy providers** - Push code, monitor builds, and manage deployments
* **Handle operations** - Retry failed events and manage dead letter queues

Instead of switching between the CLI and your AI assistant, you can stay in your workflow and let the AI handle Pragmatiks operations directly.

## Available Tools

The MCP server exposes the following tools:

### Authentication

| Tool     | Description                  |
| -------- | ---------------------------- |
| `get_me` | Get current user information |

### Resources

| Tool                  | Description                                                 |
| --------------------- | ----------------------------------------------------------- |
| `list_resource_types` | List available resource types from deployed providers       |
| `list_resources`      | List resources with optional filters (provider, type, tags) |
| `get_resource`        | Get a resource by ID                                        |
| `get_resource_status` | Get resource lifecycle status                               |
| `apply_resource`      | Create or update a resource                                 |
| `delete_resource`     | Delete a resource                                           |

### Providers

| Tool               | Description                            |
| ------------------ | -------------------------------------- |
| `list_providers`   | List providers with deployment status  |
| `push_provider`    | Push provider code and trigger a build |
| `list_builds`      | List builds for a provider             |
| `get_build_status` | Get build status by version            |
| `get_build_logs`   | Stream build logs                      |
| `deploy_provider`  | Deploy a provider version              |
| `delete_provider`  | Delete a provider                      |

### Operations

| Tool                     | Description                                 |
| ------------------------ | ------------------------------------------- |
| `list_dead_letters`      | List failed events in the dead letter queue |
| `get_dead_letter`        | Get a single dead letter event              |
| `retry_dead_letter`      | Retry a failed event                        |
| `retry_all_dead_letters` | Retry all failed events                     |
| `delete_dead_letter`     | Delete a dead letter event                  |

## Authentication

The MCP server requires authentication via your Pragmatiks account. When you configure the MCP server in your AI tool, you'll need to provide your authentication token.

<Note>
  All MCP operations are automatically scoped to your organization. Resources and providers from other organizations are not accessible.
</Note>

## Endpoint

The MCP server is available at:

```
https://api.pragmatiks.io/mcp
```

## Next Steps

<Card title="Configuration Guide" icon="gear" href="/mcp/configuration">
  Set up the MCP server in your AI tool.
</Card>
