Skip to main content
Glama
README.md
# Secret drop

**Let your AI coding agent ask you for API keys, passwords and one-time PINs without them going through the chat.**

The agent says *where* a secret goes: a key in your `.env`, a spot in a config file, or a command like `gh secret set`. A page opens in your browser. You paste the value there, it's written straight into place on your computer, and the agent is told "done". It never sees what you pasted.

Secret drop is a small local [MCP](https://modelcontextprotocol.io) server. It works with Claude Code, Codex, Claude Desktop, Cursor and any other MCP client that runs local (stdio) servers. It needs Node 18+ and has no dependencies.

![The Secret drop page with two requests from Claude Code: a Stripe key for .env and a GitHub Actions secret](docs/screenshot.png)

## Why

When an agent needs a key, the easy thing is to paste it into the chat. Then it's in the transcript, in the model provider's logs and in the agent's context for the rest of the session. Secret drop gives the agent a way to ask for a secret and get it into place without ever holding it.

## How it works

```
 agent ──request_secret──▶ secret-drop (local MCP) ──opens──▶ page on 127.0.0.1 ◀── you paste
   ▲                              │
   └──── "delivered" (no value) ◀─┴── writes .env / file, or runs the command with it on stdin
```

1. **The agent asks.** It calls `request_secret` with a reason and a destination (see [Destinations](#destinations)).
2. **You paste.** A page opens in your default browser. It shows which agent is asking and from which project, why, and exactly where the value will go. It warns you before you paste: if the file isn't git-ignored or is already committed, if a placeholder is missing, if a file would be replaced, or if the agent will see a command's output. Paste, then press **Put it there** (or **Decline**). Several requests stack up as cards on the same page.
3. **The agent carries on.** `request_secret` waits up to 50 seconds for you. If you're slower, it returns `waiting`, and the agent calls `wait_for_secret` or carries on with other work and checks back. Once it's `delivered`, the agent gets where the secret went, never the value.

![After pasting: "Added STRIPE_SECRET_KEY in ~/demo-shop/.env. Claude Code has been told it's there, not what it is."](docs/screenshot-done.png)

## Install

Clone it anywhere:

```sh
git clone https://github.com/MarkGrenville/secret-drop.git ~/secret-drop
```

Then add it to your agent.

**Claude Code**

```sh
claude mcp add --scope user secret-drop -- node ~/secret-drop/bin/secret-drop.js
```

**Codex**

```sh
codex mcp add secret-drop -- node ~/secret-drop/bin/secret-drop.js
```

**Claude Desktop, Cursor, Windsurf and others** (JSON config, e.g. `claude_desktop_config.json` or `~/.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "secret-drop": {
      "command": "node",
      "args": ["/absolute/path/to/secret-drop/bin/secret-drop.js"]
    }
  }
}
```

Apps you open from the Dock or Start menu may not find `node` on your PATH (common with nvm). If so, use the full path that `which node` prints as `command`.

**Without cloning**, npx can run it straight from GitHub (slower to start):

```sh
claude mcp add --scope user secret-drop -- npx -y github:MarkGrenville/secret-drop
```

Start a new agent session after adding it.

### Optional: the skill

`skill/secret-drop/SKILL.md` is an [agent skill](https://docs.claude.com/en/docs/claude-code/skills). With it, Claude Code and Codex reach for Secret drop as soon as you say "I'll paste the key" or "I've got the OTP". The MCP's own instructions already tell agents to use it, so the skill is a belt-and-braces extra. To install it:

```sh
mkdir -p ~/.claude/skills ~/.agents/skills
cp -R ~/secret-drop/skill/secret-drop ~/.claude/skills/   # Claude Code
cp -R ~/secret-drop/skill/secret-drop ~/.agents/skills/   # Codex (older versions read ~/.codex/skills)
```

## What to say

Talk normally and say where the secret goes:

- "Add my Stripe secret key to the .env, I'll paste it in secret drop."
- "Set the `DEPLOY_TOKEN` GitHub Actions secret, I'll give you the value."
- "I've got the one-time PIN for the Firebase login, put it where it needs to go."
- "Put the service-account JSON in `keys/firebase.json`."

The agent calls `request_secret`, the page opens, you paste. If an agent ever asks you to paste a secret into the chat, say "use secret drop".

## Destinations

| `destination` | What happens | Fields |
| --- | --- | --- |
| `env` | Sets `KEY=value` in a dotenv file. Every other line is kept. An existing `KEY` is replaced, even if its old value spans several lines. A new file is created readable by you only (`0600`). Values are quoted so dotenv loaders read them back unchanged. | `path`, `key` |
| `file` with `placeholder` | Replaces every occurrence of a placeholder the agent already wrote into the file, e.g. `api_token: "__API_TOKEN__"`. | `path`, `placeholder` (4+ characters) |
| `file` without `placeholder` | Writes the whole file: a PEM key, a service-account JSON. It won't replace an existing file unless the agent asked with `overwrite: true`, and the page says so. | `path`, `overwrite`, `multiline` |
| `command` | Runs a command in your shell, in `cwd`, with the secret on **stdin** (default, no trailing newline) or in an **environment variable** (`pass_as: "env"`, `env_name`). The secret is never put on the command line. | `command`, `cwd`, `pass_as`, `env_name` |

Every request also takes a `reason` (required), a `label` (what to paste, e.g. "6-digit code from the SMS"), `expires_in_minutes` (default 30) and `wait_seconds` (0–55, default 50).

Commands that read a secret on stdin: `gh secret set NAME`, `firebase functions:secrets:set NAME --data-file=-`, `npx wrangler secret put NAME`, `vercel env add NAME production`. For a tool that takes it as a flag, use `pass_as: "env"`, e.g. `some-cli login --token "$SECRET_VALUE"`.

## Tools

| Tool | What it does |
| --- | --- |
| `request_secret` | Ask for a secret and say where it goes. Opens the page and waits up to `wait_seconds`. |
| `wait_for_secret` | Wait for an answer (up to 55 s per call). Returns `waiting`, `delivered`, `declined`, `cancelled`, `expired` or `failed`. |
| `check_secret` | Say whether a `KEY` is set in a dotenv file, how many of a placeholder are left, or whether a file exists, without reading the value out. Also reports whether git would pick the file up. |
| `list_secret_requests` | This session's waiting and recent requests (metadata only). |
| `cancel_secret_request` | Withdraw a request; its card disappears from the page. |

**Webhook:** pass `notify_url` (any `https://` URL, or `http://` on localhost) and Secret drop POSTs `{ "event": "secret.delivered", "request": { … } }` there when the request finishes. The same goes for `secret.declined`, `secret.expired` and the rest. The value is never included.

## Security

What it guarantees:

- **The value only goes page → local server → file or command.** It never appears in a tool result, the log, a webhook or an error message. When a command prints it, the output the agent sees has it blanked out as `[secret]`. Redaction also catches its base64, base64url, hex, URL-encoded and JSON-escaped forms.
- **Only you can reach the page.** It listens on `127.0.0.1` only, on a random port, behind a random 192-bit token in the URL. It refuses any other `Host` (stops DNS rebinding), accepts only JSON POSTs from its own origin (stops other sites submitting to it), and is sent with a strict CSP and `X-Frame-Options: DENY`.
- **Writes are careful.** Paths must be absolute and inside your home folder. Files are written atomically (temp file, then rename). An existing file keeps its permissions and new ones are `0600`. Symlinks are followed rather than replaced.
- **You see everything before it happens**, including the exact command and folder, and warnings when git would pick the file up.
- **Optional clipboard clearing.** By default the page clears your clipboard after you paste, so the secret can't land in a chat by accident.
- **An audit log without values.** `~/.secret-drop/log.jsonl` (mode `0600`) records what went where and when, never the value. Turn it off with `SECRET_DROP_LOG=off`.

What it can't do:

- **Stop an agent reading the file afterwards.** Once a secret is in `.env`, an agent with file access could open it. The server's instructions tell agents not to read, print or commit it and to use `check_secret` instead. For a hard guarantee, deny those reads in the agent's permissions, e.g. in Claude Code's `~/.claude/settings.json`:
  ```json
  { "permissions": { "deny": ["Read(**/.env)", "Read(**/.env.*)"] } }
  ```
- **Catch every way a command could leak.** Redaction covers the common encodings, but a command could transform the secret first, for example by reversing it. Only press **Put it there** on commands you recognise.
- **Outlive the agent session.** Each agent session starts its own server and page. If the session ends, its waiting requests go with it, and the page says so.
- **Work with web chat apps.** ChatGPT and claude.ai in the browser can't run local MCP servers. Use an agent that runs on your computer.

## Configuration

| Environment variable | Default | What it does |
| --- | --- | --- |
| `SECRET_DROP_OPEN` | `1` | Set to `0` to not open a browser. The agent is then handed the page link to give you, e.g. on a remote or headless machine where you forward the port. |
| `SECRET_DROP_PORT` | random | A fixed port for the page. |
| `SECRET_DROP_LOG` | `~/.secret-drop/log.jsonl` | Where the audit log goes, or `off`. |

## Build it yourself

[`PROMPT.md`](PROMPT.md) has the prompt this was built from, cleaned up. Paste it into Claude Code, Codex or another coding agent to build your own version, or to adapt it, e.g. as a native window instead of a browser page.

## Development

```sh
npm test   # node:test: the core, the page's security checks, and an end-to-end MCP run
```

- `bin/secret-drop.js`: entry point (stdio)
- `src/server.js`: MCP over JSON-RPC: tools, instructions, opening the page
- `src/core.js`: requests, validation, the `.env` / file / command writers, redaction, git checks
- `src/page.js`: the local page server (token, Host / Origin / content-type checks)
- `public/`: the page (plain HTML, CSS and JS)

## License

MIT

TDQS

A3.8/5.0

Scored across 5 tools

Disambiguation4/5

Each tool has a fairly distinct role: create a request, wait for it, check secret state, list requests, cancel a request. The only mild overlap is between wait_for_secret (blocking status of a specific request) and check_secret (whether a secret is in place), but the descriptions clearly separate these concerns.

Naming Consistency4/5

All names follow a verb_noun pattern (request_secret, check_secret, list_secret_requests, cancel_secret_request). Minor deviation: wait_for_secret uses a preposition while others don't, and the object alternates between 'secret' and 'secret_requests', but the pattern remains legible.

Tool Count5/5

Five tools map cleanly to the request lifecycle (request, wait, check, list, cancel) with no redundancy. Well-scoped for the server's purpose.

Completeness4/5

The request lifecycle is well covered: create, wait, cancel, list, and verify. Minor gap: no dedicated get-single-request tool, and no way to inspect a delivered request's destination after delivery beyond list metadata, but agents can work around this.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues