Claude Managed Agents: connect 49 MCP tools in one config
You have a coding agent. It reads files, runs tests, and writes code. But when you ask it to check if your SSL certificate expires next week, validate a customer email, or generate a QR code for your deployment URL, it hits a wall. It doesn't have access to the outside world.
MCP (Model Context Protocol) fixes the tool access problem. Managed Agents fix the infrastructure problem. Instead of building your own agent loop with tool discovery, error handling, and sandboxing, you send a config to Anthropic's API and get back a fully orchestrated agent that streams results over SSE.
This tutorial wires the botoi MCP server (49 developer tools) into a Claude Managed Agent. By the end, you'll have an autonomous agent that can look up DNS records, validate emails, check SSL certificates, hash strings, decode JWTs, and more; all from a single API call.
What are Claude Managed Agents
Managed Agents launched in public beta on April 8, 2026. The core idea: Anthropic runs the agent loop server-side. You define the model, system prompt, tools, and MCP servers. Anthropic handles sandboxing, tool orchestration, multi-turn execution, and streaming.
The agent runs inside a session. Each session gets its own sandboxed environment, executes up to a configurable number of turns, and streams events back to your client via SSE. When the agent needs a tool, it calls it autonomously, reads the result, and continues reasoning.
All Managed Agents endpoints require the managed-agents-2026-04-01 beta header.
Pricing is standard Claude API token rates plus $0.08 per session-hour. Web
search, if enabled, costs $10 per 1,000 searches.
Create a managed agent with botoi MCP
The setup is one API call. You pass the botoi MCP server URL in the mcp_servers array,
and the managed agent discovers all 49 tools at session start.
curl
curl https://api.anthropic.com/v1/managed_agents \
--header "x-api-key: $ANTHROPIC_API_KEY" \
--header "anthropic-version: 2023-06-01" \
--header "anthropic-beta: managed-agents-2026-04-01" \
--header "content-type: application/json" \
--data '{
"model": "claude-sonnet-4-6",
"name": "devops-agent",
"system": "You are a DevOps assistant. Use the available MCP tools to check infrastructure health, validate configurations, and generate reports.",
"mcp_servers": [
{
"type": "streamable_http",
"url": "https://api.botoi.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_BOTOI_API_KEY"
}
}
],
"max_turns": 20
}' The response confirms the MCP server connected and shows how many tools were discovered:
{
"id": "agent_01ABC123",
"name": "devops-agent",
"model": "claude-sonnet-4-6",
"mcp_servers": [
{
"type": "streamable_http",
"url": "https://api.botoi.com/mcp",
"status": "connected",
"tools_discovered": 49
}
],
"max_turns": 20,
"created_at": "2026-04-11T10:30:00Z"
} No botoi API key required for testing. The MCP server works anonymously at
5 requests per minute and 100 per day. Drop the Authorization header and the
agent still works within those limits.
Without authentication
For quick testing, skip the botoi API key entirely:
"mcp_servers": [
{
"type": "streamable_http",
"url": "https://api.botoi.com/mcp"
}
] Run a session: real example
With the agent created, start a session. This example asks the agent to check three things about stripe.com in a single prompt. The agent figures out which MCP tools to call, calls them in sequence, and assembles a report.
curl https://api.anthropic.com/v1/managed_agents/agent_01ABC123/sessions \
--header "x-api-key: $ANTHROPIC_API_KEY" \
--header "anthropic-version: 2023-06-01" \
--header "anthropic-beta: managed-agents-2026-04-01" \
--header "content-type: application/json" \
--data '{
"messages": [
{
"role": "user",
"content": "Check the SSL certificate for stripe.com, validate the email security@stripe.com, and look up their DNS MX records."
}
],
"stream": true
}' The SSE stream shows the agent's reasoning, tool calls, and final output:
event: message_start
data: {"type": "message_start", "session_id": "sess_01XYZ"}
event: content_block_delta
data: {"type": "text", "text": "I'll check three things for stripe.com. Let me start."}
event: tool_use
data: {"type": "tool_use", "name": "lookup_ssl", "input": {"domain": "stripe.com"}}
event: tool_result
data: {"type": "tool_result", "content": {"issuer": "DigiCert", "valid_to": "2027-01-15", "days_remaining": 279, "expired": false}}
event: tool_use
data: {"type": "tool_use", "name": "lookup_email", "input": {"email": "security@stripe.com"}}
event: tool_result
data: {"type": "tool_result", "content": {"valid": true, "mx_found": true, "disposable": false}}
event: tool_use
data: {"type": "tool_use", "name": "lookup_dns", "input": {"domain": "stripe.com", "type": "MX"}}
event: tool_result
data: {"type": "tool_result", "content": {"records": [{"priority": 1, "value": "aspmx.l.google.com"}, {"priority": 5, "value": "alt1.aspmx.l.google.com"}]}}
event: content_block_delta
data: {"type": "text", "text": "Here's the summary:\n\n1. **SSL**: Valid until Jan 15, 2027 (279 days). Issued by DigiCert.\n2. **Email**: security@stripe.com is valid with MX records present.\n3. **MX Records**: Stripe uses Google Workspace (aspmx.l.google.com)."}
event: message_stop
data: {"type": "message_stop", "session_id": "sess_01XYZ"}
Three tools called, three results collected, one summary generated. The agent chose
lookup_ssl, lookup_email, and lookup_dns on its own
based on the prompt. No tool routing logic on your side.
Python and Node.js examples
Python
import anthropic
client = anthropic.Anthropic()
# Create the agent once
agent = client.beta.managed_agents.create(
model="claude-sonnet-4-6",
name="devops-agent",
system="You are a DevOps assistant. Use MCP tools to check infrastructure.",
mcp_servers=[
{
"type": "streamable_http",
"url": "https://api.botoi.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_BOTOI_API_KEY",
},
}
],
max_turns=20,
betas=["managed-agents-2026-04-01"],
)
# Run a session
with client.beta.managed_agents.sessions.stream(
agent_id=agent.id,
messages=[
{
"role": "user",
"content": "Check SSL expiry for github.com and stripe.com. Flag any cert expiring within 30 days.",
}
],
betas=["managed-agents-2026-04-01"],
) as stream:
for event in stream:
if event.type == "content_block_delta":
print(event.delta.text, end="", flush=True)
elif event.type == "tool_use":
print(f"\n[calling {event.name}]") Node.js (TypeScript)
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic();
// Create agent
const agent = await client.beta.managedAgents.create({
model: "claude-sonnet-4-6",
name: "devops-agent",
system: "You are a DevOps assistant. Use MCP tools to check infrastructure.",
mcp_servers: [
{
type: "streamable_http",
url: "https://api.botoi.com/mcp",
headers: {
Authorization: "Bearer YOUR_BOTOI_API_KEY",
},
},
],
max_turns: 20,
betas: ["managed-agents-2026-04-01"],
});
// Run a session with streaming
const stream = await client.beta.managedAgents.sessions.stream(agent.id, {
messages: [
{
role: "user",
content: "Validate the email admin@example.com and check if example.com has SPF records.",
},
],
betas: ["managed-agents-2026-04-01"],
});
for await (const event of stream) {
if (event.type === "content_block_delta") {
process.stdout.write(event.delta.text);
}
} What the 49 tools cover
The botoi MCP server at https://api.botoi.com/mcp exposes 49 curated tools. Here is
what each category includes:
| Category | Tools | Examples |
|---|---|---|
| Lookup | 14 | IP geolocation, DNS records, WHOIS, SSL check, email validation, HTTP headers, URL metadata, domain availability, tech detection, VPN detection, phone lookup, company enrichment, address validation, breach check |
| Text & Data | 10 | Base64 encode/decode, JSON format/validate, Markdown to HTML, HTML to Markdown, CSV to JSON, YAML to JSON, JSON to YAML, XML to JSON |
| Developer | 12 | SHA-256/MD5 hashing, UUID generation, JWT sign/verify, cron parsing, password generation, URL encode/decode, regex testing, text diff, semver parsing, timestamp conversion |
| Security | 5 | AES-256 encrypt/decrypt, TOTP generation, credit card validation, PII detection |
| Transform | 5 | JS minification, CSS minification, SQL formatting, code formatting, JSON to TypeScript |
| Monitoring | 3 | SSL cert expiry check, DNS monitor, accessibility check |
Every tool is read-only (except encrypt/decrypt). The agent can't modify external state, which makes it safe to run autonomously without approval gates.
Cost breakdown
Managed Agents pricing has three components:
- Token rates: Standard Claude API pricing for the model you choose (Sonnet, Opus, or Haiku)
- Session-hour fee: $0.08 per session-hour, prorated to the second
- Web search (optional): $10 per 1,000 searches
MCP tool calls to botoi are free on the Anthropic side. You only pay for botoi API usage, and the free tier covers 100 requests per day. Here's what a typical session looks like:
Session duration: 3 minutes (0.05 hours)
Session-hour cost: 0.05 x $0.08 = $0.004
Input tokens: 12,400 (Sonnet: $3/MTok) = $0.037
Output tokens: 3,800 (Sonnet: $15/MTok) = $0.057
MCP tool calls: 6 (botoi free tier)
──────────────────────────────────
Total: $0.098 A 3-minute session checking SSL certs, validating emails, and querying DNS costs under $0.10. The session-hour fee ($0.004 for 3 minutes) is negligible compared to token costs.
Managed Agents vs building your own agent loop
You can wire MCP tools into Claude yourself using the Messages API with tool use. The question is whether the infrastructure overhead is worth it.
| Concern | Your own loop | Managed Agent |
|---|---|---|
| MCP client connection | You build and maintain it | Handled by Anthropic |
| Tool discovery | Your code parses the tool manifest | Automatic at session start |
| Multi-turn orchestration | Your while loop with tool routing | Server-side, up to N turns |
| Sandboxing | Your responsibility | Built-in per session |
| Error recovery | Your retry/fallback logic | Handled in the agent loop |
| Streaming | You parse SSE events per turn | End-to-end SSE for full session |
| Cost overhead | Token costs only | Tokens + $0.08/session-hour |
| Flexibility | Full control over every step | Config-driven, less custom logic |
# Your own agent loop (pseudocode)
while not done:
response = call_claude(messages)
for tool_call in response.tool_calls:
# You handle MCP client connection
# You handle tool discovery
# You handle input validation
# You handle error recovery
# You handle sandboxing
result = mcp_client.call(tool_call)
messages.append(result)
# Managed Agent (one API call)
session = client.beta.managed_agents.sessions.create(
agent_id=agent.id,
messages=[{"role": "user", "content": prompt}],
) If you need fine-grained control over tool routing, custom approval gates, or non-standard retry policies, build your own loop. If you want an agent running in production with minimal code, Managed Agents eliminate the boilerplate.
When to use which approach
- Managed Agents: internal tools, chatbots with tool access, one-off automation scripts, quick prototypes that need real-world data
- Your own loop: user-facing products where you need custom UX per tool call, workflows requiring human-in-the-loop approval, complex branching logic the agent shouldn't decide autonomously
- Both: start with Managed Agents for the prototype, extract to your own loop when you hit a customization wall
MCP server URL for all configs: https://api.botoi.com/mcp.
Uses Streamable HTTP transport (JSON-RPC 2.0), stateless, no session initialization required.
Works with Managed Agents, Claude Desktop, Claude Code, Cursor, and VS Code.
Frequently asked questions
- What are Claude Managed Agents?
- Managed Agents is a fully managed harness from Anthropic for running Claude as an autonomous agent. It handles secure sandboxing, tool orchestration, and SSE streaming. You send a prompt and tool configuration via the API, and Anthropic runs the agent loop server-side. It launched in public beta on April 8, 2026 and requires the managed-agents-2026-04-01 beta header.
- How much do Claude Managed Agents cost?
- Managed Agents charge standard Claude API token rates plus $0.08 per session-hour. Web search costs $10 per 1,000 searches. MCP tool calls to external servers like botoi are free on the Anthropic side; you only pay for the botoi API usage, which includes a free tier of 100 requests per day.
- Can I use MCP servers with Claude Managed Agents?
- Yes. Managed Agents support MCP servers via Streamable HTTP transport. Add an mcp_servers array to your agent configuration with the server URL and optional authentication headers. The agent discovers available tools at session start and can call them autonomously during execution.
- Do I need an API key for the botoi MCP server?
- No. The botoi MCP server works anonymously at 5 requests per minute and 100 per day. For higher limits, pass an API key via the Authorization header in your MCP server config. Free API keys are available at botoi.com/api.
- What tools does the botoi MCP server provide?
- The botoi MCP server exposes 49 curated tools across six categories: Lookup (IP, DNS, WHOIS, SSL, email, domain, phone, company, VPN detection, tech detection, HTTP headers, URL metadata), Text and Data (Base64, JSON, Markdown, HTML, CSV, YAML, XML conversions), Developer Utilities (hashing, UUID, JWT, cron, passwords, URL encoding, regex, diff, semver, timestamps), Security (encryption, TOTP, credit card validation, PII detection), Transform (JS/CSS minification, SQL/code formatting, JSON to TypeScript), and additional tools like address validation, breach checking, SSL monitoring, DNS monitoring, and accessibility checking.
Try this API
DNS Lookup API — interactive playground and code examples
More tutorial posts
Start building with botoi
150+ API endpoints for lookup, text processing, image generation, and developer utilities. Free tier, no credit card.