GramClaw exposes the same Telegram engine two ways: a REST API for custom automation, and a remote MCP (Model Context Protocol) server for AI agents. Both authenticate with an API key you create in Settings, both respect the same per-account pacing that keeps your Telegram accounts healthy, and both require an active subscription or trial.
In practice: the REST API is for code — sync contacts from your product, trigger a campaign when a user signs up, pipe conversations into your data warehouse. The MCP server is for agents — Claude Desktop, Claude Code, Cursor, or your own agent gets tools to list chats, read messages, send replies, run broadcasts, and manage the pipeline, with no code written.
Create an API key
- 1
Open Settings → API Keys
Generate a key and choose its scopes — read for listing and reading data, send for anything that writes or messages. Scope keys to the minimum they need.
- 2
Copy it once
The full key (gc_live_…) is shown only at creation — store it in a secrets manager. If it leaks, delete it in Settings and it stops working immediately.
- 3
Authenticate
REST: send it as an Authorization: Bearer header. MCP: put it in the server URL as the key parameter.
The REST API in one minute
The API covers the platform surface: accounts, chats, messages, contacts, campaigns, broadcasts, pipeline columns, and analytics. Requests are plain JSON over HTTPS. Full endpoint documentation — every route, its scopes, and request/response examples — lives on the API docs page, and a machine-readable OpenAPI spec is available at /openapi.json for codegen or for handing to an LLM.
Connect the MCP server
- 1
Copy the server URL
https://gramclaw.com/api/mcp?key=gc_live_… — the key both identifies and authorizes you, scoped to the accounts it may act on.
- 2
Add it to your MCP client
Claude Desktop, Claude Code, Cursor, or any MCP-compatible client accepts a remote server URL. No local install, no proxy.
- 3
Ask for real work
Once connected, your agent can search chats, draft and send replies, launch campaigns, check campaign status, and move deals through the pipeline — every send subject to the same account pacing as the rest of GramClaw.
Good practices
- One key per integration, named accordingly, so revoking one thing never breaks another.
- Prefer read-only scopes for dashboards and analytics jobs.
- Rotate keys when teammates leave and delete keys you no longer use — revocation is instant.
- Remember that API and MCP sends are real Telegram messages from your real accounts: the same consent and volume judgment applies as in the app.