Works with the AI Agents you already use
mcp audit trail generator
Design compliance-ready audit trail schemas for MCP servers mapped to SOC 2 and ISO 27001 controls.
$12
mcp audit trail generator
Example session with this skill installed
I need an audit trail schema for my MCP server to satisfy SOC 2 CC7.2. We currently only log to stdout via the standard TypeScript SDK logger.
- Read your context and instructions
- Compiled the mcp audit trail
I have analyzed your current logging state. Standard stdout logging in the MCP SDK is typically request-scoped and lacks the durable, structured fields required for CC7.2 anomaly analysis.
MCP Audit-Trail Schema Design
| Field | Type | Source / Derivation | Compliance Correlation |
|---|---|---|---|
timestamp | ISO8601 | Server-side clock at invocation start | ISO A.8.15 (Date/Time) |
caller_id | String | Verified session/auth token (not client-provided) | SOC 2 CC6.1; ISO A.8.15 (User-ID) |
tool_name | String | callTool request name parameter | ISO A.8.15 (Event Type) |
arguments | JSON | Redacted/Allowlisted per tool definition | Internal Accountability |
outcome | Enum | Success/Error code + exception class | SOC 2 CC7.2 (Anomaly Raw Material) |
session_id | UUID | Transport-layer correlation ID | ISO A.8.15 (Network Address/Origin) |
Implementation Strategy (TypeScript)
// Middleware wrapper for MCP tool handlers
async function withAuditLogging(name: string, args: any, handler: Function) {
const startTime = new Date().toISOString();
const caller = getVerifiedCaller(); // From session context
try {
const result = await handler(args);
await logToPersistentStore({
timestamp: startTime,
caller_id: caller,
tool_name: name,
arguments: redactArgs(name, args),
outcome: 'SUCCESS',
duration_ms: Date.now() - new Date(startTime).getTime()
});
return result;
} catch (error) {
await logToPersistentStore({
timestamp: startTime,
caller_id: caller,
tool_name: name,
arguments: redactArgs(name, args),
outcome: `ERROR: ${error.constructor.name}`
});
throw error;
}
}
Next steps
- Define a
redactArgsallowlist for your specific tools to prevent PII leakage. - Select a persistent storage backend (e.g., CloudWatch, ELK, or a dedicated SQL table).
- Document your retention period based on your SOC 2 observation window.
Connects securely to your tools. The creator never sees your data.
About this skill
The Model Context Protocol (MCP) spec lacks a durable invocation-logging standard, leaving teams exposed during SOC 2 or ISO 27001 audits. This skill designs a compliance-grade audit-trail schema that maps tool calls to specific regulatory controls. It bridges the gap between raw tool execution and the structured records auditors require.
What it does
- Schema design defines a structured field set (who, what, when, origin, payload, outcome) for tool invocations.
- Compliance mapping correlates specific log fields to SOC 2 CC7.2/CC6 and ISO 27001 Annex A.8.15.
- Payload redaction establishes per-tool allowlists and hashing strategies to prevent logging secrets or PII.
- Gap analysis audits existing MCP server logs against the target schema to identify missing data points.
- Retention documentation drafts policy language based on actual business drivers rather than arbitrary mandates.
How it works
- Inventory the current logging state of your MCP servers, including output destinations and captured fields.
- Audit the existing logs against the target schema to report gaps in caller identity or outcome tracking.
- Generate the field-by-field schema, mapping each element to its primary or secondary compliance source.
- Configure redaction rules for every tool exposed by the server to handle sensitive arguments safely.
Frameworks & tools
Model Context Protocol (MCP), SOC 2 (Trust Services Criteria), ISO 27001, and implementation snippets for MCP SDKs (TypeScript/Python).
Why this beats prompting it yourself
Generic prompts often suggest logging raw tool arguments, which creates a security risk by leaking API keys or PII into log files. This skill enforces a redaction-first design and uses precise, sourced correlations to compliance frameworks instead of vague regulatory claims.
Use cases
- Designing the logging middleware for a new production-grade MCP server.
- Preparing for a SOC 2 Type II audit where MCP tool usage is in scope.
- Hardening an existing MCP deployment against PII leakage in debug logs.
- Documenting log retention policies for cyber-insurance or contractual requirements.
Known limitations
Does not generate actual evidence artifacts or perform runtime log enforcement. Cannot issue formal compliance verdicts. Not for finding code-level security vulnerabilities.
Does not collect real log data. Cannot issue official compliance certifications. Focuses on schema design, not runtime enforcement. Redaction requires manual tool-by-tool configuration.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 month ago
Requires
Permissions
No special permissions declared or detected