agentest

How-to: LangGraph · CrewAI · OpenAI Agents SDK · AutoGen · smolagents · n8n · MCP

How-to · MCP · also markdown in the repository

How to test MCP (Model Context Protocol) servers with OpenTelemetry and agentest

Source code, tutorials and issues: github.com/srpadmanabhuni/agentest · PyPI: agentest-ai

agentest (agentest-ai) — deterministic OpenTelemetry evals for AI agents. It does not start or host an MCP server, and it does not speak the MCP transport. It judges what an agent did with MCP tools you already recorded: the server's tools/list result, plus OpenTelemetry GenAI execute_tool spans for each tools/call.

pip install agentest-ai

What to capture

  1. Save the MCP server's tools/list result as JSON (for example tools.json). Annotations such as readOnlyHint, destructiveHint, idempotentHint and openWorldHint are what several checks read.
  2. Wrap each tools/call in an execute_tool span with gen_ai.tool.name, gen_ai.tool.call.arguments and gen_ai.tool.call.result.
  3. Optionally save the A2A AgentCard as agent-card.json.

Judge a recorded run

agentest std run --otlp traces.otlp.jsonl --card agent-card.json --tools tools.json

--card and --tools are optional. Checks that need a declared fact report n/a when that file is missing; n/a is not a pass. To fail a CI job when any check fails, add --format junit --out agentest.xml --strict.

Typical signals include tool names that appear in the trace but not on the declared list, state-changing calls without the confirmation the check requires, injected recipients or disallowed hosts on write tools, and arguments or results that leak restricted data.

The full guide is docs/integrations/mcp.md.

Other frameworks

LangGraph · CrewAI · OpenAI Agents SDK · AutoGen · smolagents · n8n

Code: agentest open-source agentic evals.