# Use your app from AI tools (MCP)

> Connect Claude, Cursor and other MCP clients to your app's data.


Every app has a [Model Context Protocol](https://modelcontextprotocol.io) address. Connect an AI tool to it, and you can ask things like "How many orders came in today?" or "Mark order 1042 as shipped" from that tool.

## Connect

1. Open **Dashboard → API & webhooks** and create an API key.
2. Copy the **MCP address** from the same page. It looks like `https://your-app.draftship.site/_ds/mcp`.
3. Add it to your tool, sending the key as a Bearer token.

In Claude Code:

```bash
claude mcp add --transport http my-app https://your-app.draftship.site/_ds/mcp --header "Authorization: Bearer dsa_your_key"
```

In Cursor, add this to `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "my-app": {
      "url": "https://your-app.draftship.site/_ds/mcp",
      "headers": { "Authorization": "Bearer dsa_your_key" }
    }
  }
}
```

## Tools

| Tool | What it does |
|---|---|
| `describe_app` | Lists your tables, their fields and record counts |
| `list_records` | Reads records, with filters and sorting |
| `get_record` | Reads one record |
| `create_records` | Adds up to 100 records |
| `update_record` | Changes fields on one record |
| `delete_records` | Moves up to 100 records to the trash |

## Security

- **An API key has full admin access** to your app's data, and bypasses your table permissions. Only add it to tools you trust.
- Your AI tool may read text your visitors wrote. Someone could write instructions there to try to mislead it, so review what it plans to change before you approve it.
- To cut off a tool, revoke its key in **Dashboard → API & webhooks**.
- Deleted records stay in the trash for 30 days.
