Skip to main content

MCP Monitors

Preview

MCP monitor support is in preview. Feature availability may vary by account tier.

An MCP Monitor tests an AI tool or agent that exposes the Model Context Protocol (MCP). Instead of making a plain HTTP request, APIContext connects to an MCP server, calls one of its tools or resources, and asserts on the response — letting you verify that your AI-powered services remain reliable and correct on a schedule.

When to use

Use an MCP monitor when you want to:

  • Verify that an MCP server responds to tool calls within acceptable latency bounds
  • Assert on the structure or content of tool outputs (e.g., a code-generation tool returns valid JSON)
  • Alert on regressions in AI service availability or response quality

How it works

  1. APIContext connects to your MCP server over the configured transport (HTTP, SSE, or stdio).
  2. It issues a tool call or resource request with your configured parameters.
  3. The response is evaluated against your assertions (status, schema, content checks).
  4. Results are recorded — latency, pass/fail, raw response — and available in the project dashboard.

Setup

Step 1: Create an MCP monitor

  1. In the sidebar, under CONFIGURE MONITORING, click Monitors.
  2. Click + Add New Monitor.
  3. In the monitor type picker, select MCP.

Step 2: Configure the connection

Fill in the connection fields:

FieldDescription
MCP Server URLThe base URL of your MCP server (e.g., https://mcp.example.com)
TransportHTTP, SSE, or stdio
Tool nameThe MCP tool to call (e.g., search, generate)
Timeout (ms)Maximum time to wait for a response before marking as failed
Wait for completionFor async tools: wait until the tool signals completion before evaluating

Step 3: Set input parameters

Under Parameters, provide the tool's input in JSON format. Use APIContext variables (%%VAR%%) for values that change between runs.

Step 4: Add assertions

Use the Assertions tab to check the response:

  • Status — the tool returned a result (not an error)
  • Schema — the response matches a JSON schema
  • Content — a JSON path value equals, contains, or matches a pattern

Step 5: Add to a schedule

Add the monitor to a schedule to run automatically.

See also