-
Notifications
You must be signed in to change notification settings - Fork 549
Add X Ads third-party MCP plugin #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "name": "x-ads", | ||
| "displayName": "X Ads", | ||
| "version": "1.0.0", | ||
| "minClientVersions": { | ||
| "cursor": "3.13.0" | ||
| }, | ||
| "description": "Manage ad campaigns, create ads, track conversions, and pull performance stats.", | ||
| "author": { | ||
| "name": "Cursor", | ||
| "email": "plugins@cursor.com" | ||
| }, | ||
| "homepage": "https://docs.x.com/x-ads-api/introduction", | ||
| "repository": "https://github.com/cursor/plugins", | ||
| "license": "MIT", | ||
| "logo": "assets/logo.png", | ||
| "keywords": [ | ||
| "x", | ||
| "twitter", | ||
| "ads", | ||
| "advertising", | ||
| "campaigns", | ||
| "conversions", | ||
| "analytics", | ||
| "mcp" | ||
| ], | ||
| "category": "integrations", | ||
| "tags": [ | ||
| "x", | ||
| "ads", | ||
| "advertising", | ||
| "mcp" | ||
| ], | ||
| "mcpServers": "./mcp.json" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to this plugin will be documented here. | ||
|
|
||
| ## 1.0.0 — initial release | ||
|
|
||
| - Added the `x-ads` MCP server pointing at `https://ads-api.x.com/mcp`. | ||
| - OAuth user sign-in using X's client ID `NGdZYmo4VVp2T1BnRG55NlExOGQ6MTpjaQ` (the same client the X connector uses), requesting `ads.read`, `ads.write`, `media.write`, and `offline.access`. | ||
| - Separate plugin from X: `ads-api.x.com` is a different protected resource than `api.x.com` with different scopes, so it requires its own authorization. | ||
| - Logo: X's official mark from the X brand toolkit, on a black tile matching X's own app icon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2026 Cursor | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # X Ads | ||
|
|
||
| Cursor plugin that connects agents to the [X Ads API](https://docs.x.com/x-ads-api/introduction) through X's official hosted [Model Context Protocol](https://modelcontextprotocol.io/) server at `https://ads-api.x.com/mcp`. | ||
|
|
||
| This plugin signs you in with OAuth as your own X account and works with the ads accounts you can access. Agents can manage campaigns, create ads, set up pixels and conversion tracking, and pull performance stats. | ||
|
|
||
| This is a separate plugin from the [X](../x/) plugin: the ads MCP server lives on a different subdomain (`ads-api.x.com` vs `api.x.com`) and requires different OAuth scopes, so it needs its own authorization. Installing both means signing in twice — once per plugin. | ||
|
|
||
| ## Install | ||
|
|
||
| 1. Open **Cursor Settings → Plugins**. | ||
| 2. Search for **X Ads**. | ||
| 3. Click **Install**, then complete the OAuth sign-in when prompted. | ||
|
|
||
| Or run `/add-plugin x-ads` in chat. | ||
|
|
||
| ## MCP | ||
|
|
||
| ```json | ||
| { | ||
| "mcpServers": { | ||
| "x-ads": { | ||
| "type": "http", | ||
| "url": "https://ads-api.x.com/mcp", | ||
| "auth": { | ||
| "CLIENT_ID": "NGdZYmo4VVp2T1BnRG55NlExOGQ6MTpjaQ", | ||
| "scopes": [ | ||
| "ads.read", | ||
| "ads.write", | ||
| "media.write", | ||
| "offline.access" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## What agents can do | ||
|
|
||
| | Category | Capabilities | | ||
| | --- | --- | | ||
| | Accounts | Read your ads accounts, funding instruments, and settings | | ||
| | Campaigns | Create, update, pause, and read campaigns and line items | | ||
| | Ads & creatives | Create and manage promoted ads and creatives | | ||
| | Audiences | Read and manage targeting and audiences | | ||
| | Pixels & conversions | Set up the X pixel and conversion tracking | | ||
| | Analytics | Pull campaign, line item, and ad performance stats | | ||
|
|
||
| ## Setup | ||
|
|
||
| No token to paste — the plugin ships with X's OAuth client ID (the same one the X connector uses) and requests the scopes below. On first use, Cursor opens a browser window where you sign in to X and approve access. The `offline.access` scope lets Cursor refresh the session automatically, so you only sign in once. | ||
|
|
||
| Requests run in your user context against the ads accounts your X account can access. You can revoke access at any time from your X account's connected apps settings. | ||
|
|
||
| ## Scopes requested | ||
|
|
||
| `ads.read`, `ads.write`, `media.write`, `offline.access` | ||
|
|
||
| ## Docs | ||
|
|
||
| - X Ads API: https://docs.x.com/x-ads-api/introduction | ||
| - OAuth protected resource metadata: https://ads-api.x.com/.well-known/oauth-protected-resource | ||
| - Authentication overview: https://docs.x.com/fundamentals/authentication/overview | ||
|
|
||
| Logo is X's official mark from the [X brand toolkit](https://about.x.com/en/who-we-are/brand-toolkit), placed on a black tile matching X's own app icon. | ||
|
|
||
| ## License | ||
|
|
||
| MIT |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "mcpServers": { | ||
| "x-ads": { | ||
| "type": "http", | ||
| "url": "https://ads-api.x.com/mcp", | ||
| "auth": { | ||
| "CLIENT_ID": "NGdZYmo4VVp2T1BnRG55NlExOGQ6MTpjaQ", | ||
| "scopes": [ | ||
| "ads.read", | ||
| "ads.write", | ||
| "media.write", | ||
| "offline.access" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unadvertised Ads OAuth scope
High Severity · Bugbot Rules
media.writeis not a vendor-advertised scope for the Ads MCP protected resource. Coverage ofads-api.x.com/mcplistsads.read,ads.write, andoffline.access;media.writeis a general X API v2 user-media scope onapi.x.com. Requesting an unadvertised scope fails the OAuth grant, so sign-in can break.Additional Locations (2)
third_party/x-ads/README.md#L29-L30third_party/x-ads/README.md#L57-L58Triggered by learned rule: Plugin OAuth scopes must be vendor-advertised
Reviewed by Cursor Bugbot for commit d726d67. Configure here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping
media.write. The live Ads MCP protected-resource metadata advertises it.Fetched just now from https://ads-api.x.com/.well-known/oauth-protected-resource (same payload at https://ads-api.x.com/.well-known/oauth-protected-resource/mcp):
{ "authorization_servers": ["https://api.x.com"], "bearer_methods_supported": ["header"], "resource": "https://ads-api.x.com/mcp", "scopes_supported": ["ads.read", "ads.write", "media.write", "offline.access"] }media.writeis vendor-advertised on the ads protected resource, not only onapi.x.com. (For comparison, https://api.x.com/.well-known/oauth-protected-resource does not listmedia.write; the ads PRM does.) Leaving the scope inmcp.jsonso OAuth matches the PRM.