Skip to main content

Overview

The Scope3 Agentic API v2 is built from the ground up for AI agents, providing both programmatic REST access and natural language interfaces through the Model Context Protocol (MCP). Whether you’re building agents or using them, Scope3 makes advertising operations conversational and intelligent.

REST API

Traditional HTTP REST API for programmatic integrations with standard HTTP methods.

MCP Protocol

Connect AI agents (Claude, ChatGPT, etc.) to manage campaigns through natural conversation.

Connection Methods

REST API

Standard HTTP REST API for traditional integrations:
EnvironmentBuyer Base URLPartner Base URL
Productionhttps://api.agentic.scope3.com/api/v2/buyerhttps://api.agentic.scope3.com/api/v2/partner
Staginghttps://api.agentic.staging.scope3.com/api/v2/buyerhttps://api.agentic.staging.scope3.com/api/v2/partner
Localhttp://localhost:4001/api/v2/buyerhttp://localhost:4001/api/v2/partner

MCP (Model Context Protocol)

For AI agent integrations using JSON-RPC 2.0:
EnvironmentBuyer MCP EndpointPartner MCP Endpoint
Productionhttps://api.agentic.scope3.com/mcp/v2/buyerhttps://api.agentic.scope3.com/mcp/v2/partner
Staginghttps://api.agentic.staging.scope3.com/mcp/v2/buyerhttps://api.agentic.staging.scope3.com/mcp/v2/partner
Localhttp://localhost:4001/mcp/v2/buyerhttp://localhost:4001/mcp/v2/partner

Available MCP Tools

The v2 Buyer MCP endpoint exposes 3 tools:
ToolPurpose
healthCheck API health and verify connectivity
ask_about_capabilityQuery the skill documentation to understand available endpoints
api_callMake authenticated REST API calls to any v2 endpoint
Workflow: AI agents first use ask_about_capability to learn about available endpoints, then use api_call to execute requests.

Testing Locally

Local Development Setup RequiredBefore testing with AI agents locally, ensure your local API server is running:
cd apps/api
pnpm dev
This starts the server at http://localhost:4001

Testing with Claude Desktop

For Claude Desktop with production API:Edit your Claude Desktop config file:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "scope3-buyer": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://api.agentic.scope3.com/mcp/v2/buyer"],
      "env": {
        "SCOPE3_API_KEY": "your-api-key-here"
      }
    }
  }
}
Restart Claude Desktop after saving.

Testing with Claude Code (CLI)

# Add the production MCP server
claude mcp add --transport http scope3-buyer https://api.agentic.scope3.com/mcp/v2/buyer

# Set your API key
export SCOPE3_API_KEY="your-api-key-here"

# Start Claude Code
claude
Then ask: “Use ask_about_capability to learn how to list advertisers, then use api_call to list them”

Testing with ChatGPT

Important: ChatGPT MCP connectors can only send OAuth Bearer tokens. Custom headers like x-scope3-api-key are not supported. You must use OAuth authentication.
Connect ChatGPT to Scope3 via MCP:
  1. Go to ChatGPT → SettingsMCP Connectors
  2. Click Add Connector
  3. Enter MCP Server URL: https://api.agentic.scope3.com/mcp/v2/buyer
  4. Select OAuth as the authentication method
  5. Complete the Scope3 login flow when prompted
  6. Once connected, you’ll have access to 3 tools:
    • health - Check API status
    • ask_about_capability - Learn about available endpoints
    • api_call - Make authenticated API calls
  7. Test with: “Use ask_about_capability to learn how to list advertisers”

Testing with Cursor

Configure Cursor with production API:
  1. Open Cursor Settings → MCP tab
  2. Add a new MCP server:
    • Name: scope3
    • URL: https://api.agentic.scope3.com/mcp/v2
    • Headers: Authorization: Bearer your-api-key
  3. Restart Cursor
  4. In chat, ask: “Use Scope3 tools to list advertisers”

Testing with curl (REST API)

# List advertisers
curl -X GET "https://api.agentic.scope3.com/api/v2/buyer/advertisers" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json"

# Create an advertiser
curl -X POST "https://api.agentic.scope3.com/api/v2/buyer/advertisers" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"name": "Test Advertiser", "description": "Created via API"}'

Testing MCP with curl

# Generate a session ID
SESSION_ID=$(uuidgen)

