If you are running AI coding agents like Claude Code, Cursor, or Codex, you are likely pasting raw API keys directly into your configuration files. This is a security nightmare waiting to happen, as those secrets sit in plaintext on your disk and, worse, get echoed into the agent's context window where they can be logged, leaked, or screenshot. A new open-source project called mcp-warden aims to fix this by acting as a local-first credential broker for the Model Context Protocol (MCP). Released recently and trending on Hacker News, mcp-warden allows AI agents to execute real actions without ever seeing the underlying secrets.
How It Works
The architecture is elegantly simple. You store your credentials once in your OS keychain (macOS Keychain, Windows Credential Manager, or Linux kernel keyring) via the mcp-warden CLI. The AI agent connects to mcp-warden as an MCP server. When the agent wants to perform an action, such as fetching GitHub repos or charging a Stripe card, it calls a high-level tool like proxy_http with a preset name and a path. mcp-warden validates the request against a strict allow-list, injects the credential server-side, executes the HTTP request, and returns only the response. The agent's context window remains completely clean of sensitive tokens.
Security and Control
mcp-warden isn't just a passthrough; it enforces strict policies. You define presets with scoped actions, such as github-read, which might only allow GET requests to specific endpoints. If an agent tries to access a path outside the allow-list, the request is refused before the credential is even touched. For sensitive operations, the tool triggers a native approval prompt on macOS and Windows, a desktop notification on Linux, or a Telegram message for remote approval. The latest version, v0.5.4, is a security release that patches vulnerabilities found in an audit, including preventing method override attacks and ensuring that auto-approved presets remain bound to their exact confirmed form to prevent config tampering.
Audit and Compliance
Every action, including refused calls and failed approvals, is logged in a local, append-only SQLite audit log. This provides a tamper-evident record of what your AI agent attempted to do and why certain actions were blocked. The tool also includes a kill switch (mcp-warden lock) that stops all servers from making new calls, which can be triggered remotely via Telegram. Unlike some competitors that require cloud accounts or background services, mcp-warden runs as a single binary with no telemetry, appealing to developers who prioritize local control and privacy.
Key Takeaways
- Zero-Secret Context: AI agents never see your API keys, preventing leaks in transcripts or logs.
- Strict Allow-Lists: Credentials are only injected for requests that match predefined, scoped presets.
- Human-in-the-Loop: Native OS dialogs or Telegram prompts provide real-time approval for sensitive actions.
- Local-First Design: Secrets stay in the OS keychain, with no cloud dependency or background service required.
- Comprehensive Auditing: An append-only SQLite log tracks all agent actions, including refusals.
The Bottom Line
mcp-warden is a necessary security layer for the emerging era of autonomous coding agents. If you are letting AI touch your production APIs, you need a broker that keeps your keys out of the model's eyes and your logs clean.