# Agents via MCP

> Give an AI agent its own databases through the Model Context Protocol.

`elefork-mcp` is an MCP server (stdio) that lets an agent create, fork, checkpoint, reset and query branches.

```json
{
  "mcpServers": {
    "elefork": {
      "command": "elefork-mcp",
      "env": {
        "ELEFORK_URL": "https://api.elefork.com",
        "ELEFORK_TOKEN": "elefork_...",
        "ELEFORK_PROJECT": "agents"
      }
    }
  }
}
```

A typical loop for the agent: `create_branch` → `run_sql` to set up → `checkpoint_branch` → try something → `reset_branch` if it went wrong → `delete_branch` when done. See the [tool reference](/docs/reference/mcp/).

`reset_branch` and `delete_branch` are marked destructive and refuse to run unless called with `confirm=true`, so MCP clients can ask the user first.
