Claude Agent SDK & Claude Code CLI: Scoped Hosted MCP Governance
Built for engineering teams deploying headless Anthropic Claude Agent SDK (Python ClaudeAgentOptions + mcp_servers HTTP transport) and repo-standardized Claude Code CLI (claude mcp add --transport http & .mcp.json) against https://mcp.upp3.com/mcp (alias https://upp3.com/mcp). Learn how vertical allowed_tools subsets stop 56-tool system-prompt bloat, stack with -81.3%mode="summary" compression, and keep retries at 0 credits on HTTP 504/429. (Looking for interactive Desktop UI setup? See our Claude Desktop & Code guide.)
Free 500/mo, $47 Once (25K never-expiring), $49/mo Pro (15K), $149/mo Scale (60K)
3-Tab Production Workbench · Live Session Key Sync
Copy-Paste Claude Code CLI, Python claude-agent-sdk & Shared .mcp.json
Authenticate with X-API-Key: ed_live_your_key_here over native Streamable HTTP (zero local Node bridge required). Claim a free key in the wizard below and your session key automatically populates ed_live_your_key_here across the CLI and Python SDK tabs.
Using placeholder ed_live_your_key_here — claim a free 500-credit key below to auto-fill CLI and Python claude-agent-sdk snippets.Auto-Fill Free Key →
Claude Code CLI (claude mcp add)
# 1) Register EdgeData Hosted MCP (Streamable HTTP) in 1 line
# Same-origin alias https://upp3.com/mcp is equally valid
claude mcp add --transport http edgedata https://mcp.upp3.com/mcp \
--header "X-API-Key: ed_live_your_key_here"
# 2) Optional: Write to repo-shared .mcp.json (--scope project) or global user config (--scope user)
claude mcp add --scope project --transport http edgedata https://mcp.upp3.com/mcp \
--header "X-API-Key: ed_live_your_key_here"
# claude mcp add --scope user --transport http edgedata https://mcp.upp3.com/mcp \
# --header "X-API-Key: ed_live_your_key_here"
# 3) Verify registered MCP server health & exact transport config
claude mcp list
claude mcp get edgedata
# 4) Optional: Direct JSON-RPC tools/list probe against Hosted MCP
curl -sS -X POST "https://mcp.upp3.com/mcp" \
-H "X-API-Key: ed_live_your_key_here" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | head -c 500
import asyncio
import os
from claude_agent_sdk import ClaudeAgentOptions, query
EDGEDATA_API_KEY = os.getenv("EDGEDATA_API_KEY", "ed_live_your_key_here")
MCP_URL = "https://mcp.upp3.com/mcp" # alias: https://upp3.com/mcp
# Governance: allowlist only the 7 e-commerce tools needed for this pipeline
# instead of injecting all 56 Hosted MCP tool schemas (~17,920 tok/turn).
ECOMMERCE_ALLOWED_TOOLS = [
"mcp__edgedata__amazon_search_products",
"mcp__edgedata__amazon_get_product_detail",
"mcp__edgedata__amazon_get_reviews",
"mcp__edgedata__walmart_get_item",
"mcp__edgedata__walmart_get_offers",
"mcp__edgedata__tiktok_shop_search_products",
"mcp__edgedata__shopify_get_store_products",
]
async def run_scoped_price_audit(keyword: str) -> None:
options = ClaudeAgentOptions(
mcp_servers={
"edgedata": {
"type": "http",
"url": MCP_URL,
"headers": {
"X-API-Key": EDGEDATA_API_KEY,
},
}
},
allowed_tools=ECOMMERCE_ALLOWED_TOOLS,
system_prompt=(
"You are a production commerce intelligence agent. Always pass "
"mode='summary' on every EdgeData MCP tool call to reduce payload "
"tokens by 81.3% and prevent context compaction. Upstream HTTP "
"504/429 responses deduct 0 credits."
),
max_turns=8,
)
prompt = (
f"Audit top US competitors for '{keyword}' using mode='summary': "
"search Amazon, inspect the leading ASIN detail and 2-star reviews, "
"then cross-check Walmart item offers. Return a concise Markdown table."
)
async for message in query(prompt=prompt, options=options):
print(message)
if __name__ == "__main__":
asyncio.run(run_scoped_price_audit("portable espresso maker"))
Context Bloat Governance · 56 Tools vs. Scoped Subsets
Vertical allowed_tools Subsets vs. Unscoped 56-Tool Mounting
At ~320 tokens per JSON Schema, mounting all 56 EdgeData tools injects ~17,920 schema tokens into every single Claude turn. Scoping allowed_tools by vertical cuts Turn-1 prefill and cache-miss costs by 85.7% to 96.4% before stacking -81.3%mode="summary" payload savings.
Calculate Exact Team Monthly LLM Spend · 100% Browser-Local
Want to model your team’s exact Claude Sonnet / Opus input token bill under Prompt Caching (Turns 2..N billed at 10%) and mode="summary" (-81.3%)? Launch our interactive MCP Tool Schema Context Budget Calculator → to compare 56 unscoped tools against your custom 4–8 tool allowlist and export a CTO-ready Markdown budget report.
Interactive CLI vs. Headless Agent SDK · Production Playbooks
Claude Code CLI vs. Claude Agent SDK Pipelines
Standardize team exploration in Claude Code CLI with .mcp.json, then promote proven prompts into deterministic headless Python claude-agent-sdk jobs with locked allowed_tools.
Developer Terminal · Claude Code CLI
Claude Code CLI (claude mcp add + .mcp.json)
Best for interactive repository exploration, ad-hoc schema verification, and PR-adjacent competitive research directly from your shell.
✓Repo Standardization: Commit .mcp.json with ${EDGEDATA_API_KEY} env expansion so zero secrets enter Git.
✓Guardrail in CLAUDE.md: Document default mode="summary" rules and vertical tool preferences for every developer.
✓Instant Verification: Inspect live health anytime with claude mcp list and claude mcp get edgedata.
Headless Production · Python SDK
Claude Agent SDK (ClaudeAgentOptions + allowed_tools)
Best for scheduled CI/CD jobs, multi-tenant SaaS backends, and automated nightly monitors where strict token ceilings and least-privilege tool access are mandatory.
✓Hard Tool Scoping: Enforce exact mcp__edgedata__* allowlists per worker to cut 85%–96% of schema tokens.
✓Bounded Loops: Combine max_turns with mode="summary" (-81.3% payload) to prevent runaway context windows.
✓Zero-Credit Retry Safety: Upstream HTTP 504 and 429 responses deduct strictly 0 credits across all 56 tools.
✓GDPR 0-PII Ready: Real estate, LinkedIn jobs, and Trustpilot reviews arrive pre-sanitized before logging or storage.
Playbook 01 · Commerce7 Tools · -87.5% Schema
Competitor Price, Buy Box & Defect Monitor
Track Amazon ASIN pricing and 2-star reviews alongside Walmart offers and Shopify DTC catalogs without triggering context compaction.
Using EdgeData MCP (always pass mode="summary"):
1. Call amazon_search_products(query="ergonomic vertical mouse", country="US", mode="summary") for top 3 ASINs.
2. Call amazon_get_product_detail and amazon_get_reviews(rating=2) on the #1 ASIN.
3. Call walmart_get_item and walmart_get_offers on matching Walmart SKU to spot Buy Box undercuts.
Output a Markdown table of price spread, seller count, and top 3 recurring buyer complaints.
Playbook 02 · Real Estate4 Tools · -92.9% Schema
US & UK Metro Listing & HPI Monitor (0-PII)
Monitor Redfin US active listings and metro trends alongside UK Rightmove listings and House Price Index bands with GDPR 0-PII enabled by default.
Predictable Credit Tiers for Solo CLI Builders & Agent SDK Fleets
Every plan includes all 56 Hosted MCP tools, 67 REST routes, mode="summary" (-81.3% payload tokens), GDPR 0-PII defaults, and strictly 0 credits on HTTP 504/429.
Exact answers on scoping allowed_tools, one-line claude mcp add --transport http setup, tool naming conventions, mode="summary" + 0-credit retries, and pricing.
Why should I scope allowed_tools in Claude Agent SDK instead of mounting all 56 EdgeData MCP tools?
Every mounted MCP tool injects its JSON Schema (~320 tokens) into Claude's system prompt on every reasoning turn. Mounting all 56 tools consumes ~17,920 schema tokens per turn before a single tool response arrives, whereas scoping allowed_tools to 2 to 8 vertical tools cuts schema overhead by 85% to 96% and reduces tool-selection ambiguity.
What is the exact one-line Claude Code CLI command to connect EdgeData Hosted MCP with X-API-Key?
Run claude mcp add --transport http edgedata https://mcp.upp3.com/mcp --header "X-API-Key: ed_live_your_key_here" (add --scope project to write a team-shared .mcp.json or --scope user for personal global access), then verify with claude mcp list and claude mcp get edgedata. The same-origin alias https://upp3.com/mcp works identically.
How do I reference EdgeData MCP tools inside ClaudeAgentOptions allowed_tools?
Claude Agent SDK namespaces MCP tools as mcp__<server_name>__<tool_name>. When you register mcp_servers={"edgedata": {"type": "http", "url": "https://mcp.upp3.com/mcp", "headers": {"X-API-Key": api_key}}}, list exact allowlisted entries such as mcp__edgedata__amazon_search_products, mcp__edgedata__walmart_get_item, or mcp__edgedata__redfin_search_properties.
How do mode='summary' and HTTP 504/429 zero-credit billing protect Claude Agent SDK loops?
Passing mode='summary' strips raw HTML and bloated arrays server-side to cut payload tokens by -81.3% on average, preventing early context compaction across multi-turn Claude runs. If an upstream platform returns HTTP 504 or 429, EdgeData strictly charges 0 credits so automated retries never waste budget.
What pricing plans and GDPR 0-PII protections apply to Claude Code CLI and Claude Agent SDK teams?
EdgeData enforces server-side GDPR 0-PII scrubbing by default across real estate, LinkedIn public jobs, and Trustpilot reviews. Teams can start cardless on Free ($0/mo, 500 credits/mo), buy the Starter Credit Pack ($47 once for 25,000 never-expiring credits at $1.88 per 1k credits), or run monthly SLAs on Pro ($49/mo, 15,000 credits/mo) and Scale ($149/mo, 60,000 credits/mo).