OpsecForge

io.github.cyberdroid2077Published by GitHub account cyberdroid2077v0.1.1Updated Oct 24, 2026

Local MCP tools that keep secrets out of agent context: redact files, scan commits, verify webhooks.

VerifiedSTDIODesktop onlyDeveloper ToolsSecurity & Monitoring

Overview

AI-generated overview

A local MCP server that lets a coding agent redact secrets from files, scan commits for leaked credentials, verify webhook signatures and inspect JWTs without a

What you can do
Redact a local file's secrets and get a findings summary with line numbers, without the original values reaching the model context. Scan files, directories or staged git changes for secret patterns and get masked previews. Redact text the agent already holds before sharing it outward. Verify GitHub, Stripe or generic HMAC webhook signatures offline against a secret named by environment variable. Decode a JWT and flag time-claim and algorithm risks. Compute SHA-256 or SHA-512 checksums of local files and compare them with an expected value.
When to use it
Worth adding when an AI coding agent works in repositories that may contain .env files, keys or credentials and you want it to inspect them without pulling secrets into the model context. Also useful for pre-commit secret checks, debugging webhook signature mismatches, and quick JWT claim inspection.
Requirements
Node.js 20 or newer, run locally via npx over stdio. No account, API key or network access. For webhook and JWT tools, the secret or token must be exported as an environment variable in the server process and passed by name. Optionally set OPSECFORGE_MCP_ROOTS to restrict file access to listed directories.
Before you install
Redaction is heuristic and can miss custom formats, base64-wrapped values or secrets in prose, and can also redact harmless values; a clean result means nothing matched, not that nothing is there. Tool parameters and results pass through the model, so redact_text and inspect_jwt with a raw token cannot keep that input out of context. The Claude Code guard hook is a best-effort speed bump, not a sandbox, and Codex and Cursor have no hook. JWT decoding is not signature verification. Rotate any key

Installation

In SourceWeft

  1. Open OpsecForge in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

opsecforge-mcp

A local MCP server (stdio) for AI coding agents such as Claude Code, Codex and Cursor. It helps keep secrets out of the model context: the agent passes a file path or an environment variable name, the work happens on your machine, and only redacted or derived results come back.

Read the limitations below before relying on this. Redaction is heuristic, the Claude Code hook is a best-effort guard rather than a sandbox, and Codex and Cursor have no hook at all.

Install

Requires Node.js 20 or newer.

Claude Code: plugin (recommended: MCP server + guard hook + skill)

text
/plugin marketplace add cyberdroid2077/opsecforge-tools/plugin install opsecforge@opsecforge

The plugin adds three things:

  1. the MCP server (npx -y [email protected]), exposed as mcp__plugin_opsecforge_opsecforge__*;
  2. a PreToolUse hook that blocks Read, Grep and Bash calls that would directly read .env, *.pem, *.key, id_rsa*, id_ed25519*, credentials, *.p12 and similar files, and tells the model to use redact_file instead (.env.example, .env.sample, .env.template and *.pub are allowed);
  3. a skill that tells the agent which tool to use when.

The hook's onFailure: "block" setting needs a recent Claude Code (v2.1.295 or later according to the hooks documentation). On older versions a hook that times out may be skipped instead of blocking.

Claude Code: MCP server only

bash
claude mcp add opsecforge -- npx -y opsecforge-mcp

Codex

Add to ~/.codex/config.toml:

toml
[mcp_servers.opsecforge]command = "npx"args = ["-y", "opsecforge-mcp"]

(or codex mcp add opsecforge -- npx -y opsecforge-mcp).

Cursor

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):

json
{  "mcpServers": {    "opsecforge": {      "type": "stdio",      "command": "npx",      "args": ["-y", "opsecforge-mcp"]    }  }}

Environment variables the tools read

verify_webhook and inspect_jwt read secrets from environment variables by name. The variable must exist in the environment of the MCP server process. Export it in the shell that starts the agent, or add an env entry to the server's configuration in your client. Do not paste the secret into chat and do not commit it.

Optional hardening: set OPSECFORGE_MCP_ROOTS to a path-delimiter-separated list of directories (for example /home/me/projects) and the file tools refuse paths outside them.

Tools

Every tool is read-only, runs locally, and returns readable errors instead of crashing the server.

redact_file({ path })

Reads a local text file and returns it with secrets replaced by [REDACTED], plus a findings summary: type, count and line numbers (of the original file). Original values are never returned, and no part of a value is shown. The response starts with a notice that the original values did not leave the machine or reach the model.

