Affise MCP server › Local server

Run the Affise MCP server on your own machine

The same tools, as a package you install yourself. Your Affise key stays on your machine and requests go straight from it to the Affise API — nothing of ours sits in the path. About five minutes.

npm install -g @affise/mcp-server
Auth: Your own Affise API key, in your client’s config Tools you get: 24, all read-only Time: about five minutes

Before you start

What you need

An Affise API key, a client that can launch a local MCP server — Claude Desktop, Claude Code, Cursor and most others can — and either Node.js 18 or newer, or Docker if you would rather run it in a container.

Setup

1

Choose how it runs

Four routes to the same server. From npm is the one to take unless you have a reason not to.

1 · Let your client fetch it — nothing to install; the client runs npx for you. The first launch downloads the package, so give it a moment.

2 · Install it once, which puts an affise-mcp-server command on your PATH:
npm install -g @affise/mcp-server
3 · Build from source, if you want to read or change what you run:
git clone https://github.com/affise/mcp-affise.git
cd mcp-affise
npm install
npm run build          # compiles to build/index.js
4 · Build a container, if your policy is that everything runs in one:
git clone https://github.com/affise/mcp-affise.git
cd mcp-affise
docker build -t affise-mcp-server .
One thing to know before you reach for docker compose up -d: this server speaks stdio, meaning your client starts it and talks to it over the process’s own input and output. A detached container has nobody on the other end of that pipe. So the client launches docker run --rm -i itself, once per session — the config block in step 3 does exactly that. The docker-compose.yml in the repository is left over from a different arrangement and is not the way to run this.
2

Get an Affise API key

In your Affise dashboard: SettingsAPI, then generate a key. Note your instance URL too — it is the https://api-yourcompany.affise.com form, not the dashboard address you log into. What the key reaches is what the server reaches: an admin key sees network-wide data, an affiliate key only that affiliate’s own.
3

Point your client at it

In Claude Desktop, open SettingsDeveloperEdit Config, or edit claude_desktop_config.json directly. Use the block that matches the route you picked.

npx — nothing installed:
{
  "mcpServers": {
    "affise": {
      "command": "npx",
      "args": ["-y", "@affise/mcp-server"],
      "env": {
        "AFFISE_BASE_URL": "https://api-yourcompany.affise.com",
        "AFFISE_API_KEY": "your_api_key"
      }
    }
  }
}
Global install — same block, but "command": "affise-mcp-server" and no args.

From source — point at the file you built, by absolute path:
"command": "node",
"args": ["/absolute/path/to/mcp-affise/build/index.js"]
Docker — the client runs the container per session. The bare -e NAME form forwards the value from the env block below it:
{
  "mcpServers": {
    "affise": {
      "command": "docker",
      "args": ["run", "--rm", "-i",
               "-e", "AFFISE_BASE_URL",
               "-e", "AFFISE_API_KEY",
               "affise-mcp-server"],
      "env": {
        "AFFISE_BASE_URL": "https://api-yourcompany.affise.com",
        "AFFISE_API_KEY": "your_api_key"
      }
    }
  }
}
Whichever you use, the env block is not optional: a desktop app does not inherit your terminal’s environment, so a key exported in your shell will never reach it. Restart the client afterwards.

Claude Desktop users can skip the JSON entirely — download mcp-affise.dxt from the GitHub repository and drag it into SettingsExtensions, which asks for the URL and key in a form.
4

Check it worked

Ask “Using Affise, show me the top 5 offers by revenue last week.” To test before wiring up a client, run the server by hand and send it a single message:
printf '%s\n' '{"jsonrpc":"2.0","id":0,"method":"initialize",
  "params":{"protocolVersion":"2025-06-18","capabilities":{},
  "clientInfo":{"name":"smoke","version":"1"}}}' \
  | AFFISE_BASE_URL=https://api-yourcompany.affise.com \
    AFFISE_API_KEY=your_api_key npx -y @affise/mcp-server
A working install prints a JSON result line and then waits for more input — normal for a stdio server, so press Ctrl+C to stop it. Progress traces go to stderr and start with [affise-mcp].
5

Know what differs from the hosted endpoint

The same tools, minus the credential form — the hosted server needs that because it has nowhere else to take a key from, and here the key is already in your config. So you get 24 tools and 6 prompts rather than 25 tools. There is no OAuth and no session: your key sits in your client’s config file in plain text, so treat that file as a secret. Updates are yours to take — npm update -g @affise/mcp-server, or nothing at all if your client fetches it fresh each launch.

Check it worked

Ask “Using Affise, what were my conversions yesterday?” A working install answers with real numbers. If your assistant says it has no Affise tools, the client has not been restarted or the config file has a syntax error.

If something goes wrong

The client lists the server but no tools appear+
Almost always the credentials. Check that AFFISE_BASE_URL and AFFISE_API_KEY sit inside the env block of the config rather than exported in your shell — a desktop app does not see your shell environment. And the base URL is the API host (api-yourcompany.affise.com), not the dashboard.
command not found: affise-mcp-server+
The global install put the binary somewhere off your PATH. Either use the npx form above, which needs nothing on PATH, or run npm bin -g to find the directory and add it.
Every tool answers with a permissions error+
Your key is an affiliate key and the question needs network-wide data, or the reverse. Admin keys reach stats, the partner and advertiser roster and per-conversion detail; affiliate keys reach only that affiliate’s own profile, balance, offers and sub-IDs.
It worked yesterday and stopped today+
If your client launches it through npx, it may have picked up a new release. Pin a version in args["-y", "@affise/[email protected]"] — to take updates on your own schedule.
The container starts and nothing happens+
Check the client is launching it with docker run --rm -i, not leaving one running in the background. This server talks over the process’s own input and output, so a detached container has nobody on the other end. If you started it with docker compose up -d, stop it and use the config block in step 3 instead.
You would rather not run anything+
Use the hosted endpoint instead: paste https://mcp.affise.com/mcp into your client and sign in. Nothing to install, and nothing to keep up to date.

Try these first

Once you are connected, these are good first questions. See more examples or the full tool reference.

  • Which offers grew fastest in DE last week compared to the week before?
  • Analyze partner 193 for August — where are they losing money?
  • Find finance offers accepting UK mobile traffic with a payout over $40.