Agent Broker

Created By
basilalshukaili6 days ago
MCP server for AI agents to interact with SMBs — book appointments, send messages, find businesses. 13 tools. Compliance pre-check (TCPA, GDPR, CASL). Channel fallback: Cal.com → voice → SMS → email → web form.
Overview

SMB Transaction & Communication Broker

An agent-callable service that lets autonomous AI agents discover, verify, communicate with, schedule with, and transact with the long tail of small and mid-sized businesses (SMBs) — through a single compliance-aware tool surface.

Tests License Python Edge


Why this exists

There are ~60 million long-tail small businesses in the US — barbers, plumbers, accountants, home cleaners — and they have no API surface. AI agents that need to schedule a haircut, get a quote on a roof repair, or send a transactional confirmation today have to either: (a) drive a browser, (b) cold-call by voice, or (c) give up.

This service is the missing layer. Agents call us; we route to the right SMB through whichever channel reaches them fastest — Cal.com → SMS → voice AI → email → web form fallback — with full TCPA / GDPR / CASL / 10DLC / two-party recording-consent compliance enforced as a non-bypassable gate.

What you can do with it

13 operations, all callable via REST, MCP, OpenAI tools, Anthropic tools, or A2A protocol:

OperationWhat it doesCostLatency
find_businessSearch SMBs by vertical + location + capability$0.01<2s
verify_businessConfirm an SMB has the capability you need$0.01<2s
send_messageSMS / email / voice with full compliance pre-check$0.05<5s
capture_leadHand a prospect to an SMB with dedup$0.02<2s
schedule_appointmentBook / reschedule / cancel — direct API → voice fallback$0.15 base + $0.85 success premium<5s sync, async otherwise
send_transactional_confirmationTCPA-exempt confirmations (booking, receipt)$0.04<5s
handle_inboundClassify customer messages (booking / cancel / opt-out / question)$0.03<5s
escalate_to_humanHand off to a human when an agent is stuck$0.10 base + $0.40 success premiumasync
get_statusPoll status of an async operation$0.001<1s
get_outcomeRetrieve final outcome of an async operation$0.001<1s
preview_costEstimate cost / latency / success probability — free$0.00<500ms
self_testService health check — free$0.00<2s
import_booking_urlParse any Cal.com / Calendly / Doctolib / Booksy / OpenTable / 7 more URLs into a bookable SMB$0.01<2s

Quick start (for AI agents)

Option 1: MCP (Claude Desktop, Cursor, Continue, etc.)

// Add to your MCP client config
{
  "mcpServers": {
    "agent-broker": {
      "url": "https://agent-broker-edge.basil-agent.workers.dev/mcp",
      "headers": { "X-Agent-Identity": "$AGENT_BROKER_TOKEN" }
    }
  }
}

Option 2: OpenAI function calling

import httpx, openai
tools = httpx.get("https://agent-broker-edge.basil-agent.workers.dev/.well-known/openai-tools.json").json()["tools"]
client = openai.OpenAI()
resp = client.chat.completions.create(
    model="gpt-4",
    messages=[{"role":"user","content":"Book me a haircut in Atlanta for Saturday under $50"}],
    tools=tools,
)

Option 3: Anthropic tool use

import httpx, anthropic
tools = httpx.get("https://agent-broker-edge.basil-agent.workers.dev/.well-known/anthropic-tools.json").json()["tools"]
client = anthropic.Anthropic()
msg = client.messages.create(
    model="claude-opus-4-5",
    max_tokens=1024,
    tools=tools,
    messages=[{"role":"user","content":"Book me a haircut in Atlanta for Saturday under $50"}],
)

Option 4: Plain REST

curl -X POST https://agent-broker-edge.basil-agent.workers.dev/ops/find_business \
  -H "X-Agent-Identity: $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "vertical": "personal_services",
    "location": {"zip_or_city": "30309"},
    "capability": "haircut"
  }'

Discovery surfaces

We're discoverable through every protocol agents currently use:

ProtocolURL
MCPhttps://agent-broker-edge.basil-agent.workers.dev/mcp
MCP descriptorhttps://agent-broker-edge.basil-agent.workers.dev/.well-known/mcp.json
OpenAI ChatGPT pluginhttps://agent-broker-edge.basil-agent.workers.dev/.well-known/ai-plugin.json
OpenAI function toolshttps://agent-broker-edge.basil-agent.workers.dev/.well-known/openai-tools.json
Anthropic tool_usehttps://agent-broker-edge.basil-agent.workers.dev/.well-known/anthropic-tools.json
A2A (Agent-to-Agent)https://agent-broker-edge.basil-agent.workers.dev/.well-known/agents.json
llms.txthttps://agent-broker-edge.basil-agent.workers.dev/llms.txt
OpenAPI 3.1https://agent-broker-edge.basil-agent.workers.dev/openapi.yaml
Capability manifesthttps://agent-broker-edge.basil-agent.workers.dev/manifest
Service discovery cardhttps://agent-broker-edge.basil-agent.workers.dev/.well-known/agent-service

