How to Audit an MCP Server: A Practical Security Checklist
Audit an MCP server from inventory and identity through tool schemas, downstream authorization, prompt injection tests, logging, and retesting.
By Agent Guard Team11 min read
How to Audit an MCP Server: A Practical Security Checklist
An MCP server audit should prove who can discover a capability, who can invoke it, which downstream identity is used, and what effect the request can create. Start with one complete request path and retain evidence from the client, server, and downstream system. A tool list alone cannot show whether authorization or side-effect controls work.
Define the audit scope and trust boundary
Write down the server version, owner, repository, build artifact, deployment location, transport, clients, tools, resources, prompts, credentials, and downstream systems. Include local stdio processes and remote HTTP endpoints because their trust assumptions differ.
The AgentGuard MCP security overview can help teams enumerate supply-chain, metadata, identity, and runtime action risks before choosing tests.
Inventory the complete path
Draw one line from user or agent identity to the MCP host, client connection, server, downstream API, and final data or action. Mark every point where identity changes. A shared service credential can erase the original caller even when the front door is authenticated.
Record all alternate paths. Development endpoints, legacy transports, direct backend access, and stale client configurations often bypass the primary control.
Verify server provenance and deployment
Confirm that the reviewed source corresponds to the deployed artifact. Pin package versions and hashes, review maintainers and release history, and reproduce the build when the server is high impact.
Source and build integrity
Inspect install scripts, dependency changes, obfuscated code, dynamic downloads, environment reads, and outbound calls. Check whether a server can update tool descriptions or code without a review event. AgentGuard Deep Scan documents scanning for risks in MCP servers and related agent components.
A static finding is a lead. Validate reachability and impact in a controlled environment before assigning final severity.
Transport exposure
For stdio, verify which local process launches the server, what environment it inherits, and whether untrusted projects can alter its command or arguments. For remote servers, inspect TLS, authentication, allowed origins, redirect behavior, rate limits, and network reachability.
Stop the audit when the deployed endpoint, artifact, or owner cannot be identified. Results tied to an unknown version will not support a release decision.
Inspect tools, resources, and prompts
Export the server's advertised capabilities. Compare the discovered list with the approved inventory and flag hidden, renamed, overly broad, or duplicate operations.
Tool schemas
For every tool, document inputs, outputs, data classes, permissions, side effects, and downstream APIs. Prefer narrow operations such as read_ticket and update_ticket_status over a generic command or arbitrary URL fetcher.
Test missing fields, extra fields, wrong types, oversized values, path traversal, shell metacharacters, alternate encodings, cross-tenant identifiers, and free-form destinations. Validation should occur before any downstream call.
Metadata as untrusted input
Tool descriptions, prompt templates, resource content, and returned text can contain instructions that influence the model. Review them as untrusted content. A description must not ask the client to reveal secrets, disable policy, or invoke another tool without user intent.
The OWASP MCP Top 10 provides a useful threat catalog for tool poisoning, token exposure, excessive permissions, and related MCP failure modes.
Convert each relevant threat into a test against your actual server. Generic checklist completion does not prove the deployed path.
Test authentication and downstream authorization
Authentication identifies a caller. Authorization decides whether that caller may perform this tool action on this resource. Test both layers and retain the downstream outcome.
Remote server identity tests
Use a valid token, expired token, malformed token, wrong audience, wrong issuer, missing scope, and token intended for a different resource. The official MCP authorization specification defines the protocol's authorization framework for HTTP-based transports.
Verify that discovery and invocation enforce the intended scopes. A read-only identity should not discover or execute a write capability when your design uses scope-based separation.
Confused-deputy tests
Attempt to use a token issued for one server or resource against another. Change tenant, project, repository, or account identifiers inside otherwise valid requests. The server should bind the caller, scope, and target rather than trusting a model-supplied identifier.
Inspect the downstream audit log. If every action appears under one unrestricted service identity, require server-side policy that preserves caller context and resource boundaries.
Exercise abuse cases safely
Use an isolated tenant, synthetic records, inert credentials, and reversible actions. Do not point destructive cases at production.
Prompt injection
Place instructions in a tool description, resource, retrieved document, and tool response. Ask the model to perform a benign task that encounters each payload. The pass condition is that untrusted content cannot broaden authority or cause an unrelated tool call.
Argument and side-effect tests
Try cross-tenant IDs, arbitrary file paths, internal network destinations, duplicate requests, reordered approval steps, and replayed calls. For write tools, verify confirmation, idempotency, rollback, and exact downstream change.
Keep at least one benign control case beside every attack case. A server that blocks all requests may appear secure while being unusable.
Validate logs, alerts, and incident evidence
An audit log should reconstruct the decision without storing unnecessary secrets or full sensitive payloads. Confirm access controls, retention, export, clock consistency, and tamper resistance.
Minimum audit record
Retain timestamp, client and user identity, server version, tool name, normalized argument summary, policy decision, approval state, downstream target, outcome, error class, correlation ID, and policy version. Redact credentials and sensitive content.
Use AgentGuard documentation to verify what a supported integration records and where its decision sits in the path.
The server and downstream system remain the primary sources for authentication and final effect. A guard event adds useful context only when correlation is tested.
Build an evidence matrix before rollout
Convert every important How to Audit an MCP Server control claim into a row with five fields: the protected asset, the initiating identity, the proposed action, the independent enforcement point, and the final evidence. Add one allowed case and one denied case. This prevents a review from stopping at a settings page while an alternate path can still reach the same effect.
Reviewers should ask what changes when How to Audit an MCP Server moves from interactive assistance to delegated or autonomous work. Record network destinations, inherited credentials, repository or data scope, durable state, extension behavior, and approval timing. A control that works during a supervised prompt may not cover a background task, retry, delegated agent, or integration token.
Use synthetic records and inert targets for the first How to Audit an MCP Server run. Preserve the effective configuration, request, policy input, decision, user-facing result, downstream state, and timestamp. A result is complete only when the team can connect the original user intent to the final system effect.
Assign control ownership
For How to Audit an MCP Server, name the team that owns identity, platform configuration, downstream authorization, data policy, runtime decisions, monitoring, and incident response. Define which owner can stop the workflow and how quickly revocation propagates. Shared responsibility without an explicit handoff usually becomes a gap during failure.
Test change and recovery paths
A How to Audit an MCP Server security evaluation must cover change, not only initial configuration. Repeat the baseline when models, prompts, extensions, tools, permissions, dependencies, network destinations, or administrative policies change. Compare the previous and current evidence so reviewers can distinguish intended evolution from drift.
Exercise How to Audit an MCP Server recovery with a harmless scenario. Revoke the agent credential, disable the integration, quarantine a component, and verify that queued or retried work cannot continue with cached authority. Confirm that investigators can retrieve the complete trace without exposing secrets or unrelated user data.
Define release criteria
For How to Audit an MCP Server, require a useful allowed case, a blocked high-impact case, a review case, a tested stop mechanism, and a complete evidence record. Document any unsupported path as a release exception with an owner, expiry date, and compensating control.
For How to Audit an MCP Server, preserve the versioned configuration and rerun the denied case after every material change. Verify both the policy decision and the downstream result, because either side alone can hide a bypass or partial failure.
Review How to Audit an MCP Server network behavior from the actual execution environment. Test an approved destination and an inert denied destination, then confirm that retries, redirects, package downloads, and delegated work cannot escape the same policy.
Inspect how How to Audit an MCP Server handles credentials. Record issuance, scope, storage, redaction, expiry, and revocation. A workflow can misuse a secret without printing it, so verify destination and downstream effects as well as prompt and log exposure.
Test How to Audit an MCP Server with untrusted content placed in a realistic source such as a document, issue, page, or tool response. The content may influence planning, but it must not grant authority or remove an approval requirement.
Confirm that How to Audit an MCP Server audit evidence survives a partial failure. Correlate the original request, active versions, proposed action, policy decision, approval, execution status, and target-system outcome without storing unnecessary sensitive data.
Run the How to Audit an MCP Server release review with platform, application, IAM, data, and incident-response owners. Resolve gaps in ownership, stop authority, and evidence retrieval before granting production credentials or irreversible access.
Document every How to Audit an MCP Server exception with its business reason, affected assets, compensating control, owner, and expiry date. Retest the normal boundary when the exception ends so temporary authority does not become permanent drift.
After release, monitor How to Audit an MCP Server denials, approvals, unusual targets, permission changes, component updates, and trace gaps. Use those signals to select regression cases, while keeping the approved allow path available to legitimate users.
Define a How to Audit an MCP Server fallback for unavailable policy, network loss, incomplete context, and downstream timeout. High-impact actions should fail closed or pause for review; low-impact work may continue only under an explicit cached policy with a bounded lifetime.
Separate the How to Audit an MCP Server detection result from the enforcement result. Record which component recognized the risk, which component made the decision, and which system enforced it. This distinction makes partial coverage and failed integrations visible.
Check the How to Audit an MCP Server user experience for clear denial reasons and recovery steps. Users should know which boundary stopped the request, what safe alternative remains available, and who can review a legitimate exception without bypassing policy.
Score findings and retest
Rate a finding by reachable effect, required access, affected data, blast radius, detectability, and recovery. Separate confirmed exploit paths from design weaknesses and informational hardening items.
Release decision
Block release for unauthenticated remote access, cross-tenant actions, arbitrary command or network reach, credential disclosure, unreviewed artifact drift, and missing evidence for high-impact writes. Assign an owner and due date to every accepted risk.
Use the final release record to capture:
1. the server version and approved artifact hash; 2. every confirmed high or critical finding and its retest result; 3. accepted risks with owner, expiry, and compensating control; and 4. the rollback trigger plus the person authorized to disable the server.
Retest the original request after the fix, then repeat a neighboring benign case and alternate path. Teams can Audit an MCP Workflow when they need a scoped component and action review.
Frequently Asked Questions
What should an MCP server audit include?
It should cover provenance, deployment, capability schemas, metadata, authentication, authorization, downstream identity, abuse cases, logging, recovery, and retesting.
Can a static scanner fully audit an MCP server?
No. Static analysis can identify risky code and configuration, while identity, transport, downstream authorization, runtime behavior, and logging require live controlled tests.
How do I test an MCP tool safely?
Use synthetic data and an isolated account, define the expected side effect, run allowed and denied cases, and verify the downstream record before cleanup.
What evidence should MCP logs contain?
They should identify the caller, server version, tool, normalized request, policy and approval decision, downstream target, outcome, and correlation ID without exposing secrets.
How often should MCP servers be re-audited?
Re-audit after code, dependency, tool-schema, permission, transport, identity-provider, downstream API, or policy changes. High-impact servers also need scheduled drift checks.
Inspect one high-impact agent path before production rollout.
Test the Path