# Connecting an AI assistant (MCP)

Odotify speaks the Model Context Protocol at `https://mcp.odotify.com/mcp` (staging:
`https://staging.mcp.odotify.com/mcp`). An assistant connected to it acts as you, with
your role, in one organization. It can read servers, instances, backups, deploys,
jobs, the audit log and database insight, restart an instance, start a backup, and
propose database changes. It cannot delete anything, and every database change it
proposes waits for a person to approve it in the dashboard. Every call is in the
audit log. The organization's plan must include AI assistant access (Starter, Pro or Agency).

## Claude (claude.ai, Claude Desktop, Claude Code)

1. Add a custom connector with the URL above (Claude Code: `claude mcp add --transport http odotify https://mcp.odotify.com/mcp`).
2. Claude opens Odotify's sign-in. Sign in, pick the organization and choose whether
   it may propose changes or only read.
3. The connection appears under **AI assistants** in the organization, where you can
   disconnect it at any time; its next request is refused.

## Headless clients

Create an API key under **API keys** with the role the client should have, and send
it as `Authorization: Bearer <key>`. Keys can propose changes but never approve them.

## Tools

| Class | Tools |
|---|---|
| read | list_servers, get_server_status, get_postgres_config, list_instances, get_instance_status, list_backups, list_backup_schedules, list_deployments, get_job, get_audit_logs, get_slow_queries, get_running_statements, get_query_plan, get_index_health, get_index_status, refresh_insights, list_db_changes, list_restore_drills |
| write | restart_instance, create_backup, verify_backup (a restore drill into a scratch copy), create_index (proposal), drop_index (proposal) |
| sensitive | tune_postgres (proposal; approved by typing the server name) |

Long work returns a `job_id`; poll `get_job`.

## What the assistant sees of your database

Statement statistics and generic plans, with every literal value replaced by `?` on
your server and again by Odotify (ADR 0015). It never sees rows, and planning never
runs a statement.