Why agents pick us (measured, not assumed)

From our agent-simulation harness — 168 trials × 3 personas (cost / quality / latency) across 56 tasks, with noisy agent perception (±15% on price, ±10% on quality, ±20% on latency):

PersonaSelection rateSuccess when selectedWinRate
cost_minimizer94.6%88.7%0.839
quality_maximizer91.1%88.2%0.804
latency_sensitive91.7%88.3%0.810
Aggregate92.5%88.4%0.818

We deliberately included tasks where we should lose — out-of-region SMBs (Tokyo / Mumbai / Berlin), complex web automation, trivial lookups — and the simulation correctly routes those to competitors. See BENCHMARKS.md.

Compliance posture

Every outbound communication passes through compliance/pre_check():

  1. Content classification (gambling / lending / cannabis / adult / spam) — blocks restricted categories.
  2. Opt-out check — TCPA STOP keyword, GDPR right-to-be-forgotten, CASL.
  3. Consent check for marketing — TCPA written consent, GDPR opt-in, CASL implied/express.
  4. 10DLC campaign-registry check for US SMS.
  5. Two-party recording consent for CA / FL / IL / MD / MA / MT / NV / NH / PA / WA.
  6. Audit log entry (PII stored as SHA-256 hash, never plaintext).

Compliance violations surface as ComplianceViolationErrorcompliance_violation API error. Never silently dropped, never bypassed by middleware.

Architecture

AI agent → Cloudflare Worker edge (agent-broker-edge.basil-agent.workers.dev)
               ├── Discovery + MCP read → embedded snapshots  40–70 ms
               └── tools/call + /ops/*  → proxy to origin    170–190 ms
           Python FastAPI on Render (smb-broker.onrender.com)
               Cron */2 keeps Render warm — cold starts eliminated

The Python service exposes 13 operations over REST + MCP + .well-known surfaces. Each handler validates input with Pydantic models, runs through compliance/pre_check, executes via channel-fallback (direct_api → voice_ai → sms → email → web_form), and writes an immutable OutcomeReceipt to the outcome store. Async operations return pending_async. Idempotency is keyed by (agent_id, operation, idempotency_key) with 24h TTL.

Full architecture: docs/architecture.md · Edge layer: edge/README.md

Repo layout

service-root/
├── core/                  # 12 operation handlers + shared Pydantic models
├── channels/              # Twilio, SendGrid, Vapi, Bland, Cal.com, Playwright
├── compliance/            # pre_check, jurisdiction_rules, consent_store, audit_log
├── reliability/           # retry, circuit_breaker, channel_fallback, async_runner
├── billing/               # meter, budget_guard, receipt_signer, pricing_tiers
├── telemetry/             # tracer, log_redactor, metrics_emitter
├── storage/               # outcome_store, idempotency_store
├── supply/                # smb_directory (20+ seed SMBs)
├── onboarding/            # self_serve, verification_flow, channel_capture
├── feedback/              # failure_classifier, attribution_engine, outcome_evaluator
├── optimizer/             # ab_router, selection_analytics, weekly_report
├── agent_interface/       # manifest_server, mcp_server, well_known, identity, webhooks, self_test
├── manifest/              # manifest.json, mcp_tools.json, openapi.yaml
├── api/                   # errors.md, identity.md, async.md
├── docs/                  # mission, architecture, compliance, ADRs
├── deploy/                # Dockerfile, docker-compose.yml, .ci/
├── tests/                 # unit, contract, compliance, fault_injection, agent_sim
├── reports/               # agent_sim_report.json, weekly winrate reports
├── main.py                # FastAPI entry point
├── config.py              # Centralized config from env
└── requirements.txt

Local development

# 1. Clone & install
pip install -r requirements.txt

# 2. Run the test suite
python -m pytest tests/ -q

# 3. Run the agent simulation
python -m tests.agent_sim.harness

# 4. Run the self-test
python -c "import asyncio; from agent_interface.self_test import run_self_test; print(asyncio.run(run_self_test()).all_passed)"

# 5. Start the API
python main.py
# → http://localhost:8000/docs  (Swagger)
# → http://localhost:8000/manifest
# → http://localhost:8000/mcp

Or with Docker:

docker compose -f deploy/docker-compose.yml up

Documentation index

License

Proprietary. Contact for licensing terms.

Server Config

{
  "mcpServers": {
    "agent-broker": {
      "url": "https://agent-broker-edge.basil-agent.workers.dev/mcp"
    }
  }
}
Project Info
Created At
6 days ago
Updated At
5 days ago
Author Name
basilalshukaili
Star
-
Language
-
License
-
Category

Recommend Servers

View All
Polymarket Intel
@aemery13

