Pick the right integration tier for your agent runtime — from zero-code MCP proxy to explicit per-tool metadata.
You have Apie connected. Now you need to decide how much instrumentation code to write. The right path depends on where your agent runs and how much control you need over guardrail metadata.When you finish this page, you’ll know which integration tier fits your setup and have a starting code snippet to copy.
If your agent uses MCP tools through Cursor or Claude Desktop, you don’t need to change agent code. Point the MCP host at the Apie proxy instead of the upstream server.
npx apie mcp proxy --config apie.mcp.json
See MCP proxy for the full setup.Best for: Observing and guarding MCP tool calls without touching your agent.
Wrap your HTTP handler or worker entrypoint. Apie creates a run for each request and propagates context to framework plugins and instrumented MCP clients.
import apie from "./apie.config";export const handleRequest = apie.wrap( async (req: Request) => agent.run(await req.json()), { inputSummary: (req) => req.url },);
apie.wrap() is available in the JavaScript SDK. In Python, use run_context or with_run to establish run scope.
Best for: API routes, queue workers, and scheduled jobs where one request equals one run.
Action and resource types are inferred from tool names when omitted — fine for Monitor mode. Add explicit metadata before enabling Enforce mode in production. See Instrument tool calls.Best for: Custom agents, production enforcement, and compliance-sensitive workloads.