Skip to content

Open-source SEO, GEO, and marketing skills for AI agents.

refactor: remove mcporter, make MCP first-class for Google Ads skills (#22)

Tong Chen1d95abb7931f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 14befb45..637dd318 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,8 +13,14 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Collapsible manual MCP config block for users who skip the setup script
### Changed
+- **`/ads` skill** — MCP is now the only tool-calling method. Removed mcporter CLI fallback and `mcporter.json` config file. The "Calling tools" section now documents the `mcp__adsagent__<toolName>` pattern directly.
+- **`setup`** — MCP server config is built inline instead of reading from `mcporter.json`. Ads skill detection uses directory prefix instead of file existence check. Fixed Windows path compatibility for ads skill detection.
- **README hook questions** — rewritten to target real pain points: wasted ad spend, traffic drops, and conversion growth without budget increases
+### Removed
+- **`google-ads/ads/mcporter.json`** — no longer needed; MCP server config is generated directly by the setup script.
+- **`_replace_key()` helper** in setup — was only used for mcporter placeholder substitution.
+
---
## [0.8.0] — 2026-03-31
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 41b51e9c..9f372d6b 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -15,8 +15,7 @@ seo/ <- SEO skills go here
google-ads/ <- Google Ads skills go here
└── your-skill-name/
- ├── SKILL.md <- required
- └── mcporter.json <- optional (for MCP server config)
+ └── SKILL.md <- required
```
### SKILL.md
diff --git a/README.md b/README.md
index 1609f3c1..ce876d97 100644
--- a/README.md
+++ b/README.md
@@ -372,8 +372,7 @@ toprank/
│ ├── ads-audit/
│ │ └── SKILL.md <- account audit + business context
│ ├── ads/
-│ │ ├── SKILL.md <- Google Ads management
-│ │ └── mcporter.json <- MCP server config
+│ │ └── SKILL.md <- Google Ads management
│ └── ads-copy/
│ └── SKILL.md <- RSA copy generator + A/B testing
└── toprank-upgrade/
diff --git a/google-ads/ads/SKILL.md b/google-ads/ads/SKILL.md
index ade56fb9..9c3ae321 100644
--- a/google-ads/ads/SKILL.md
+++ b/google-ads/ads/SKILL.md
@@ -25,7 +25,7 @@ triggers:
# AdsAgent — Google Ads Management
-Call Google Ads tools using the bundled CLI client.
+Call Google Ads tools using the AdsAgent MCP server.
## Configuration
@@ -75,8 +75,6 @@ If the tool doesn't exist, the MCP server isn't configured yet. Guide the user:
>
> If you installed toprank via the setup script, re-run `./setup --api-key YOUR_KEY` to configure everything automatically.
-Note: This skill can also call tools via the bundled mcporter CLI (see "Calling tools" section below), which works without MCP server configuration. But the MCP server is recommended because other ads skills (`/ads-copy`, `/ads-audit`, `/ads-compete`) depend on it.
-
### Step 1: Check for token
Read `~/.adsagent/config.json` (create `~/.adsagent/` if it doesn't exist).
@@ -109,30 +107,14 @@ If the user wants to switch accounts, run `listConnectedAccounts`, let them pick
## Calling tools
-Before calling any tool, read `~/.adsagent/config.json` and export the API key so mcporter can use it:
-
-```bash
-export ADS_AGENT_KEY="<apiKey from config>"
-```
-
-Then call tools via mcporter using the bundled config. String parameters must be quoted with double quotes inside single quotes to avoid type errors:
-
-```bash
-export ADS_AGENT_KEY="<apiKey from config>"
-npx mcporter call 'google-ads.<toolName>(accountId: "<accountId from config>")' --config ~/.claude/skills/ads/mcporter.json
-```
+Call tools directly via the MCP server using the `mcp__adsagent__<toolName>` pattern. Read `~/.adsagent/config.json` first to get the `accountId`.
**Examples:**
-```bash
-# List campaigns
-npx mcporter call 'google-ads.listCampaigns(accountId: "1234567890")' --config ~/.claude/skills/ads/mcporter.json
-
-# Get keywords for a campaign
-npx mcporter call 'google-ads.getKeywords(accountId: "1234567890", campaignId: "111222333")' --config ~/.claude/skills/ads/mcporter.json
-
-# No-parameter tools
-npx mcporter call google-ads.listConnectedAccounts --config ~/.claude/skills/ads/mcporter.json
+```
+mcp__adsagent__listCampaigns(accountId: "1234567890")
+mcp__adsagent__getKeywords(accountId: "1234567890", campaignId: "111222333")
+mcp__adsagent__listConnectedAccounts()
```
Always pass `accountId` from `~/.adsagent/config.json` to every tool call (except `listConnectedAccounts`). All responses are JSON.
diff --git a/setup b/setup
index 59de7b6b..851ecc95 100755
--- a/setup
+++ b/setup
@@ -324,86 +324,76 @@ def detect_hosts(host_arg):
return install_claude, install_codex, install_openclaw
-def _replace_key(obj, key):
- """Recursively replace ${ADS_AGENT_KEY} placeholders with the actual key."""
- if isinstance(obj, str):
- return obj.replace("${ADS_AGENT_KEY}", key)
- if isinstance(obj, list):
- return [_replace_key(v, key) for v in obj]
- if isinstance(obj, dict):
- return {k: _replace_key(v, key) for k, v in obj.items()}
- return obj
-
-
def setup_mcp(skills, api_key):
- """Configure MCP servers in Claude Desktop settings."""
- for skill_name, rel_path in skills:
- mcporter_path = os.path.join(TOPRANK_DIR, rel_path, "mcporter.json")
- if not os.path.isfile(mcporter_path):
- continue
-
- key = api_key
- if not key:
- config_path = os.path.join(os.path.expanduser("~"), ".adsagent", "config.json")
- if os.path.isfile(config_path):
- try:
- with open(config_path) as f:
- key = json.load(f).get("apiKey", "")
- except Exception:
- pass
- if not key:
- continue
-
- with open(mcporter_path) as f:
- mcporter = json.load(f)
-
- new_servers = mcporter.get("mcpServers", {})
- if not new_servers:
- continue
-
- new_servers = _replace_key(new_servers, key)
+ """Configure AdsAgent MCP server in Claude Desktop settings."""
+ has_ads = any(rel_path.replace("\\", "/").startswith("google-ads/") for _, rel_path in skills)
+ if not has_ads:
+ return
- print("MCP servers:")
- configs_written = []
+ key = api_key
+ if not key:
+ config_path = os.path.join(os.path.expanduser("~"), ".adsagent", "config.json")
+ if os.path.isfile(config_path):
+ try:
+ with open(config_path) as f:
+ key = json.load(f).get("apiKey", "")
+ except Exception:
+ pass
+ if not key:
+ return
- system = platform.system()
- if system == "Darwin":
- desktop_config = os.path.join(
- os.path.expanduser("~"), "Library", "Application Support", "Claude", "claude_desktop_config.json"
- )
- elif system == "Linux":
- desktop_config = os.path.join(
- os.path.expanduser("~"), ".config", "Claude", "claude_desktop_config.json"
- )
- elif system == "Windows":
- desktop_config = os.path.join(os.environ.get("APPDATA", ""), "Claude", "claude_desktop_config.json")
- else:
- desktop_config = ""
+ new_servers = {
+ "adsagent": {
+ "command": "npx",
+ "args": [
+ "-y",
+ "mcp-remote",
+ "https://www.adsagent.org/api/mcp",
+ "--transport",
+ "http-first",
+ "--header",
+ f"Authorization:Bearer {key}",
+ ],
+ }
+ }
+
+ print("MCP servers:")
+ configs_written = []
+
+ system = platform.system()
+ if system == "Darwin":
+ desktop_config = os.path.join(
+ os.path.expanduser("~"), "Library", "Application Support", "Claude", "claude_desktop_config.json"
+ )
+ elif system == "Linux":
+ desktop_config = os.path.join(
+ os.path.expanduser("~"), ".config", "Claude", "claude_desktop_config.json"
+ )
+ elif system == "Windows":
+ desktop_config = os.path.join(os.environ.get("APPDATA", ""), "Claude", "claude_desktop_config.json")
+ else:
+ desktop_config = ""
- if desktop_config:
- os.makedirs(os.path.dirname(desktop_config), exist_ok=True)
- config = {}
- if os.path.isfile(desktop_config):
- with open(desktop_config) as f:
- config = json.load(f)
- config.setdefault("mcpServers", {}).update(new_servers)
- with open(desktop_config, "w") as f:
- json.dump(config, f, indent=2)
- configs_written.append("Claude Desktop")
+ if desktop_config:
+ os.makedirs(os.path.dirname(desktop_config), exist_ok=True)
+ config = {}
+ if os.path.isfile(desktop_config):
+ with open(desktop_config) as f:
+ config = json.load(f)
+ config.setdefault("mcpServers", {}).update(new_servers)
+ with open(desktop_config, "w") as f:
+ json.dump(config, f, indent=2)
+ configs_written.append("Claude Desktop")
- if configs_written:
- print(f" configured: {', '.join(configs_written)}")
- for name in new_servers:
- print(f" + {name}")
+ if configs_written:
+ print(f" configured: {', '.join(configs_written)}")
+ for name in new_servers:
+ print(f" + {name}")
def prompt_google_ads_setup(skills):
"""Interactively set up Google Ads if the user wants it and stdin is a TTY."""
- # Check if any skill has a mcporter.json (i.e., needs MCP config)
- has_ads = any(
- os.path.isfile(os.path.join(TOPRANK_DIR, rel_path, "mcporter.json"))
- for _, rel_path in skills
- )
+ has_ads = any(rel_path.replace("\\", "/").startswith("google-ads/") for _, rel_path in skills)
if not has_ads:
return ""