🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@kadam-net/mcp-server

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kadam-net/mcp-server

MCP server for Kadam ad network — manage campaigns, creatives, audiences, sites, and analytics via AI agents

latest
Source
npmnpm
Version
0.6.1
Version published
Maintainers
2
Created
Source

@kadam-net/mcp-server

npm version npm downloads license node MCP Registry

MCP server for Kadam ad network — manage campaigns, creatives, audiences, sites, and analytics via AI agents.

Built on the Model Context Protocol (MCP), the open standard for connecting LLMs to external tools and data.

Install (one click)

Cursor

Install in Cursor

Or add manually to .cursor/mcp.json:

{
  "mcpServers": {
    "kadam": {
      "command": "npx",
      "args": ["-y", "@kadam-net/mcp-server"],
      "env": {
        "KADAM_ADV_API_KEY": "your-advertiser-api-key",
        "KADAM_PUB_API_KEY": "your-publisher-api-key"
      }
    }
  }
}

Claude Code

claude mcp add kadam -- npx -y @kadam-net/mcp-server

Then set the env var: export KADAM_ADV_API_KEY=your-key

Claude Desktop

Download for Claude Desktop

Download → double-click → Install. Or add manually to claude_desktop_config.json (Settings → Developer → Edit Config):

{
  "mcpServers": {
    "kadam": {
      "command": "npx",
      "args": ["-y", "@kadam-net/mcp-server"],
      "env": {
        "KADAM_ADV_API_KEY": "your-advertiser-api-key",
        "KADAM_PUB_API_KEY": "your-publisher-api-key"
      }
    }
  }
}

Any MCP client (universal one-liner)

npx add-mcp @kadam-net/mcp-server

Docker

docker run -i --rm \
  -e KADAM_ADV_API_KEY=your-key \
  kadam/mcp-server:latest

npm global

npm install -g @kadam-net/mcp-server
KADAM_ADV_API_KEY=your-key kadam-mcp-server

Configuration

