Skip to main content

diagrid mcpserver logs

Stream or verify logs for an MCP server

Description​

Stream logs for an MCP server in a project.

With --verify, verify the MCP server's API log against the identity of the sidecar that wrote it instead. The sidecar signs its API log with its workload identity: every few seconds it writes a checkpoint that signs the lines since the one before. --verify reads the lines in a time window exactly as they are stored, and checks that each was written by this MCP server's sidecar, has not been altered since, and that none is missing from a signed range. The signing certificates must chain to the signing authorities the project's region publishes, or to the bundle passed with --trust-anchor.

The lines are read from a minute before --since, so a signed range the window starts inside can still be checked. Lines newer than the last checkpoint read are reported as unverified until the next one is written.

Save the lines with --export to verify them again later, offline, with --file. The log store keeps lines for a few days; a saved file keeps its proof.

The result says when the first and last verified records were written. Check that it spans the window you asked for: records deleted from the start of the window, checkpoints with them, look like a window that starts later.

With --verify, exits non-zero when a line was altered, injected or reordered, when lines are missing from a signed range, or when no record in the window could be verified.

diagrid mcpserver logs <mcpserver> [flags]

Examples​


# Retrieve the most recent logs
diagrid mcpserver logs my-mcpserver --project my-project

# Get the last 5 log entries
diagrid mcpserver logs my-mcpserver --project my-project -t 5

# Follow the logs
diagrid mcpserver logs my-mcpserver --project my-project --follow

# Verify the last hour of the API log
diagrid mcpserver logs my-mcpserver --project my-project --verify

# Verify a fixed window and save the signed lines for an auditor
diagrid mcpserver logs my-mcpserver -p my-project --verify --since 2026-10-30T09:00:00Z --until 2026-10-30T10:00:00Z --export my-mcpserver.jsonl

# Verify a saved file offline, against a CA bundle obtained out of band
diagrid workflow archive trust-anchor -p my-project --out sentry-ca.pem
diagrid mcpserver logs my-mcpserver --verify --file my-mcpserver.jsonl --trust-anchor sentry-ca.pem \
--app-id my-mcpserver-appid --namespace prj-1234 --org <org-id>

# Machine-readable verification result
diagrid mcpserver logs my-mcpserver -p my-project --verify -o json

Options​

-p, --project string Name of existing project
-f, --follow Follow the logs
-t, --tail int Number of log entries to display from the most recent entry (default 10)
--verify Verify the signed API log instead of streaming logs
--since string With --verify, start of the window: RFC3339 or a duration like 24h (at most 7 days ago) (default "1h")
--until string With --verify, end of the window: RFC3339 or a duration like 1h (default: now)
--export string With --verify, also save the signed lines read to this file, to verify again later with --file
--file string With --verify, verify lines saved with --export instead of reading them ("-" for stdin)
--trust-anchor string With --verify, PEM CA bundle to verify against; if unset, the signing authorities the project's region publishes are used
--app-id string With --verify, App ID the signing sidecar must be; resolved from the MCP server when unset
--namespace string With --verify, namespace the signing sidecar must be in; defaults to the project's signing namespace
--org string With --verify, organization ID the lines were read from; defaults to the current organization
-o, --output string With --verify, output format: text or json (default "text")
-h, --help help for logs

Options inherited from parent commands​

--api-key string Diagrid Cloud API key

SEE ALSO​