Five steps. Each one is a copy-paste away. By the end, your agent can create branded short URLs, track every click, and pull attribution back — all from any MCP client.
Go to your dashboard, open Developer → API keys, and provision a key. The plaintext value is shown once — copy it now.
export GO2_API_KEY="go2_..."
Pick the snippet for your agent client. The same npm package powers Claude Code, Claude Desktop, Cursor, Windsurf, and Codex over stdio.
claude mcp add go2 -- npx -y go2-mcp-server@latest \ --api-key "$GO2_API_KEY"
Stamp every link your agent creates with run-level identity. The MCP server reads these env vars on startup and applies them as fallbacks.
export GO2_AGENT_ID="claude-code" export GO2_AGENT_RUN_ID="$(uuidgen)" export GO2_AGENT_ACTOR_ID="user_42" # optional
Have your agent call track_agent_link, or POST directly to the API. The agent context propagates without you passing it on every call.
curl -X POST https://api.go2.gg/api/v1/links \
-H "Authorization: Bearer $GO2_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"destinationUrl": "https://example.com/dashboard",
"agentId": "claude-code",
"agentRunId": "run_2026_04_27_a1b2"
}'{ "shortUrl": "https://go2.gg/abc123", "id": "link_..." }Once someone clicks, pull the attribution stream. Filter by run, agent, or link. The same data is on /dashboard/agent-runs.
curl "https://api.go2.gg/api/v1/agent-attribution/runs" \ -H "Authorization: Bearer $GO2_API_KEY"
[{ "agentId": "claude-code", "agentRunId": "run_2026_04_27_a1b2", "clicks": 1, "lastClickAt": "..." }]Building your own agent runtime, or wiring Go2 into Mastra / Vercel AI SDK / LangChain tool calls? Skip the MCP server and use the typed TypeScript SDK.
import { Go2 } from "go2-sdk";
const go2 = new Go2({ apiKey: process.env.GO2_API_KEY! });
// Same agent attribution shape as the MCP tools
const link = await go2.links.create({
destinationUrl: "https://example.com/dashboard",
agentId: "my-agent",
agentRunId: "run_abc",
agentActorId: "user_42",
});
// Pull the click stream for that run
const { data: clicks } = await go2.agentAttribution.list({
agentRunId: "run_abc",
});Fully typed. Works in Node 18+, Bun, Deno, Cloudflare Workers. Full reference at npmjs.com/package/go2-sdk.