MCP: Programmatic Interface
MCP endpoint /mcp: GetMyBot tools, resources, and prompts for AI agents using the same personal token.
در این صفحه
In addition to REST, GetMyBot provides an MCP (Model Context Protocol) interface designed for AI agents and assistants that invoke tools rather than calling endpoints manually. REST remains the primary interface; MCP is a convenient alternative for agentic scenarios. The tool, resource, and prompt names listed below match what the server publishes.
Address and authorization
MCP is available at the /mcp endpoint (Streamable HTTP transport, POST method). Authorization uses the same personal token as REST: the Authorization: Bearer mbp_… header. No separate tokens are needed: a single PAT works for both REST and MCP. A token belongs to one account: list_bots and the other tools see that account's bots only, and get_balance, get_transactions and connect_bot apply to it as well (see The token's account). Each tool requires the same scope as the corresponding REST endpoint; a token with scope * has full access. If a scope is missing, the call is rejected (fail-closed), just as with REST.
When the token is minted for somebody else's account, account-level tools also check the token holder's account rights: connect_bot needs bots.create, billing tools need billing.read or billing.write. The * scope does not grant account rights. Without them the tool returns the error permission denied: missing cabinet right (you are not a member of the account and reach it only through a shared bot) or permission denied: missing cabinet right: <right> (the membership lacks that specific right). Rights are granted by the account owner in the "Cabinet access" card; access management itself is not available via MCP.
Connecting to Claude Code / Cursor
Add GetMyBot as a remote MCP server. Example configuration (mcpServers): substitute your domain and token:
{
"mcpServers": {
"mybot": {
"url": "https://your-domain/mcp",
"headers": {
"Authorization": "Bearer mbp_YOUR_TOKEN"
}
}
}
}
Claude Code: place this block in your project's .mcp.json or add the server with claude mcp add. Cursor: add the same block to MCP settings (Settings → MCP → Add server). After connecting, the client will automatically receive the list of tools, resources, and prompts.
Tools by domain
The server publishes a tool for every PAT-accessible REST operation: full coverage, not a subset. Below is each tool and its required scope. Names follow the verb_noun format (snake_case).
Bots (bots)
list_bots:bots:readget_bot:bots:readvalidate_bot_token:bots:writeconnect_bot:bots:writeupdate_bot:bots:writedelete_bot:bots:writesync_bot:bots:writechange_bot_token:bots:writetransfer_bot:bots:writeget_bot_settings:settings:readupdate_bot_settings:settings:writeget_widget_settings:settings:readupdate_widget_settings:settings:write
get_widget_settingsreturns the web widget's brand/launcher/panel/welcome/prechat/availability/ behavior settings, its origins,widgetKeyandrevision.update_widget_settingsrequires theexpected_revisionfrom that snapshot and refuses the save if the revision has moved since.update_bot_settingscan also overwritewidget_experiencewholesale, but it skips that validation, the avatar-ownership check, and the revision lock — for the widget, that is not the path to use.
Channels & WhatsApp templates (bots)
Multichannel support (Telegram + WhatsApp + VK + web widget) is available over MCP too. Channels and templates are gated by the shared scopes bots:read / bots:write: there is no separate channel scope.
list_channels:bots:read: list a bot's channels (platformtg/wa/vk/web, external_id, name, enabled, callback_url).connect_channel:bots:write: connect a WhatsApp channel, a VK channel, or a web widget (platform+ creds; forplatform: "web"no creds are needed, only a required non-emptyorigins).delete_channel:bots:write: disconnect a channel.list_wa_templates:bots:read: the channel's WhatsApp template catalog (name, language, status, category, body).sync_wa_templates:bots:write: re-sync the template catalog from Meta.create_wa_template:bots:write: create a WhatsApp template and submit it to Meta for review.update_wa_template:bots:write: edit a template (inAPPROVED/REJECTED/PAUSEDstatus).delete_wa_template:bots:write: delete a template.
Telegram channels are connected via
connect_bot, notconnect_channel: the latter handleswa,vk, andweb. Template categories:MARKETING/UTILITY/AUTHENTICATION.create_wa_templateimmediately submits the draft to Meta for review; the status changes asynchronously: read it back vialist_wa_templates(refreshing the catalog withsync_wa_templatesif needed).
connect_channel's response forplatform: "web"differs from the other platforms:{"widget_key": "…"}, not{"id": …}. The call is idempotent: connecting the same bot again returns the same key rather than creating a second widget. Configuring the widget's look and behavior is the separateget_widget_settings/update_widget_settingspair above, notconnect_channel.
Uploading a template's media header (image/video/document) over MCP is not supported yet: use the web UI or REST
POST /api/bots/{botID}/channels/{channelID}/templates/media.
Reactions (reactions)
list_reactions:reactions:readget_reaction:reactions:readcreate_reaction:reactions:writeupdate_reaction:reactions:writedelete_reaction:reactions:writeimport_reactions:reactions:writetest_formula:reactions:write: test an advanced formula against sample text. Fields:bot_id,formula,sample(in REST the same field is calledsample_text). The context is empty:ctxand parameters are not substituted, the sample text is available as{text}/{answer}.reorder_reaction:reactions:writeget_reaction_links:reactions:readlist_reaction_folders:reactions:readcreate_reaction_folder:reactions:writeupdate_reaction_folder:reactions:writedelete_reaction_folder:reactions:writeadd_reaction_to_folder:reactions:writeremove_reaction_from_folder:reactions:writeadd_reactions_to_folder:reactions:write
Import via
import_reactionscreates reactions but skips media: there is no premium check or Telegram file receiver in the MCP context. If the SamBot bundle contains images, videos, or documents, use the full-featured REST import (POST /api/bots/{botID}/reactions/import): it transfers media as well.
Broadcasts (broadcasts)
start_broadcast:broadcasts:write(optionalpaid, optional segment by labels)get_broadcast:broadcasts:write: for broadcasts started from a reaction viastart_broadcast, the report includesblocked– block events attributed within 24 hours after delivery.pause_broadcast:broadcasts:writeresume_broadcast:broadcasts:writecancel_broadcast:broadcasts:write
Labels (labels)
list_labels:labels:readcreate_label:labels:writedelete_label:labels:writeset_label_favorite:labels:write
Collections and records (collections)
list_collections:collections:readcreate_collection:collections:writeupdate_collection:collections:writedelete_collection:collections:writelist_records:collections:readcreate_record:collections:writeupdate_record:collections:writedelete_record:collections:write
Scenarios (flows)
list_flows:flows:readget_flow:flows:readcreate_flow:flows:writeupdate_flow:flows:writedelete_flow:flows:write
Integrations, connections, credentials (integrations)
list_integrations:integrations:readget_integration_sheets:integrations:readget_integration_status:integrations:readcreate_integration:integrations:writeupdate_integration:integrations:writedelete_integration:integrations:writerotate_integration_token:integrations:writelist_connections:integrations:readcreate_connection:integrations:writetest_connection:integrations:writeupdate_connection:integrations:writedelete_connection:integrations:writelist_credentials:integrations:readcreate_credential:integrations:writeupdate_credential:integrations:writedelete_credential:integrations:write
CRM (crm): read-only
CRM connections are their own scope pair, and only the reads are published as tools. Connecting, syncing, retrying a job and resolving a conflict stay REST-only, so an agent can observe a CRM integration but cannot change what it does. None of these tools ever returns credentials.
list_crm_connections:crm:read: a bot's connections with provider, status and capabilities.get_crm_connection:crm:read: one connection's safe summary.get_crm_mapping:crm:read: the connection's current mapping revision.list_crm_operations:crm:read: recent sync operations, newest first, optionally scoped to one connection.get_crm_operation:crm:read: one operation with its jobs; never a job's raw request payload.list_crm_conflicts:crm:read: jobs waiting for manual conflict resolution.
See CRM integrations for what a connection, mapping and operation mean.
Browser push and customer SDK (web_push, customer_sdk): read-only
Both verticals are published as reads only. Enabling a project, rotating VAPID keys or an identity secret, sending a test notification and revoking a device stay REST-only on purpose, so an agent can report on these channels but cannot change or trigger them. No tool ever returns a VAPID private key, a push endpoint, an identity secret or a device push token.
get_web_push_config:web_push:read: the redacted Web Push configuration for a bot.get_web_push_status:web_push:read: whether browser push is enabled.get_web_push_report:web_push:read: subscription and receipt counters.get_customer_sdk_status:customer_sdk:read: whether the mobile SDK project is enabled.get_customer_sdk_report:customer_sdk:read: installation and push-token counters.
See Browser push and Customer SDK for what these numbers mean.
Media (media)
upload_media:media:writeget_media:media:writedownload_media:media:write: download a media asset's bytes as base64 ({mime, size_bytes, data_base64}), e.g. to re-upload it to another bot withupload_media. Refuses assets larger than 2 MB.
Templates (templates)
list_templates:templates:readdelete_template:templates:writecreate_template_from_bot:templates:writeapply_template:templates:write
Subscribers, chats, dialogs (subscribers)
list_subscribers:subscribers:read(offset/limit pagination, search, label andis_blocked=true|falsefilters; each item carriesis_blockedandblocked_atwhen the subscriber blocked the bot)list_chats:subscribers:readlist_dialogs:subscribers:read: operator-inbox threads: subscriber, platform, last-message preview, last_seen; keyset pagination viacursor/next_cursor.read_dialog:subscribers:read: dialog messages, older pages viabefore_id; transcribed audio/video messages carrytranscript_status/transcript/transcript_errorinmeta.send_dialog_message:subscribers:write: operator text send to a subscriber: WhatsApp 24h window and channel routing enforced, delivery metered to the token owner.send_dialog_reaction:subscribers:write: send one of the bot's ready-made reactions to a subscriber (like the operator console's "send reaction" button).transcribe_dialog_message:subscribers:write: start or fetch a speech-to-text transcription of an audio/video message. Idempotent: the first call enqueues a background job ({"status":"pending"}), poll by calling again until{"status":"done","text":…}; a failed transcription is restarted automatically. Requires the bot's "Speech recognition" integration.
Stats and analytics (stats)
get_stats:stats:readget_stats_summary:stats:readget_stats_recent:stats:readget_stats_log:stats:readget_reaction_health:stats:readget_analytics:stats:readget_analytics_chats:stats:readget_funnel:stats:read
Shared experiments (experiments)
list_experiments:experiments:readget_experiment:experiments:readget_experiment_report:experiments:read
These tools are read-only. They return the immutable experiment definition or the report for one version. The report keeps currencies separate and carries the selected attribution model; it does not create assignments, record facts, change a lifecycle state, or select a winner.
{
"name": "get_experiment_report",
"arguments": { "bot_id": "<bot-id>", "experiment_id": "<experiment-id>", "version": 2 }
}
Saved event funnels currently use REST only. Do not confuse the legacy
get_funnel tool above, which returns the auto-derived stats funnel, with a
saved event funnel definition or its cohort. Use the bounded REST endpoints in
Saved event funnels for those workflows.
Billing: read (billing)
get_balance:billing:readlist_tariffs:billing:readget_transactions:billing:read
In somebody else's account all three require the account right billing.read, otherwise: permission denied: missing cabinet right.
Sending messages
send_message:broadcasts:write: send a message on behalf of the bot; balance charges are tracked automatically by the token owner.
Resources
In addition to tools, the server exposes resources you can read to avoid guessing structure:
mybot://openapi.yaml: the full OpenAPI spec (same as served at/openapi.yaml).mybot://reference: a compact reference: tool list with scopes and conventions (base URL, pagination, error format, limits).mybot://schemas/reaction,mybot://schemas/trigger,mybot://schemas/action,mybot://schemas/flow,mybot://schemas/collection: JSON schemas for configs. Most useful for correctly generating reactions (trigger, conditions, chats, actions), scenarios, and collections.mybot://bots: a dynamic list of your bots (quick context without calling a tool).
Prompts
Ready-made scenarios (slash commands in MCP clients):
setup_autoresponder: build an autoresponder bot (arguments: bot, topic/question set).segment_broadcast: broadcast to a label segment (arguments: bot, labels, reaction/text).diagnose_reaction: figure out why a reaction is not triggering (reads the reaction, reaction health, and order).import_from_sambot: run a SamBot bundle import and verify the result.weekly_report: summary of bot stats/analytics for a period.
When to use MCP vs. REST
- Building an integration, sync job, script, or custom dashboard: use REST.
- Connecting GetMyBot to an AI assistant or agent that supports MCP: use
/mcp.
Both interfaces work under the same token and are subject to the same owner permissions. If no tool covers your use case, the corresponding REST endpoint is always available in the interactive reference.
Feature rollout gates are identical on both surfaces. Copilot, Flow Intelligence, Explainable Replay, and Vertical Playbooks fail closed when the account is not included in the rollout.
Customer AI and workflow tools
| Family | Tools | Required scopes |
|---|---|---|
| Managed AI | invoke_managed_ai, get_managed_ai_usage | managed_ai:invoke, managed_ai:usage:read |
| Copilot | create_copilot_proposal, get_copilot_proposal, validate_copilot_proposal, simulate_copilot_proposal, apply_copilot_proposal, reject_copilot_proposal | copilot:use + journey read/edit |
| Flow Intelligence | get_flow_intelligence_policy, preview_flow_intelligence_policy, update_flow_intelligence_policy, reaggregation tools | analytics:read, journey:edit |
| Replay | list_execution_traces, get_execution_trace, simulate_execution_trace, capture_regression_fixture, list_regression_fixtures, get_regression_fixture, run_regression_fixture, list_replay_runs | journey:read/edit |
| Playbooks | list_vertical_playbooks, setup/preflight/install/upgrade tools; KPI remains REST-only | template, bot, reaction read/write |
| Onboarding | start_outcome_onboarding, update_outcome_onboarding, complete_outcome_onboarding | bot/template/reaction scopes |
| Meta | list_meta_connections, start_meta_authorization, refresh_meta_assets, asset check/select/attach and disconnect tools | integration/bot scopes |
Mutations are audited with the MCP surface and PAT token id. OAuth returns a browser handoff URL; the callback and webhooks are never tools. Provider keyring, routing, and reconciliation are not published to customer agents.
What's next
- Skills for AI agents: ready-made GetMyBot wrappers for Claude Code and other agents.
- Authorization and tokens: create a PAT for MCP.
- API quickstart: the REST alternative.
- Interactive reference: full REST endpoints.