Shield MCP logo

Shield MCP

by shieldmcp

Shield MCP is a security middleware for Model Context Protocol (MCP) servers. It enhances security and monitoring capabilities without modifying the official SDK.

View on GitHub

Last updated: N/A

What is Shield MCP?

Shield MCP is a security middleware designed to protect Model Context Protocol (MCP) servers. It provides a suite of tools to secure and monitor MCP tool calls, ensuring best practices in security and abstracting complexities during MCP development.

How to use Shield MCP?

To use Shield MCP, install the package, configure allowed tools, sanitizers, and rate limits, and then apply the @secure_tool decorator to your MCP tools. You can also use the individual components like ToolAudit, ToolAccess, ToolSanitizer, and RateLimitConfig directly.

Key features of Shield MCP

  • Tool Access Control

  • Result Sanitization

  • Structured Logging

  • Rate Limiting

  • Error Handling

  • MCP Inspector Compatible

Use cases of Shield MCP

  • Securing MCP tool calls

  • Monitoring MCP tool usage

  • Preventing unauthorized access to tools

  • Sanitizing sensitive data in tool outputs

  • Limiting the rate of tool calls to prevent abuse

FAQ from Shield MCP

What is Tool Access Control?

Whitelist-based access control that allows you to specify which MCP tools are allowed to be called.

How does Result Sanitization work?

It allows you to configure sanitization rules to remove or mask sensitive data from tool outputs.

What kind of logging does Shield MCP provide?

Comprehensive audit logging using structlog, providing structured logs for better analysis.

How does Rate Limiting prevent abuse?

It uses a token bucket algorithm to limit the number of requests per minute, preventing excessive usage.

Is Shield MCP compatible with the MCP Inspector tool?

Yes, Shield MCP is designed to work seamlessly with the MCP Inspector tool.