Go2
  • Pricing
  • Docs
  • Blog
5 minutes · Copy-pasteable

Wire your agent's link toolkit.

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.

  1. 1

    Get an API key

    Go to your dashboard, open Developer → API keys, and provision a key. The plaintext value is shown once — copy it now.

    shell
    export GO2_API_KEY="go2_..."
  2. 2

    Install the MCP server

    Pick the snippet for your agent client. The same npm package powers Claude Code, Claude Desktop, Cursor, Windsurf, and Codex over stdio.

    Claude Code (or paste the JSON config into your client)
    claude mcp add go2 -- npx -y go2-mcp-server@latest \
      --api-key "$GO2_API_KEY"
  3. 3

    Set ambient agent context

    Stamp every link your agent creates with run-level identity. The MCP server reads these env vars on startup and applies them as fallbacks.

    shell
    export GO2_AGENT_ID="claude-code"
    export GO2_AGENT_RUN_ID="$(uuidgen)"
    export GO2_AGENT_ACTOR_ID="user_42"   # optional
  4. 4

    Track your first link

    Have your agent call track_agent_link, or POST directly to the API. The agent context propagates without you passing it on every call.

    REST
    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_..." }
  5. 5

    Query attribution

    Once someone clicks, pull the attribution stream. Filter by run, agent, or link. The same data is on /dashboard/agent-runs.

    REST
    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": "..." }]

Not using MCP? Use the SDK directly.

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.

npm install go2-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.

Where to next

API reference

Full schemas, scopes, and curl examples for every endpoint.

MCP server docs

All tools, transports, OAuth flow, and per-client configs.

The pitch

Why per-run attribution is the missing primitive — with use cases and the Dub comparison.

GitHub

Star, fork, file issues. The whole stack is AGPL.

Stuck on a step? Open an issue on GitHub or DM us. We're shipping in public.

Go2

Links for AI agents. Per-run attribution, MCP server, edge-native API. Built on Cloudflare. Open source.

Get our weekly post on agent attribution patterns

for agents

  • Overview
  • 5-min Quickstart
  • MCP Server (npm)
  • TypeScript SDK (npm)
  • REST API
  • vs. Dub.co
  • AGENTS.md & Skills

product

  • Features
  • Analytics
  • Custom Domains
  • QR Codes
  • Pricing

solutions

  • For Agencies
  • For Creators
  • For Developers
  • Enterprise

resources

  • Documentation
  • Blog
  • Help Center
  • llms.txt
  • OpenAPI

company

  • About
  • Contact
  • Changelog
  • Status
  • GitHub

© 2026 Go2. All rights reserved.

X (Twitter)GitHubPrivacyTermsCookiesAcceptable UseDPA
All systems operational