Access and safety
An agent that connects with your API key acts as an admin of your advertiser account. It can:- Create and launch campaigns, change budgets, and spend money in a single call. The key has no spend limit.
- Add and remove team members and invites.
Before you start
- A Gravity advertiser account.
- The API key of the advertiser account. Get it in the dashboard.
- An MCP client that can send JSON-RPC requests over HTTP POST. See “Client support” below.
Connect
- Get the API key of your advertiser account in the dashboard.
- Add
https://platform.trygravity.com/mcpas an MCP server in your client. - Set the
X-API-Keyheader to your API key. - Ask the client to list the tools.
advertiser_* tools, the dashboard_* tools for advertisers, and the account tools.
Tools for advertisers
Reporting tools return summaries. They do not change data:advertiser_get_info, advertiser_list_campaigns, advertiser_get_campaign, advertiser_get_metrics, advertiser_get_ad_group_metrics, advertiser_get_conversions, advertiser_get_billing, advertiser_get_events_analytics, advertiser_get_conversion_stats, and advertiser_get_integrations.
Dashboard tools do the actions of the advertiser dashboard. Each tool name is dashboard_ and the name of a dashboard action, for example dashboard_create_campaign. They cover campaigns, ad groups and ads, ad units, campaign metrics, audiences, billing, events, pixels, and conversion integrations (Shopify, Stripe, and Triple Whale). Call tools/list to get the full list for your key.
Account tools cover the team, organizations, support, Slack, and the Gravity Index.
Recipes
Some advertiser tasks need more than one call. The server sends these recipes to the client in itsinitialize response.
Create and launch a campaign
- Call
dashboard_get_campaign_launch_limits. - Call
dashboard_create_campaignwith the status"draft". - Call
dashboard_create_ad_groupfor each ad group. Put the ads in the same call. - Call
dashboard_launch_campaign.
- To change the campaign settings, call
dashboard_update_campaign. - To pause or resume a campaign, set its status with
dashboard_update_campaign. - To list the ad groups of a campaign, call
dashboard_list_ad_groupswithcampaign_id. - To change ad groups and ads, call
dashboard_update_ad_group,dashboard_create_ad,dashboard_update_ad, ordashboard_archive_ad.
dashboard_get_campaign, dashboard_get_ad_group, or dashboard_get_ad. Then create a new item with dashboard_create_campaign, dashboard_create_ad_group, or dashboard_create_ad.
Compare with the previous period
Call the same metrics tool two times. Use the same length of time for each call. The second period ends when the first period starts.
List all ads in the account
Call dashboard_list_ad_groups. It returns the ads of each ad group.
Export to CSV
The tools return JSON, not CSV. The dashboard makes the CSV files for campaigns, ad groups, ads, and billing history in the browser. Make the CSV from the JSON.
What the server cannot do for advertisers
These actions are not available with an API key:- Change your password, two-factor authentication, or personal profile.
- Create, list, switch, or close organizations.
- Buy credits.
- Add a card. Use the Stripe form in the dashboard.
- Connect Stripe, Triple Whale, GitHub, or Vercel. The tool returns a URL. A person must open the URL.
- Connect Shopify, or book a call. A person must complete these steps in the dashboard.
https://platform.trygravity.com/dashboard.
Connection details
Advertiser accounts and publisher accounts use the same server. The API key tells the server which account you use, and the server shows only the tools for that account type.
Every request needs the API key, also
initialize and tools/list. A request without a valid key gets HTTP 401.
To test the connection without a client, send a tools/list request:
tools list.
This page describes version
2.0.0 of the server. Tool names and tool groups can change in a later version. Use tools/list to get the current names.Results and errors
- Each tool returns the JSON response of the dashboard action as text in
content. - If the dashboard action fails, the result has
isError: trueand the textHTTP <status>: <body>. - A key can only get to its own account. A request for an account, organization, or publisher of a different key returns 404. One key cannot get to a different organization of the same owner.
Client support
The server uses JSON-RPC 2.0 over HTTP POST, with protocol version2024-11-05. It does not use the Streamable HTTP transport or Server-Sent Events. Some MCP clients need one of these transports and cannot connect.
Gravity has not tested specific MCP clients with this server. Before you rely on a client, connect it and do a tools/list call.
Troubleshoot
Related pages
- Dashboard MCP server for publishers uses the same server with a publisher key.
- Advertiser Dashboard API gives the same data over REST.
- Docs MCP server searches the docs. It cannot read or change your account.