Only regular files (no directories, pipes, devices), at most 1 MiB; larger files fail with an explicit message. Binary files are refused. Detects, among others: private key blocks (including unterminated ones, which are masked from BEGIN to the end of the text), sensitive named fields (password, token, secret, *_KEY, ...), Authorization / cookie / API-key headers, URL credentials, AWS, Stripe, GitHub, GitLab, Slack, Google, OpenAI, Anthropic and SendGrid key formats, and JWT-shaped strings.

scan_secrets({ paths?, staged? })

Pre-commit check. Scans files or directories (paths) and/or only the lines added in git diff --cached (staged: true). Lists file:line, the secret type and a masked preview: the first 4 characters for values of 20 or more characters, otherwise just …. Never returns an original value. Directory scans skip .git, node_modules, build output and symlinks, read at most 2000 files of at most 1 MiB, and skip binaries.

redact_text({ text })

Redacts text the agent already has, for example before pasting logs into an issue or ticket. That text is already in the model context; this tool cannot take it back out. It only produces a safer copy to share outward. To keep a secret out of the context in the first place, use redact_file with a path.

verify_webhook({ provider, body_path, secret_env, signature, algorithm?, tolerance_seconds? })

Verifies a github (X-Hub-Signature-256), stripe (Stripe-Signature) or generic HMAC (hex or base64, sha1/sha256/sha512) signature offline.

  • The secret comes only from the environment variable named by secret_env. There is no plaintext secret parameter; any unknown parameter (for example secret) is rejected with an explanation, and the value is not echoed.
  • The body is read from body_path as raw bytes (up to 10 MiB). Save it exactly as received.
  • Returns match / no match plus diagnostics: signature header well-formed or not; Stripe timestamp age and whether it is outside the tolerance (default 300 s); whether the body looks reformatted (it tests whether the signature would match with the trailing newline removed or added, CRLF/LF changed, a BOM removed, or the JSON minified or pretty-printed); whitespace or quote characters around the secret; a Stripe API key used where a whsec_ signing secret is needed.
  • It never returns the secret or a computed signature.

inspect_jwt({ token_env?, token? })

Decodes a JWT and returns the header, the claims, time-claim status (exp, nbf, iat, auth_time) and risk notes: alg: none, HMAC algorithms that cannot be verified offline, a missing exp, jku/jwk/x5u headers. Decoding is not verification: the tool has no key and never checks the signature. Prefer token_env (the variable name) so the raw token does not pass through the model; a token parameter is already in the context. Claim values under secret-looking field names are masked, but the claims you get back are in the context either way.

file_checksum({ path, algorithm, expected? })

SHA-256 or SHA-512 of a local file (up to 32 MiB), optionally compared with an expected value (<hex>, sha256:<hex> and sha256sum output are accepted). A match proves only that the file equals whatever the expected value came from.

Honest limitations

  • The hook is a best-effort guard, not a sandbox. It parses the text of tool calls. It does not stop a script from reading a secret file indirectly (python app.py that opens .env, make, docker compose config), grep -r over a directory that contains a .env, commands that use shell variables or command output as file names (cat "$FILE", find . -name .env | xargs cat), or anything a language runtime does inside a program. Treat it as a speed bump that catches the common, accidental case.

  • For stronger protection, combine it with Claude Code's own controls: run in its sandbox, and add Read deny rules for your secret paths in settings.json (check the permissions documentation for the exact pattern syntax), for example:

    json
    { "permissions": { "deny": ["Read(./.env)", "Read(./.env.local)", "Read(**/*.pem)", "Read(~/.ssh/**)"] } }

    Deny rules also have gaps and can produce prompts or false positives; test them.

  • Redaction is heuristic and can miss secrets. It recognises common formats and secret-looking field names. It does not know your custom token formats, secrets inside prose, base64-wrapped values, or secrets split across lines in unusual ways. Review the output before sharing it, and treat a clean result as "nothing matched", not "nothing there". It can also redact harmless values (false positives).

  • Parameters and results of every MCP tool pass through the model. That is why the tools take paths and variable names. redact_text and inspect_jwt with token cannot keep what you hand them out of the context.

  • Codex and Cursor have no equivalent of the Claude Code PreToolUse hook. There the tools are advisory: they only help if the agent chooses to call them instead of reading a file directly. Use each client's own permission and sandbox settings alongside them.

  • Redacted output still contains everything that was not matched (hostnames, usernames, internal URLs, personal data).

  • scan_secrets is not a replacement for a dedicated scanner with a maintained rule set in CI.

  • If a secret has already reached a model context, a log or a commit, rotate it.

Learn more

Browser-local versions of these checks and the background behind them, all at opsecforge.com:

License

MIT

Source: packages/opsecforge-mcp/README.md at commit 60bcf3f

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.1.1LatestOct 14, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts