MCP / agents
adscapi ships an MCP server over stdio. Point any MCP client at it and an agent can list platforms, verify tokens, and fire conversions without writing integration code.
Add the server
Claude Code:
shell
claude mcp add adscapi -- npx -y adscapi mcp
Cursor, Codex CLI, Gemini CLI, opencode — same command in MCP config:
jsonc
// .mcp.json (Cursor, Codex CLI, Gemini CLI, opencode, …)
{
"mcpServers": {
"adscapi": {
"command": "npx",
"args": ["-y", "adscapi", "mcp"]
}
}
}Environment
The server reads platform tokens from its own process environment — not from the chat. Export them where the client launches the server.
shell
# The MCP server process needs the platform tokens in its own environment. # Export them in the shell that launches the client, or set env in the MCP config: export META_CAPI_TOKEN=… export META_PIXEL_ID=… # …etc — `adscapi_platforms` lists every name
Tools
| Tool | What it does |
|---|---|
| adscapi_platforms | List every destination, support level, and required secrets |
| adscapi_check | Which platforms are configured right now (secrets present) |
| adscapi_verify | Live-check that a configured token actually works (optional platform arg) |
| adscapi_track | Fire one canonical conversion to every configured platform |
Wiring loop
The same loop a human follows — agents should too:
text
1. adscapi_platforms → what's supported + secret names 2. adscapi_check → what's already configured 3. Set missing tokens (see /docs/platforms/<key>) 4. adscapi_verify → confirm tokens before trusting them 5. adscapi_track with dryRun: true → confirm the fan-out 6. adscapi_track for real at the conversion point
json
// adscapi_track arguments
{
"event": "purchase", // required — canonical name
"value": 49,
"currency": "USD",
"email": "buyer@example.com", // raw — adscapi hashes per platform
"dryRun": true // log fan-out without sending
}check = secrets present; verify = secrets valid. Prefer verify before telling a user tracking is live. Never ask the user to pre-hash PII — adscapi hashes per platform.