servers icon indicating copy to clipboard operation
servers copied to clipboard

Tool: AgentShield MCP Guard — runtime security for MCP tool calls

Open hidearmoon opened this issue 7 months ago • 1 comments

Summary

AgentShield provides a security guard for MCP servers with two integration patterns:

Pattern 1: Decorator (for new/existing servers)

from mcp.server import Server
from agentshield_mcp import MCPShield

app = Server("my-server")
shield = MCPShield(api_key="your-key")

@app.tool()
@shield.guard
async def query_database(query: str) -> str:
    return db.execute(query)

Pattern 2: Stdio Proxy (zero changes to existing servers)

Sits between MCP client and server, intercepts every tools/call JSON-RPC message:

MCP Client → AgentShield Proxy → Real MCP Server

What it checks

  • Trust level of the data source triggering the tool call
  • Intent consistency (does this tool call make sense in context?)
  • 22 built-in security rules (injection, exfiltration, escalation)
  • Audit trail with Merkle hash chain

Decision mapping

AgentShield MCP Behavior
ALLOW Tool proceeds
BLOCK JSON-RPC error -32001 with reason
REQUIRE_CONFIRMATION Blocked with descriptive message

Links

Fail-open by default — if AgentShield is unreachable, tool calls proceed normally.

hidearmoon avatar Apr 17 '26 08:04 hidearmoon

Thanks for your interest in contributing! We are no longer accepting issues to add server or framework listings to this README. Please publish your server to the MCP Server Registry instead — you can follow the quickstart guide to get listed.

cliffhall avatar Apr 20 '26 18:04 cliffhall