πŸ€– AI Tools
Β· 2 min read

MCP Security Checklist β€” 12 Controls Before Production


Before deploying MCP servers in production, verify these 12 controls. Based on the risks outlined in our MCP Security Risks guide.

Input & validation

1. βœ… Validate all tool parameters β€” Use Zod (TypeScript) or Pydantic (Python). Never trust raw LLM output.

2. βœ… Sanitize tool responses β€” Strip potential prompt injection from data returned by tools.

3. βœ… Rate limit tool calls β€” Prevent runaway agents from making thousands of calls.

Authentication & authorization

4. βœ… Authenticate remote connections β€” For SSE transport, require API keys or OAuth. Never expose servers without auth.

5. βœ… Implement per-user permissions β€” Check user permissions on every tool call, not just at connection time.

6. βœ… Use least privilege β€” Each server only accesses what it absolutely needs.

Isolation & containment

7. βœ… Sandbox MCP servers β€” Run in Docker containers or separate processes.

8. βœ… Network segmentation β€” Internal servers (database, files) should not have outbound internet access.

9. βœ… Separate read and write β€” Consider separate servers for reading vs writing. AI reads freely, needs approval to write.

Monitoring & audit

10. βœ… Log every tool call β€” Record: timestamp, tool name, parameters, user, result.

11. βœ… Alert on anomalies β€” Flag unusual patterns: high volume, unexpected tools, off-hours access.

12. βœ… Human approval for destructive actions β€” Delete, send, deploy, pay β€” require confirmation.

Quick implementation

Most of these controls can be added in under an hour. Start with the top 3:

  1. Input validation (Zod/Pydantic) β€” 15 minutes
  2. Logging every tool call β€” 15 minutes
  3. Least privilege (review what each server accesses) β€” 30 minutes

Then add auth, sandboxing, and monitoring as you move toward production.

Testing your security

Before deploying, try to break your own MCP server:

  • Send SQL injection in tool parameters
  • Include prompt injection in tool responses
  • Try accessing resources outside the allowed scope
  • Test with missing or invalid auth tokens

If any of these succeed, fix them before production.

For GDPR compliance

Also verify: data processed by MCP servers is covered by your DPA, personal data doesn’t flow through non-compliant providers, and consider self-hosting for sensitive data.

Related: MCP Security Risks Β· MCP Complete Guide Β· Self-Hosted AI for GDPR Β· Best Password Managers for Developers