ActionFence: A drop-in middleware for MCP servers to enforce spend caps and policy limits

Reddit r/AI_Agents Tools

Summary

ActionFence is an open-source middleware tool for enforcing security policies, such as spend caps and identity tiers, on MCP servers and Express APIs to protect against agent misuse.

As we all start giving agents more powerful tools, securing the server side has become a headache. I kept seeing enterprise gateway solutions, but nothing that was just a simple npm install for a solo dev. So I built ActionFence — an open-source, embeddable firewall specifically designed to sit in front of your MCP servers (and Express APIs). You wrap your server with one line of code: withGuard(server, { policy: './guard-policy.json' }) Your guard-policy.json acts like a robots.txt for agents. It lets you enforce: • ⁠Identity tiers: Restrict certain tools to anonymous vs. token vs. verified JWT. • ⁠Rate limiting: Prevent agents from looping and spamming your endpoints. It also logs every decision into an append-only SQLite database as a hash-chained receipt, so you have cryptographic proof of why an action was allowed or blocked. There is also a simulation CLI (npx actionfence simulate) so you can dry-run your policies before agents hit them. Would love to hear from this community if there are specific MCP edge cases I should handle in v0.2!
Original Article

Similar Articles

FloMCP

Product Hunt

FloMCP is a tool that packages MCP servers with 32 built-in security checks and can deploy them in under five minutes.

GetMCP: Zero Trust for AI agents

Reddit r/AI_Agents

GetMCP is a self-hostable open-source tool that brings zero-trust security to AI agents by providing per-request audit, per-agent revocation, policy enforcement, and human-in-the-loop approvals for API calls. It generates MCP servers from OpenAPI specs and acts as a streaming proxy with tamper-evident audit logs.