VariableRequiredDescription
KADAM_ADV_API_KEYOne of twoAdvertiser API key from partners.kadam.net -> Profile -> API
KADAM_PUB_API_KEYOne of twoPublisher API key from pub.kadam.net -> Profile -> API
KADAM_ADV_API_BASENoAdvertiser API URL (default: https://partners.kadam.net/api/v1)
KADAM_PUB_API_BASENoPublisher API URL (default: https://pub.kadam.net/api)
LOG_LEVELNoLog level: trace, debug, info, warn, error, fatal (default: info)

At least one API key must be provided in stdio mode. In HTTP mode, tokens are passed per-request via Bearer authentication.

HTTP Transport (multi-tenant deployment)

For server-side deployment serving multiple users:

VariableRequiredDescription
MCP_TRANSPORTNo"stdio" (default) or "http"
MCP_HTTP_PORTNoHTTP port (default: 8080)
MCP_HTTP_HOSTNoBind address (default: 0.0.0.0)
KADAM_ADV_DOMAINNoAdvertiser domain for PRM (default: https://partners.kadam.net)
KADAM_PUB_DOMAINNoPublisher domain for PRM (default: https://pub.kadam.net)
docker run -d --name kadam-mcp \
  -e MCP_TRANSPORT=http \
  -p 8080:8080 \
  kadam/mcp-server:latest

Connecting via HTTP (Cursor / Claude)

{
  "mcpServers": {
    "kadam-adv": {
      "url": "https://partners.kadam.net/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_ADV_API_KEY"
      }
    }
  }
}

Connecting via OAuth (ChatGPT)

Add https://partners.kadam.net/mcp (advertiser) or https://pub.kadam.net/mcp (publisher) as Server URL in ChatGPT settings. OAuth discovery, registration, and login happen automatically.

Tools (31)

Advertiser Tools (22)

Requires KADAM_ADV_API_KEY.

Campaigns

ToolDescriptionAnnotations
kadam_adv_list_campaignsList campaigns with filters (folder, status, type, date, search) and paginationreadOnly
kadam_adv_get_campaignGet full campaign configuration by ID: landing page URL, bids per country, budgets, targeting, frequency caps, schedule, conversion settingsreadOnly
kadam_adv_create_campaignCreate campaign with full targeting (countries, devices, OS, browsers, age, gender, audiences)
kadam_adv_update_campaignUpdate any campaign fields by ID
kadam_adv_set_campaign_statusBulk status change (active/paused/archived) for comma-separated IDsidempotent

Bid Management

ToolDescriptionAnnotations
kadam_adv_update_campaign_bidUpdate bid for a single campaign (lightweight, no full payload). Falls back to current countries if omittedidempotent
kadam_adv_bulk_update_bidsUpdate bids for multiple campaigns at once (all must share the same pricing model)idempotent
kadam_adv_update_site_bidsSet per-site (zone) bids: static (0.05), multiplier (x1.5), or remove (0)idempotent

Campaign Folders

ToolDescriptionAnnotations
kadam_adv_list_campaign_foldersList folders with campaign counts and budgetsreadOnly
kadam_adv_create_campaign_folderCreate a new folder (name min 4 chars)
kadam_adv_update_campaign_folderUpdate folder budgets and distribution

Creatives

ToolDescriptionAnnotations
kadam_adv_list_creativesList creatives by campaign, status, or search queryreadOnly
kadam_adv_create_creativeCreate creative for a campaign (goes through moderation)
kadam_adv_update_creativeUpdate creative fields
kadam_adv_set_creative_statusBulk status change for creativesidempotent

Audiences

ToolDescriptionAnnotations
kadam_adv_list_audiencesList audiences with search and sortingreadOnly
kadam_adv_get_audienceGet detailed audience info by IDreadOnly
kadam_adv_create_audienceCreate audience (pixel, code, fingerprint, or S2S)
kadam_adv_update_audienceUpdate audience settings
kadam_adv_delete_audienceDelete audience permanently (requires confirm: true)destructive

Finance & Statistics

ToolDescriptionAnnotations
kadam_adv_list_finance_operationsTransaction history (deposits, charges, refunds)readOnly
kadam_adv_get_statsUnified statistics — 3 report types via reportType param: custom (report builder with dimension/metric mapping), sites (per-site breakdown), postbacks (conversion logs)readOnly

Publisher Tools (9)

Requires KADAM_PUB_API_KEY.

Sites (Sources)

ToolDescriptionAnnotations
kadam_pub_list_sourcesList publisher sites with statsreadOnly
kadam_pub_create_sourceAdd a new site (starts verification flow)
kadam_pub_get_sourceGet detailed site inforeadOnly
kadam_pub_update_sourceUpdate site name
kadam_pub_set_source_statusChange site status (active/paused/archived/unarchived)idempotent

Ad Units

ToolDescriptionAnnotations
kadam_pub_list_ad_unitsList ad units for a site, filter by format (native/banner/push/popunder/inpagepush)readOnly
kadam_pub_set_ad_unit_statusChange ad unit status (active/paused/archived/restored)idempotent

User & Statistics

ToolDescriptionAnnotations
kadam_pub_get_user_infoGet publisher account info and balancereadOnly
kadam_pub_get_statsPublisher statistics with human-readable dimension/metric mappingreadOnly

Resources (7)

Static reference data the agent can read before calling tools:

URIDescription
kadam://reference/campaign-typesAll ad format types with IDs, features, pricing, and creative specs
kadam://reference/pricing-modelsCPC, CPM, CPV, CPA Target with IDs and descriptions
kadam://reference/creative-formatsCreative requirements per campaign type
kadam://reference/ad-unit-typesPublisher ad unit formats with IDs
kadam://reference/site-statesPublisher site lifecycle states
kadam://reference/report-dimensionsAvailable dimensions and metrics for statistics tools
kadam://reference/api-overviewGeneral Kadam API capabilities overview

Prompts (4)

Pre-built workflow templates that guide the agent through multi-step operations:

PromptDescriptionArguments
kadam_launch_campaignStep-by-step campaign creation (check types -> create folder -> create campaign -> add creatives)type, name, url, budget
kadam_campaign_performanceCampaign performance analysis with optimization recommendationscampaignId, period
kadam_optimize_sitesAnalyze site performance and suggest blacklist/whitelist changescampaignId, minClicks, maxCPA
kadam_account_overviewFull account overview — campaigns, spend, top performers

Architecture

src/
├── index.ts                  # Entry point, server instructions, transport
├── config.ts                 # Zod-validated env config with cache
├── errors.ts                 # AuthError class
├── logger.ts                 # Pino structured logging (stderr)
├── output-formatter.ts       # Text formatting + 50KB truncation
├── middleware/
│   └── tool-wrapper.ts       # Auth, error handling, logging middleware
├── api/
│   ├── http-client.ts        # Generic HTTP client with retry/429/timeout
│   ├── partners-client.ts    # Advertiser API (lazy singleton)
│   └── pub-client.ts         # Publisher API (lazy singleton)
├── utils/
│   ├── pagination.ts         # Shared pagination extraction
│   ├── cache-once.ts         # Generic async cache-once utility
│   └── dimension-mapper.ts   # Stats dimension name→ID resolution
├── types/
│   ├── common.ts             # Shared types (ApiListResponse, ReportConfig)
│   ├── advertiser.ts         # Campaign, Creative, Audience types + maps
│   ├── publisher.ts          # Source, AdUnit, PubUser types + maps
│   └── tool-module.ts        # ToolModule interface
├── tools/
│   ├── advertiser/           # 21 tools across 6 modules
│   └── publisher/            # 9 tools across 4 modules
├── resources/                # 7 static reference resources
└── prompts/                  # 4 workflow prompts

Key Design Decisions

  • ToolWrapper middleware — centralized auth validation, error formatting, and logging for all 30 tools
  • Lazy singleton API clients — one HttpClient instance per product, created on first use
  • Output truncation — hard 50KB limit per response with maxResults (default 25, max 100) to prevent LLM context overflow
  • Human-readable output — formatted tables, aligned entities, pagination metadata instead of raw JSON
  • Tool annotationsreadOnlyHint, destructiveHint, idempotentHint to guide agent behavior
  • Server instructions — usage patterns and constraints sent to the LLM on connection
  • Dimension mapping — stats tools accept human-readable names ("clicks", "spend") and resolve them to API IDs internally

Development

Prerequisites

  • Node.js >= 18
  • npm

Setup

git clone https://github.com/kadam-official/mcp-server.git
cd mcp-server
npm install
cp .env.example .env  # Fill in your API keys

Commands

npm run dev             # Watch mode with tsx
npm run build           # Production build with Vite
npm run start           # Run built server
npm run typecheck       # TypeScript check
npm run lint            # ESLint
npm run format          # Prettier
npm test                # Run 82 tests
npm run test:coverage   # Tests with V8 coverage
npm run inspect         # MCP Inspector (visual debugger)

Testing

202 tests across 23 files using Vitest + MCP SDK InMemoryTransport:

  • Unit tests — output formatter, config, HTTP client (mocked fetch)
  • Middleware tests — ToolWrapper auth, error formatting, logging
  • Integration tests — full server with all 30 tools, 7 resources, 4 prompts via in-memory MCP client
  • Tool handler tests — each tool module with mocked API clients
npm test
# Test Files  23 passed (23)
#      Tests  202 passed (202)

MCP Inspector

The MCP Inspector provides a visual interface for testing:

npm run build
npm run inspect

Deployment

Docker

docker build -t kadam-mcp-server .
docker run -i --rm -e KADAM_ADV_API_KEY=... kadam-mcp-server

CI/CD

The .gitlab-ci.yml pipeline includes:

  • lint — ESLint + TypeScript check
  • test — Vitest with coverage
  • build — Vite production build
  • publish — npm publish + Docker push (manual trigger)

License

MIT

Keywords

mcp

FAQs

Package last updated on 30 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts