Skip to content
Back to search

mcp-warden

Sandboxed Rust control plane and policy proxy for MCP servers

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/danieldd28--mcp-warden/badge.svg)](/listings/danieldd28--mcp-warden)

HTML

<a href="/listings/danieldd28--mcp-warden"><img src="/api/listings/danieldd28--mcp-warden/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 118 lines
  1. # mcp-warden
  2. Open-source, self-hosted Rust control plane and sandboxed proxy for
  3. [MCP](https://modelcontextprotocol.io) (Model Context Protocol) servers.
  4. Warden sits between an MCP client and an MCP server, runs the server inside an
  5. isolation boundary, and enforces policy on every JSON-RPC 2.0 message that
  6. crosses it.
  7. > Status: pre-alpha. This repository currently contains the architecture spec
  8. > only. Nothing below is implemented yet.
  9. ## Architecture
  10. Isolation is tiered by trust level.
  11. ### Tier 1: local stdio servers
  12. The server process is spawned with:
  13. - Linux namespaces (user, pid, mount, net, ipc, uts)
  14. - Landlock filesystem rules
  15. - seccomp-bpf syscall filtering
  16. - cgroups v2 resource limits
  17. - `PR_SET_PDEATHSIG` so the child dies with the proxy
  18. All child-side setup runs inside `CommandExt::pre_exec`, so it is restricted to
  19. async-signal-safe operations: no allocation, no locks, raw syscalls only. Rules
  20. are compiled in the parent and applied in the child.
  21. ### Network and secret isolation
  22. The child runs in an isolated network namespace with no direct egress. All
  23. outbound traffic goes through the proxy, which:
  24. - enforces per-server domain allowlists
  25. - injects ephemeral secrets at the boundary, so the server process never holds
  26. long-lived credentials
  27. ### Hot-path guardrails
  28. WASM filters run on Wasmtime and can inspect or mutate JSON-RPC 2.0 payloads in
  29. both directions. Target overhead is sub-millisecond per message.
  30. ### Tier 2: untrusted and multi-tenant servers
  31. Stronger isolation (Firecracker microVM or rootless OCI) is provided through an
  32. object-safe trait, selected at runtime as `Arc<dyn SandboxRunner>`:
  33. ```rust
  34. #[async_trait]
  35. pub trait SandboxRunner: Send + Sync {
  36. async fn spawn(&self, spec: &SandboxSpec) -> Result<SandboxedChild>;
  37. }
  38. ```
  39. ## Planned workspace layout
  40. | Crate | Responsibility |
  41. |-------|----------------|
  42. | `warden-core` | JSON-RPC framing via `tokio_util::codec`, TOML policy middleware, `tracing` audit logs |
  43. | `warden-sandbox` | `SandboxRunner` trait, `NoopRunner`, `LinuxRunner` |
  44. | `warden-cli` | `warden run --config warden.toml -- <cmd>` |
  45. ## Example config
  46. ```toml
  47. [server]
  48. name = "filesystem"
  49. [policy.tools]
  50. allow = ["read_file", "list_directory"]
  51. deny = ["write_file"]
  52. [sandbox]
  53. runner = "linux"
  54. [[sandbox.mounts]]
  55. host = "/usr"
  56. guest = "/usr"
  57. mode = "ro"
  58. [[sandbox.mounts]]
  59. host = "/home/me/projects/app"
  60. guest = "/workspace"
  61. mode = "rw"
  62. [network]
  63. allow_domains = ["api.github.com"]
  64. [secrets]
  65. GITHUB_TOKEN = { env = "WARDEN_GITHUB_TOKEN", ttl = "10m" }
  66. ```
  67. Usage:
  68. ```sh
  69. warden run --config warden.toml -- npx @modelcontextprotocol/server-filesystem /workspace
  70. ```
  71. The config schema is a draft and will change.
  72. ## Roadmap
  73. **Milestone 1**
  74. - stdio proxy with JSON-RPC framing
  75. - `SandboxRunner` trait with `NoopRunner` and `LinuxRunner`
  76. - Landlock and `PR_SET_PDEATHSIG` on Linux
  77. - integration tests
  78. **Milestone 2**
  79. - Wasmtime filter pipeline
  80. - Streamable HTTP and SSE transports
  81. - secret injection
  82. ## License
  83. MIT. See [LICENSE](LICENSE).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.