# Initialize MCP session
curl -X POST "https://api.agentic.scope3.com/mcp/v2/buyer" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -H "mcp-session-id: $SESSION_ID" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2024-11-05",
      "capabilities": {},
      "clientInfo": {"name": "curl-test", "version": "1.0"}
    }
  }'

# Call health tool
curl -X POST "https://api.agentic.scope3.com/mcp/v2/buyer" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -H "mcp-session-id: $SESSION_ID" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/call",
    "params": {
      "name": "health",
      "arguments": {}
    }
  }'

# Call api_call tool to list advertisers
curl -X POST "https://api.agentic.scope3.com/mcp/v2/buyer" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -H "mcp-session-id: $SESSION_ID" \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "api_call",
      "arguments": {
        "method": "GET",
        "endpoint": "/api/v2/buyer/advertisers"
      }
    }
  }'

What Your Agents Can Do

Once connected, AI agents use the 3 MCP tools to interact with the full REST API:

The Three Tools

ToolPurposeExample
healthVerify connectivityCheck if the API is responding
ask_about_capabilityLearn about endpoints”How do I create a campaign?”
api_callExecute API requestsPOST /api/v2/buyer/campaigns

Example Workflows

Advertiser Management:
  1. Agent asks ask_about_capability “How do I list advertisers?”
  2. Agent uses api_call with GET /api/v2/buyer/advertisers
Campaign Creation:
  1. Agent asks ask_about_capability “How do I create a performance campaign?”
  2. Agent learns about required fields (advertiserId, type, performanceConfig, etc.)
  3. Agent uses api_call with POST /api/v2/buyer/campaigns including the proper body
Example Prompts:
  • “First use ask_about_capability to learn about creating advertisers, then create one called Acme Corp”
  • “Check what campaigns exist for advertiser 24”
  • “Create a $100K performance campaign optimized for SALES”
  • “Launch the campaign we just created”

Building Custom Agents

Node.js Integration

// REST API example
const response = await fetch('https://api.agentic.scope3.com/api/v2/buyer/advertisers', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.SCOPE3_API_KEY}`,
    'Content-Type': 'application/json'
  }
});

const { data } = await response.json();
console.log('Advertisers:', data);

Python Integration

import requests
import os

# REST API example
response = requests.get(
    'https://api.agentic.scope3.com/api/v2/buyer/advertisers',
    headers={
        'Authorization': f'Bearer {os.environ["SCOPE3_API_KEY"]}',
        'Content-Type': 'application/json'
    }
)

advertisers = response.json()['data']
print('Advertisers:', advertisers)

MCP Client Example

import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { HttpClientTransport } from '@anthropic-ai/mcp-client-http';

const transport = new HttpClientTransport({
  url: 'https://api.agentic.scope3.com/mcp/v2/buyer',
  headers: {
    'Authorization': `Bearer ${process.env.SCOPE3_API_KEY}`
  }
});

const client = new Client({ name: 'my-agent', version: '1.0.0' });
await client.connect(transport);

// List available tools (health, ask_about_capability, api_call)
const tools = await client.listTools();
console.log('Available tools:', tools.tools.map(t => t.name));

// Check API health
const health = await client.callTool('health', {});
console.log('Health:', health);

// Learn about an endpoint
const docs = await client.callTool('ask_about_capability', {
  query: 'How do I create an advertiser?'
});
console.log('Documentation:', docs);

// Make an API call
const result = await client.callTool('api_call', {
  method: 'GET',
  endpoint: '/api/v2/buyer/advertisers'
});
console.log('Advertisers:', result);

Troubleshooting

Common Issues

Make sure your local API server is running:
cd apps/api && pnpm dev
Verify it’s listening on port 4001.
Check that:
  1. Your API key is valid
  2. The Authorization header is formatted as Bearer your-api-key
  3. For MCP, the mcp-session-id header is included
  1. Verify your claude_desktop_config.json is valid JSON
  2. Restart Claude Desktop completely (quit and reopen)
  3. Check Claude Desktop logs for errors
ChatGPT requires HTTPS. Use ngrok or a similar tunnel:
ngrok http 4001
Then use the ngrok HTTPS URL in your custom GPT.
MCP sessions have a timeout. Initialize a new session:
SESSION_ID=$(uuidgen)
# Then re-initialize with the new session ID

Next Steps