/api/v1/mcp/trafficGet MCP traffic metrics
Lists recent MCP tool-call rows for a project and a single roll-up over the page returned. Requires `?projectId` (400 if missing; org membership verified through it) and the TEAM plan. Optional filters: `?status` (allowed|blocked|alerted|error), `?tool`, `?minRisk`, `?limit` (default 100, max 500). Returns { logs[] } — newest first, each with session_id, agent_id, server_name, tool_name, arguments, result_summary, status, risk_score, policies_matched, latency_ms — plus { summary: { total, blocked, alerted, errors, highRisk (risk_score >= 7), avgLatencyMs } } computed over the returned page only. There is no per-server / per-tool / per-method breakdown; filter and aggregate client-side. Returns { logs: [], migrationPending: true } when the table has not been migrated. 120 req/min.
Authentication
Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.
Response
200 example
{
"success": true
}All status codes
Code samples
cURL
curl -X GET \ https://evalguard.ai/api/v1/mcp/traffic \ -H "Authorization: Bearer $EVALGUARD_API_KEY"
TypeScript
// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:
const res = await fetch("https://evalguard.ai/api/v1/mcp/traffic", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}` },
});
console.log(res.status, await res.json());Python
# The Python SDK (pip install evalguardai) exposes TYPED methods on
# EvalGuardClient — run_eval, get_eval, … — not a generic request().
# For an arbitrary endpoint, call it directly:
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}
response = requests.request("GET", "https://evalguard.ai/api/v1/mcp/traffic", headers=headers)
print(response.status_code, response.json())Go
package main
import (
"context"
"fmt"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequestWithContext(context.Background(), "GET", "https://evalguard.ai/api/v1/mcp/traffic", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
fmt.Println(resp.Status)
}