# MCP server

Closefinch runs a hosted [Model Context Protocol](https://modelcontextprotocol.io) server, so assistants can
read and work in your CRM with your permissions.

- **Endpoint:** `https://api.closefinch.com/mcp` (Streamable HTTP, JSON responses; protocol versions 2025-06-18 and 2025-03-26).
- **OAuth sign-in.** The server supports OAuth 2.1 with PKCE, and clients such as Claude, ChatGPT and Cursor
  register themselves (RFC 7591) and open the consent screen. Self-registered apps are marked "not verified", get
  capped scopes, and can't touch API keys, secrets, approvals or the audit log. Each person can disconnect the
  apps they've connected under Settings → Connected apps.
- **Or an API key.** An owner creates one in Settings → API keys with the scopes it needs, and the client sends
  `Authorization: Bearer ra_live_…`. The key never has more access than the person who made it.

## What it can do

- Tools for records, activities, lists, questions over your data, conversations, approvals (read only), runs,
  agents, triggers, templates, pipelines and projects.
- `ra_api` calls any `/v1` route with your credentials.
- `ra_propose` runs a platform action the way an agent does: sends and changes to existing records wait in the
  approval inbox for a person.
- Approving, API keys and secrets stay in the web app.

## Connect

Claude Code:

```bash
export RA_API_KEY=ra_live_…
claude mcp add --transport http revenueagent https://api.closefinch.com/mcp --header "Authorization: Bearer $RA_API_KEY"
```

Codex (`~/.codex/config.toml`):

```toml
[mcp_servers.revenueagent]
url = "https://api.closefinch.com/mcp"
bearer_token_env_var = "RA_API_KEY"
```

Every call is recorded in the organization's audit log.