An MCP server and REST API that classifies Polymarket wallets as human or bot, scores their trading edge from 0–10, and streams their current open positions. Built for AI agents on copy-trading and signal-following stacks. # Use it from any MCP client (Claude Desktop, Cursor, etc.) pip install polymarket-intel-mcp polymarket-intel-mcp # Or call the hosted REST API directly curl https://polymarket-intel-production.up.railway.app/wallet/0xf1528f12e645462c344799b62b1b421a6a4c64aa How this fits with other Polymarket MCP servers There are several MCP servers covering Polymarket, each at a different layer: Server What it does When to use it polymarket-intel (this) Wallet intelligence — classify human vs bot, score trading edge, read open positions Deciding whose signals to follow graph-polymarket-mcp Market data via The Graph subgraphs (20 tools, 8 subgraphs) Reading raw on-chain market data whitmorelabs/polymarket-mcp Slippage, liquidity, arbitrage, price feeds Pricing your own trades joinQuantish/polymarket Self-hosted trading agent Running an autonomous bot These complement each other. A copy-trading agent would use polymarket-intel to filter wallets worth following, then graph-polymarket-mcp to read the markets those wallets are betting on, then whitmorelabs/polymarket-mcp to size its own entries. What it answers "Is this trader a human or a bot?" — score_polymarket_wallet(wallet_address) → returns classification ∈ {human, bot, insufficient_data} plus a confidence score and reason codes. "Do they actually have an edge?" — edge_score from 0–10, gated on net realised PnL so distributed-but-losing wallets don't get false positives. "What are they betting on right now?" — get_open_positions(wallet_address) returns live positions sorted by size, refreshed every 30s. "How has their edge changed over time?" — /wallet/{address}/history returns the score time series from the daily snapshots. Why this exists The Polymarket leaderboard is misleading. It includes unrealised PnL marked-to-current-price, so the names at the top are dominated by bots running structural arb plus a few wallets sitting on huge open positions that may never resolve in their favour. Agents that copy-trade naively from the leaderboard get burned. This service runs every leaderboard wallet through behavioural fingerprinting (focus ratio, holding period, timing regularity, category concentration) plus PnL reconstruction from raw activity, and only surfaces traders that look like genuine humans with a real edge. The dataset grows more valuable over time — every day the snapshot job runs, historical signals accumulate. Wallets that have been consistently above edge 7 for 90 days are a stronger signal than any single point-in-time score. Distributed as both a REST API and an MCP server Surface Use case Setup MCP server Agent that needs tool-style access pip install polymarket-intel-mcp REST API Custom HTTP integration, dashboards curl https://polymarket-intel-production.up.railway.app/... Hosted MCP Agent on any MCP-compatible client Add https://polymarket-intel-production.up.railway.app/mcp to client config Architecture ┌──────────────────────────────────────────────┐ │ core/ │ │ client.py — Polymarket data API client │ │ signals.py — pure signal calculators │ │ scorer.py — classifier + edge score │ │ models.py — Pydantic response schemas │ ├──────────────────────────────────────────────┤ │ db/ │ │ schema.sql — Postgres tables + indexes │ │ repository.py — Repository protocol + │ │ InMemoryRepository │ │ supabase_repo.py — Supabase impl │ │ converters.py — ScoreResult ↔ records │ ├──────────────────────────────────────────────┤ │ api/main.py — FastAPI HTTP server │ │ mcp_server/ — MCP server (stdio) │ │ scripts/ │ │ analyze_wallet.py — CLI │ │ snapshot_job.py — daily cron entry │ │ tests/ │ └──────────────────────────────────────────────┘ Core has no idea persistence exists. The API and snapshot job depend on the Repository protocol — Supabase in production, in-memory in tests and when env vars are unset. This is what makes the suite run without a database and what lets you swap Supabase for Neon, RDS, or anything else later by adding one file.

20 hours ago
Coinrebate

2 days ago
Emora Health

a day ago
Whispergraph
@Whisper Security

The internet's largest queryable infrastructure graph — 7.39 billion nodes, 39 billion edges, 5.6 million threat-intelligence relationships. Pivot from any IP, domain, or ASN across DNS, BGP, WHOIS, GeoIP, and threat intel in a single Cypher query. Most threat-intel and OSINT APIs are point lookups: you ask about one indicator, you get one record. Investigations don't work that way — you start from one suspicious domain and need to trace its hosting, its sibling domains, its registrar, its email infrastructure, the ASN announcing its IP, and which feeds have flagged anything nearby. WhisperGraph stores all of that as a single connected graph and lets you traverse it natively. One query can answer questions that would take dozens of API calls anywhere else. Example questions you can ask **Is xyz-uknown@suspicious.com a safe email address? **What is the IP address of whisper.security? "What's the threat reputation of 45.142.213.55, and what feeds flagged it?" "Show every domain sharing this domain's MX records and registrant email." "Map the full DNS and BGP attack surface of example.com." "Which ASNs in Russia have the highest concentration of phishing-flagged IPs this quarter?" "Find all domains registered within 24 hours of suspicious-domain.com using the same registrar." "What's the historical WHOIS for disputed-domain.com going back 5 years?" "Which prefixes does AS13335 currently announce, and were any of them previously announced by a different ASN?"

9 hours ago