second-desk-trust
Official# Second Desk Trust
Check a tool before you trust it: verify the package, audit the config, scan the code, then decide.
I build and run MCP servers for a living, and I kept hitting the same problem from the other side. Someone hands my assistant a new server, a config file tells it to run a command I have never seen, and nothing anywhere stops to ask whether any of it is safe. So I built the check I wanted. This server answers the questions I now ask before anything new gets near my machine. Is this MCP server safe to install? Does the package do what its description claims? Is there a leaked API key sitting in the code? Does my MCP config hand a server my whole drive? It runs six tools, every audit is read only, and it never prints a secret value. A finding names the key or the kind of secret and stops there.
The capsule half grows out of CapsuleKit, my own earlier build. A capsule is a package that seals itself: a manifest that says exactly what the thing is and does, a hash for every file, and proof checks bundled inside. This server inspects and verifies capsules, and the same folder carries the newer audits for everything that is not sealed, which today is most things.
## Tools
| Tool | What it returns |
|---|---|
| `capsule_inspect` | A capsule's self description in one read: identity, exact does and does not purpose statements, capabilities, requirements, provenance including whether a human confirmed the claims, its bundled proof checks, and its file inventory. Runs nothing. |
| `capsule_verify` | The verdict on a capsule: VERIFIED, FAILED, or INVALID, after validating the manifest, recomputing every file hash and the manifest digest, and, in full mode, re running its bundled proof checks in separate processes. Static mode runs no code. |
| `mcp_config_audit` | A per server report on an MCP client config: commands that do not resolve, argument paths that do not exist, secrets stored as plain text, entries that start through a shell, and arguments that hand over the whole drive or home folder. |
| `package_audit` | A scan of a local folder before you install it: executable files, install and setup scripts including npm install hooks, code that opens network connections with file and line for each hit, and secret shaped strings reported by kind and location, never by value. |
| `site_security_check` | One light check of a website you own or are authorized to test: security headers present and missing, TLS certificate facts, server and generator version signals, and status codes for /.env, /.git/HEAD, /.git/config, and /wp-config.php.bak. A handful of requests, status codes and header facts only. |
| `trust_report` | One verdict on a folder: the package audit, plus the capsule inspection and a static verification when the folder holds a capsule manifest, grouped into a headline and its concerns. |
## Setup
1. Clone this repo.
2. Install the one dependency, the MCP SDK: `pip install -r requirements.txt`
3. Run it: `python mcp_server.py` for stdio, or `python mcp_server.py --transport streamable-http --port 8796` for HTTP. The HTTP transport also answers `GET /health`.
4. Point your MCP client at it. There is no key, no account, and no configuration of its own. Every tool takes the path or the URL you pass it.
Run the tests with `python -m unittest discover -s tests -v`. Sixteen tests, all passing. One of them takes about a minute because it runs the demo capsule's own bundled test suite inside a full verification, which is the point of the exercise.
## Examples
These are real outputs from my own test runs. The full record is in TEST-EVIDENCE.md.
`capsule_verify` on SealPath, a capsule I sealed with CapsuleKit, full mode. Verdict VERIFIED. Digest ok, hashes 32 of 32 ok, and all three bundled proof checks pass: imports, bundled-tests, engine-smoke. Change one byte in one file and the same call comes back FAILED with that file named. I know because that tamper case is one of the tests.
`capsule_inspect` on the same capsule, for the quick read before the deep one: identity seconddesk/sealpath, 32 files, 227,646 bytes, no structure errors.
`mcp_config_audit` on a config I wrote for the test fixture, with one planted problem of each kind across five server entries. It found all of them: 3 high findings (a command that does not resolve, a token stored as plain text with the key named and the value never shown, and an argument that hands over the whole drive) and 3 medium (a missing argument path, and a shell entry flagged for both the shell command and its -c argument).
`package_audit` on a fixture folder with planted problems: 1 executable (run.sh), 1 install script (setup.py), 3 places where code opens network connections (net.py, lines 3, 7, and 12), and 2 secret shaped strings (secret.py line 7 shaped like a GitHub token, line 8 a password assignment). Kinds and locations only. The planted values appear nowhere in the report.
`site_security_check` on my own site, seconddesk.onrender.com. Status 200. All six standard security headers present, none missing. The Server header says cloudflare. All four exposure paths answered 404. TLS 1.3, certificate issued by Google Trust Services, valid through February 17, 2027. Five requests total, which is all this check ever makes.
`trust_report` on the fixture folder: headline "Concerns found. Read the findings before use." followed by the three grouped concerns, one each for the secrets, the install script, and the network code.
## Limits
- The config audit checks commands and paths against the machine this server runs on. Run it where your MCP client runs, or the answers describe the wrong machine.
- The package audit reads code as text and matches the patterns it knows. A clean scan means nothing it knows about was found. It is not proof a package is safe. The walk caps at 5,000 files and skips .git, node_modules, and virtual environment folders.
- The site check is a light defensive check, not a penetration test. It sends a handful of requests and records headers and status codes. A clean result means these specific things looked right and nothing more. Only use it on sites you own or are authorized to test.
- Full mode capsule verification runs the capsule's own proof checks in separate processes with a scrubbed environment. That is process isolation, not a sandbox. For a capsule from a source you do not trust yet, use static mode, or inspect first and decide.
- Secret findings are pattern matches. A hit can turn out to be a fake or a test value, and a miss is not a guarantee. Either way, the value itself is never read out, here or anywhere else in these tools.
## License
MIT. See LICENSE.
TDQS
Scored across 6 tools
The three capsule/folder tools have real conceptual overlap, but the descriptions draw clean lines: capsule_inspect only reads, capsule_verify verifies (with an explicit static/full mode), and trust_report is transparently a composite that defers to the others and explicitly notes proof checks are not run. mcp_config_audit, package_audit, and site_security_check target clearly different artifacts (config file, local folder, remote URL). The only residual risk is an agent choosing trust_report vs. calling package_audit plus capsule_verify directly.
All names are snake_case with a consistent subject_action shape, and the capsule_* pair is prefixed cleanly. Minor deviation: trust_report lacks the artifact prefix that the other five tools carry (package_, capsule_, mcp_config_, site_), so its scope is less self-evident from the name alone.
Six tools is well within the sweet spot, and each covers a distinct artifact class or abstraction level (folder verdict, folder scan, capsule read, capsule verify, MCP config, website). No filler tools and no obvious area over-served.
The audit lifecycle is covered for all four artifact types with sensible safe-by-default modes (nothing is executed unless asked). Gaps are minor: there is no way to seal or build a capsule, no schema/shape reference for the return objects, and no combined report path for MCP configs or sites equivalent to trust_report, but agents can compose the existing calls.