@attrkit/mcp
A stdio MCP server that exposes 39 tools — a thin client over AttriKit's public Management API for web-to-app attribution, letting an AI client manage apps, campaign links, spend, integrations and read profit decisions.
Key & usage: inspect key scope/plan (
whoami); read or set the workspace monthly install cap and alert email.Apps: list, create, get, update, archive iOS/Android apps; reveal or rotate the SDK publishable key.
Management keys: list masked keys, create read-only or read/write keys, revoke by id.
Campaign links: list links, create web-to-app tracking links (Meta/Google/TikTok), enable/disable and attach the ad network's campaign id.
Decisions & reporting: list campaigns and ads, get the engine's scale/cut/hold call verbatim, record a decision receipt, attribution rollup, per-user attribution lookup, recent events, and event delivery diagnostics (why an event didn't reach a network).
Spend & costs: read imported spend/cost models, import CSV/manual spend rows, pull spend from a connected network, version the app cost model.
Ad integrations: list/create/update/delete network connections, choose which source's event copy is forwarded per event family, and set
delivery_scope/renewal_event(Meta & TikTok).RevenueCat: read redacted status and webhook URL, configure provider app id and secrets.
Webhooks: list, create (SSRF-checked, secret returned once), delete outbound subscriptions.
Data export: export events/installs as capped v1 CSV or paged v2 wide CSV/NDJSON.
Server events: report a backend event for a user by
customer_user_id.
Provides an ad network integration for Google, supporting standard integration management while refusing attributed-only delivery scope and custom renewal event handling.
Provides an ad network integration for Meta, enabling creation, update, and deletion of integrations plus configuration of delivery scope and renewal event handling for install measurement.
Provides an ad network integration for TikTok, enabling creation, update, and deletion of integrations plus configuration of delivery scope and renewal event handling for install measurement.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@attrkit/mcp show me last week's attribution rollup by campaign"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@attrkit/mcp
A stdio MCP server for AttriKit, web-to-app attribution for iOS and Android apps that buy ads. Use it from Claude Code, Claude Desktop, Codex, Cursor, Gemini CLI, VS Code or Windsurf to create campaign links, import spend, read each campaign's scale, cut or hold call, and export installs and events. It is a thin client over AttriKit's public API. It holds no database access; your tenant scope is resolved from your secret management key.
Source: KamyarTaher/attrikit-mcp. Report an issue there or at contact@clashware.com. MIT licensed.
What it exposes
The server provides 39 tools.
Area | Tools |
Key scope |
|
Workspace usage |
|
Apps |
|
SDK keys |
|
Management keys |
|
Campaign links |
|
Decisions and reporting |
|
Spend and costs |
|
Ad integrations |
|
RevenueCat |
|
Outbound webhooks |
|
Data export |
|
Server events |
|
get_campaign_decision returns the engine's call verbatim. The model reports it;
it does not recompute it.
A Meta or TikTok integration has two delivery options. delivery_scope is all
(the default: every install with measurement consent, organic ones included) or
attributed (only installs AttriKit attributes to that network: a click ID, a link
token, or a Matched install at or above the delivery floor). renewal_event
is purchase (the default: a renewal is sent as Purchase) or custom (it is
sent as the custom event subscription_renewed, with its value). Set them on
create_integration, or later with update_integration and the action
set_delivery_options, which leaves the credential and status as they are. A
Google integration refuses attributed and custom.
delivery_scope_overrides sets the scope per country: an object of upper-case
country code to all or attributed, for example {"MX": "all"} to send every
install made in Mexico while delivery_scope stays attributed elsewhere. The
country is the install's own, taken from the request IP at its first open; an
install whose country has no entry, or has none, takes delivery_scope. On
set_delivery_options the object replaces the whole map, and {} clears it.
Related MCP server: Taskade MCP Server
Before you connect
Install Node.js 22 or newer. The npx -y @attrkit/mcp command downloads and
starts the server automatically, so no global install is required.
Node.js 22 is required from 2.0.0.
engines.nodeis>=22; 1.x accepted Node.js 18. If a client still starts the server with an older Node, upgrade Node, or pin@attrkit/mcp@1. The tools, their inputs and their outputs did not change.
Create the first workspace management key under Dashboard → Settings → API keys & MCP. This one-time bootstrap requires the dashboard.
After that first key exists, a workspace-scoped read/write key can manage every customer operation available through the Management API. This includes apps, delegated keys, usage caps, integrations, and exports.
Use a read-only or app-scoped key when the client needs less access. App-scoped keys cannot read or change the workspace usage cap, create sibling apps, or manage workspace-wide integrations.
Give the server the key
On macOS, store the key once in the Keychain:
npx -y @attrkit/mcp loginIt asks for the key with echo off, checks it against AttriKit (and prints the plan and scopes),
then stores it in the Keychain item attrkit-mcp. The key never appears in a process listing.
npx -y @attrkit/mcp logout removes the item.
On any system you can instead set ATTRKIT_API_KEY in the environment of the process that starts
your MCP client, or in the client's own secret store.
At start the server resolves the key in this order:
ATTRKIT_API_KEY, when it holds a real value.On macOS, the Keychain item
attrkit-mcp. An emptyATTRKIT_API_KEY, or one a client left unexpanded ($ATTRKIT_API_KEY,${ATTRKIT_API_KEY},${ATTRKIT_API_KEY:-},${env:ATTRKIT_API_KEY},${input:attrkit-key}), counts as unset.Otherwise it exits with an error that names the fix.
Codex
Add this server to ~/.codex/config.toml:
[mcp_servers.attrkit]
command = "npx"
args = ["-y", "@attrkit/mcp"]
env = { ATTRKIT_API_URL = "https://attrikit.io" }
env_vars = ["ATTRKIT_API_KEY"]codex mcp get attrkitSee the Codex setup guide.
Cursor
Add the server to .cursor/mcp.json for one project or ~/.cursor/mcp.json for
every project:
{
"mcpServers": {
"attrkit": {
"command": "npx",
"args": ["-y", "@attrkit/mcp"],
"env": {
"ATTRKIT_API_KEY": "${env:ATTRKIT_API_KEY}",
"ATTRKIT_API_URL": "https://attrikit.io"
}
}
}
}Then enable it and inspect the available tools:
cursor-agent mcp list
cursor-agent mcp list-tools attrkitSee the Cursor setup guide.
Gemini CLI
Add this server to ~/.gemini/settings.json:
{
"mcpServers": {
"attrkit": {
"command": "npx",
"args": ["-y", "@attrkit/mcp"],
"env": {
"ATTRKIT_API_KEY": "$ATTRKIT_API_KEY",
"ATTRKIT_API_URL": "https://attrikit.io"
}
}
}
}gemini mcp listSee the Gemini setup guide.
Other MCP clients
Configure a stdio server with command npx, arguments
["-y", "@attrkit/mcp"], and the ATTRKIT_API_KEY environment variable.
Environment-variable interpolation differs between clients, so follow the
client's secret-handling documentation. ATTRKIT_API_URL is optional and
defaults to https://attrikit.io.
Field naming
Tool input schemas are snake_case (bundle_id, store_url, campaign_id) and
double as REST documentation: the Management API accepts the same snake_case
field names in query strings and JSON request bodies (camelCase also works),
and responses are always snake_case. Field-level detail is returned under
error.fields when a validation failure can be attributed to specific fields.
Malformed JSON has no field to name. Self-identifying rejections such as
invalid_cursor, invalid_url, and ssrf_blocked return the code alone.
Test it locally
ATTRKIT_API_KEY=sk_... npx @modelcontextprotocol/inspector npx -y @attrkit/mcpThe Inspector lists the tools and lets you invoke them against your live workspace.
Access boundaries
Control | Management API and MCP |
Customer operations after the first key | Available with a workspace-scoped read/write key |
First workspace management key | Dashboard bootstrap only |
Billing and subscription | Not available |
Sign-in and organization membership | Not available |
Workspace deletion | Not available |
Internal administration | Not available |
See the Management API guide and OpenAPI contract for the complete HTTP surface.
Notes
stdio only. The package does not open a network port.
Key scopes gate reads vs writes. A read-only key gets
403 forbidden_scopeon every mutation.App-scoped keys cannot create other apps, reach sibling apps, or manage workspace-wide integrations.
App creation, management-key creation, and webhook creation return secret values once. Capture them from the tool result; list tools only return masked metadata.
Non-removal mutation tools accept an optional
idempotency_key. Reuse the same value only for an exact retry. One-time secret responses are encrypted at rest and safely replayed. Removal tools do not accept this parameter because their DELETE operations cannot apply the removal more than once.Management keys are protected by distributed per-key global, mutation, and expensive-operation limits. A
429response includesRetry-After; wait at least that many seconds before retrying.All diagnostics go to stderr. stdout is reserved for the MCP transport.
MCP clients store environment values in local configuration. Never commit a configuration containing a key. Restrict access to the file and revoke any key that is exposed.
Migration to 1.0.0
Version 1.0.0 formalizes tool input schemas, refines runtime configuration validation, and introduces three breaking restrictions from version 0.4.6:
Paired ad identifiers in
import_spend:adset_idandad_id(and their camelCase aliasesadsetIdandadId) must now be provided together or both omitted. At version 0.4.6 the schema accepted either field independently, but the underlying API rejected unpaired calls; version 1.0.0 moves this validation client-side.Strict UUID format for
campaign_idinrecord_campaign_decision:campaign_idmust now be a valid RFC 4122 UUID. Version 0.4.6 accepted arbitrary non-empty strings.Strict API base URL validation in
readConfig(ATTRKIT_API_URL):readConfigenforces four startup-fatal refusals (violations print to stderr and exit with code 1):Protocol refusal: Non-loopback HTTP endpoints are rejected (
protocol must be HTTPS, except HTTP is allowed for localhost development). HTTP is permitted only for loopback interfaces (localhost,127.0.0.1,[::1]); remote hosts must usehttps:.Credentials refusal: Embedded URL basic-auth credentials are rejected (
credentials are not allowed in ATTRKIT_API_URL). Pass API authentication viaATTRKIT_API_KEY.Query string refusal: Query parameters in the base URL are rejected (
query strings are not allowed in ATTRKIT_API_URL).Fragment refusal: Fragment identifiers in the base URL are rejected (
fragments are not allowed in ATTRKIT_API_URL). (In addition, malformed strings that fail URL parsing throwInvalid URLand exit 1).
Additionally, dot-segment ids escaped the app route under 0.4.6-style encoding; 1.0.0 keeps them inside the route across all seven app tools (get_app, update_app, archive_app, get_publishable_key, rotate_publishable_key, get_revenuecat, and configure_revenuecat).
See CHANGELOG.md for full release details.
License
MIT. See LICENSE.
Available Tools
39 toolsarchive_appArchive an appBDestructive
Archive an app and remove it from active customer operations.
Inputs: app_id (required).
configure_revenuecatConfigure RevenueCatADestructive
Store the RevenueCat provider app id and encrypted authorization secret for an app, and optionally the webhook signing secret (omitted, the stored one is kept).
Inputs: app_id (required), provider_app_id (required), authorization_secret (required), signing_secret, +1 more.
create_api_keyCreate a management keyA
Create a read-only or read/write workspace or app key. The secret is returned once.
Inputs: label (required), scopes (required), app_id, idempotency_key.
create_appCreate an appA
Create an iOS or Android app without the web UI. Returns the publishable key and a one-time app-scoped management key.
Inputs: name (required), platform (required), bundle_id (required), store_url (required), +3 more.
create_campaign_linkCreate a campaign tracking linkA
Create a web-to-app tracking link for an ad campaign. Requires a write-scoped API key. Returns the link: tracking_url is the campaign link to use in the ad (for meta the ad's Website URL, for tiktok the ad's destination, for google the tracking template with the App Store URL kept as the final URL); url is only the App Store destination you passed, never the link to put in an ad. tracking_url is null when the server has no link origin configured or the network is unrecognized; then create the link in AttriKit, Links.
Inputs: app_id (required), network (required), destination_url (required), campaign_id, +4 more.
create_integrationCreate an ad-network integrationA
Store encrypted network credentials and choose, for each of the eight event families (install, session, trial, subscription, purchase, refund, paywall, business), which source's copy AttriKit forwards to the network. AttriKit always does the sending; the owner only picks the copy. attrkit = the events your app reports through the AttriKit SDK (the RevenueCat copy of that family is dropped). revenuecat = the events AttriKit received from your RevenueCat webhook (the SDK copy is dropped); RevenueCat itself sends nothing to the network. customer = events your own servers post to AttriKit. If your app reports subscriptions only through RevenueCat, set trial, subscription, purchase and refund to revenuecat, or none of them reach the network. For Meta and TikTok, delivery_scope and renewal_event are optional; left out, the integration sends every install's events and renewals as Purchase.
Inputs: owners (required), network (required), credential (required), account_ref (required), +4 more.
create_webhookCreate an outbound webhookB
Create an SSRF-checked webhook subscription. Returns the signing secret once.
Inputs: url (required), event_types (required), app_id, description, +1 more.
delete_integrationDelete an ad-network integrationADestructive
Delete a disabled integration. Enabled integrations must be disabled first.
Inputs: connection_id (required).
delete_webhookDelete an outbound webhookCDestructive
Delete a webhook subscription.
Inputs: subscription_id (required).
export_eventsExport events and installsARead-onlyIdempotent
Export one app's events and installs for an inclusive date range. By default (version 1) the answer is the seven-column CSV, event rows capped at the 100,000 most recent INSIDE the range; narrow the range until it is safely below that cap when a complete snapshot is required. Pass version 2 for the wide record export (campaign, ad, evidence and revenue columns), oldest first, as csv or ndjson and paged: each page holds up to limit records (10,000 by default), and when another page follows the result carries next_cursor, which you send back as cursor with the same app_id, from and to. No next_cursor means the last page.
Inputs: to (required), from (required), app_id (required), limit, +3 more.
get_appGet an appBRead-onlyIdempotent
Return one app's configuration.
Inputs: app_id (required).
get_attribution_rollupGet attribution rollupARead-onlyIdempotent
Return the account-level attribution overview: installs accounted-for by evidence class (verified / matched / modeled / organic), MER, revenue and data freshness.
Inputs: to, from, app_id, period.
get_campaign_decisionGet campaign decisions (scale / cut / hold)ARead-onlyIdempotent
Return AttriKit's profit DECISIONS for your campaigns: the scale/cut/hold call and confidence, computed by the attribution engine. Report the call VERBATIM — do not recompute or override it; when it says not_enough_data, say so. This is the tool to drive budget automation.
Inputs: limit, app_id, cursor, period.
get_publishable_keyGet an app publishable keyBRead-onlyIdempotent
Reveal the recoverable SDK publishable key for an app.
Inputs: app_id (required).
get_revenuecatGet RevenueCat configurationBRead-onlyIdempotent
Return redacted RevenueCat status and the AttriKit webhook URL.
Inputs: app_id (required).
get_spendGet spend and cost modelsARead-onlyIdempotent
Return imported ad spend, cost models, completeness and spend freshness. Without from, to or cursor every row comes back at once; with any of them the rows are paged, ordered by network, campaign, ad set, ad and day, and next_cursor is null on the last page.
Inputs: to, from, limit, app_id, +1 more.
get_usage_capGet the workspace usage capARead-onlyIdempotent
Return the workspace's monthly qualified-install cap, alert email, current billing period and usage. Requires a workspace-scoped read key.
Inputs: no named parameters.
import_spendImport ad spendC
Import campaign or creative-level spend rows.
Inputs: rows (required), app_id (required), network (required), currency (required), +8 more.
list_adsList creative-level ad performanceCRead-onlyIdempotent
Return ad and ad-set performance, evidence tiers, ROAS, CPA, CPC and modeled remainders.
Inputs: to, from, limit, app_id, +2 more.
list_api_keysList management keysARead-onlyIdempotent
List masked workspace and app management keys. Secret plaintext is never returned.
Inputs: no named parameters.
list_appsList appsARead-onlyIdempotent
List the iOS and Android apps in your AttriKit workspace (id, name, platform, bundle id, store id, status).
Inputs: limit, cursor.
list_campaignsList campaignsARead-onlyIdempotent
List ad campaigns with their honest profit surface. call preserves the original v1 fail-closed automation behavior for multi-component rows; recommended_call is the additive SCALE/CUT/HOLD recommendation the current engine made. It is backed by envelope_lower/envelope_central/envelope_upper. Read aggregation_basis before quoting the low end: single_component_quantiles means it is a calibrated 5th percentile; marginal_endpoint_sum_no_joint_coverage means it is the sum of each component period's own low end, which is pessimistic against independence but is NOT a floor or a guarantee, so describe it as a scenario. The quantile-named profit_p05/profit_p50/profit_p95 are null unless one component supplied calibrated ones. Also includes spend, retention, and payback.
Inputs: to, from, limit, app_id, +2 more.
list_event_deliveriesList what happened to each event sent to ad networksARead-onlyIdempotent
Return one row per delivery of an event to a network connection, newest first: its state (held, queued, sending, retrying, sent, suppressed or failed), the reason with a one-line explanation (for example consent_suppressed, attributed_only_suppressed or destination_event_too_old), attempts, the last HTTP status, and for a held row when it is expected to be released. Use it to answer why an event did not reach Meta, TikTok or Google. Read scope is enough.
Inputs: app_id (required), to, from, limit, +6 more.
list_integrationsList ad-network integrationsARead-onlyIdempotent
List redacted ad-network connections and their readiness.
Inputs: no named parameters.
list_linksList campaign linksBRead-onlyIdempotent
List tracking links, optionally for one app. Each link's tracking_url is the campaign link to use in the ad (null if unavailable); url is the store destination.
Inputs: limit, app_id, cursor.
list_recent_eventsList recent events and installsBRead-onlyIdempotent
Return the same recent attribution events and installs visible on the Live dashboard.
Inputs: to, from, limit, app_id, +1 more.
list_webhooksList outbound webhooksBRead-onlyIdempotent
List redacted outbound webhook subscriptions.
Inputs: no named parameters.
lookup_customer_attributionLook up a user's attributionARead-onlyIdempotent
Look up the attribution of one of your users by the customer_user_id your app passed to AttriKit.setUserID: the campaign, ad set, ad, network, match confidence and attribution_status (attributed, device_matched, organic, pending or consent_required) of the user's newest install. 404 customer_user_not_found means no install identified with this id. Read scope is enough.
Inputs: app_id (required), customer_user_id (required).
pull_network_spendPull spend from an ad networkA
Fetch and import creative-level spend from a configured Meta, Google or TikTok connection. AttriKit already pulls every enabled connection every 6 hours, covering today and the 3 days before; call this for an immediate pull or a longer window. Report rows are kept only for campaigns whose network id AttriKit knows (create_campaign_link.network_campaign_id); if none match, the call fails and imports nothing. A network reports rows only for ads that have delivered, so the first useful pull is after the ads start spending.
Inputs: app_id (required), network (required), covers_to (required), covers_from (required), +2 more.
record_campaign_decisionRecord a campaign decisionA
Record a scale/cut/hold decision for the reporting period the caller reviewed. AttriKit freezes that period's current campaign range, spend, costs, revenue basis, and model version server-side; callers cannot author receipt provenance.
Inputs: call (required), app_id (required), campaign_id (required), period, +1 more.
revoke_api_keyRevoke a management keyBDestructive
Immediately revoke a management key by id.
Inputs: key_id (required).
rotate_publishable_keyRotate an app publishable keyADestructive
Issue a new SDK publishable key and return the old-key grace deadline.
Inputs: app_id (required), idempotency_key.
send_server_eventReport an event from your backendAIdempotent
Report an event for one of your users from your own backend, by the customer_user_id your app passed to AttriKit.setUserID; no device installation id is needed. The event is attached to the install that id resolves to and reaches the destinations whose sender for its family is Your servers. Requires a write-scoped API key. Answers status accepted, duplicate (this event_id was already stored) or suppressed (consent.measurement is not granted, so nothing was collected), with the install_epoch_id it resolved to. 404 customer_user_not_found means no install identified with this id.
Inputs: app_id (required), consent (required), event_id (required), event_name (required), +5 more.
set_cost_modelSet an app cost modelC
Version commission, payment fees and variable COGS used in profit decisions.
Inputs: app_id (required), effective_at (required), payment_fee_bps (required), variable_cogs_kind (required), +4 more.
set_usage_capSet the workspace usage capADestructive
Set a monthly qualified-install cap of at least 10,000 and its alert email. Pass null for both values to clear the cap. Requires a workspace-scoped write key.
Inputs: alert_email (required), monthly_qualified_install_cap (required), idempotency_key.
update_appUpdate an appC
Update app metadata, store destination, timezone or coverage mode.
Inputs: app_id (required), name, platform, timezone, +4 more.
update_integrationUpdate an ad-network integrationA
Rotate credentials or enable/disable an integration. set_delivery_options changes delivery_scope, renewal_event or both on a Meta or TikTok integration, in any status, without touching its credential or status; give at least one of the two.
Inputs: action (required), connection_id (required), owners, credential, +3 more.
update_link_statusEnable or disable a campaign link, or attach its network campaign idA
Change a tracking link between active and disabled, and/or attach the ad network's own campaign id to a link created without one (then pull_network_spend can match its spend). Send status, network_campaign_id, or both. A campaign that already has a different network id is refused with 409 network_campaign_conflict.
Inputs: link_id (required), status, idempotency_key, network_campaign_id.
whoamiInspect management-key scopeARead-onlyIdempotent
Return the authenticated workspace, plan, app restriction and read/write scopes.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 39 tools
Most tools are clearly separated by resource and action (apps, API keys, integrations, links, spend, events, webhooks), and the descriptions add useful distinguishing detail. A few analytics tools overlap: list_campaigns exposes recommendation/profit fields also surfaced by get_campaign_decision, and list_ads/get_spend both touch performance and spend, so agents may need to read descriptions carefully.
Names are overwhelmingly lowercase snake_case with a verb_noun pattern (list_apps, create_integration, update_link_status), making the set predictable. Exceptions like whoami and minor verb choices such as archive versus delete or get versus lookup are still readable and semantically reasonable.
39 tools is well above the 3-15 well-scoped range and makes this a heavy MCP surface. Although the platform is broad, the tool count likely needs splitting or consolidation into more focused servers.
Coverage spans app lifecycle, API keys, integrations, links, campaigns/decisions, spend, events, webhooks, RevenueCat, and usage caps, so core workflows are mostly complete. Minor gaps remain: no app delete (archive only), no link delete, no webhook update, and no single-resource getters for some resources.
Maintenance
Related MCP Connectors
Apple Search Ads MCP: campaign analytics, bid management, and attribution tracking.
Marketing-measurement MCP: dashboards, cross-channel queries, integrations, and knowledge files.
Discover MCP servers and A2A agents; verify, message, post, follow, react, and receive webhooks.
The world's public data, one API. License-cleared public data sources for agents, via MCP and REST.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables MCP clients such as Claude, Codex, and Cursor to read projects, monitors, captured AI answers, account/plan usage, and AI-referral analytics, and to set up projects, monitors, goals, and analytics properties. It also supports checking tracking-snippet verification, with monitor creation starting metered runs that consume credits.2043 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables clients such as Claude, Cursor, VS Code, and Windsurf to manage workspaces, projects, tasks, and AI agents through a hosted OAuth endpoint or a local stdio package, and to generate MCP tools from OpenAPI specs.2,530 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables managing Meta advertising accounts, campaigns, ad sets, creatives, audiences, reporting, and batch workflows through an authenticated MCP endpoint with per-workspace OAuth connections.39 npmMIT
- AlicenseAqualityBmaintenanceEnables MCP-compatible clients to query advertising data, analyze spend, conversions, and audiences, compare campaigns, generate dashboards, and manage campaigns with optional read-only safeguards.28Apache 2.0