Developer & Partner API Docs

Trusted Partner MCP Server & CRO Engine Documentation

Complete technical reference for Model Context Protocol (MCP) tools, HMAC authentication, D1 database schema, and KnowYourModel reputation tracking.

🔐 Authentication & HMAC Request Signing

Every MCP request to https://tpmcp-dev.nexartis.com must include partner credentials and HMAC signature headers:

X-Partner-Key: bgca_partner_key_01
X-Partner-Timestamp: 1785652596
X-Partner-Signature: hmac-sha256(secret, timestamp + body)
Content-Type: application/json

🛠️ Exposed MCP Tools (Observer & Optimizer Tiers)

Standard Model Context Protocol JSON-RPC tool signatures exposed by the server:

  • cro_get_partner_context — Query partner policy, allowed scopes, and volume caps.
  • cro_list_programs — List Programs assigned to the partner.
  • cro_list_build_flows — List Build Flows, stage maps, and active experiment variants.
  • cro_get_bgca_case_study — Query Boys & Girls Club youth personas and guaranteed foundation stack.
  • cro_propose_experiment — Propose an A/B CRO experiment comparing control vs variant flows.
  • cro_propose_bgca_optimization — Propose an AI persona-guided prompt seed and stage order optimization.

🗄️ D1 Database Schema Architecture

The standalone database handles multi-tenant partner landing pages, API key vaults, and CRO optimizations:

mcp_partners (id, slug, name, mcp_tier, status)
mcp_landing_pages (id, partner_id, slug, title, hero_copy, theme_color, foundation_stack)
mcp_api_keys (id, key_name, key_value, provider, updated_at)
cro_persona_profiles (id, landing_page_id, slug, name, target_audience, prompt_seeds)
cro_adversarial_optimizations (id, hypothesis_name, control_flow_id, fitness_scores)

🎓 KnowYourModel (KYM) Developer Agent Registration

Integrate @nexartis/knowyourmodel-sdk to register developer agents and track model optimization reputation:

import { KymClient } from '@nexartis/knowyourmodel-sdk';
const client = new KymClient({ apiKey: process.env.KYM_API_KEY });
const agent = await client.createRegistryEntry('bgca-cro-registry', {
  entity_id: 'bgca-cro-optimizer-v1',
  notes: 'Youth persona adversarial CRO optimization agent'
});