Scans, attacks, and fixes AI agents and MCP servers by identifying shadow AI, credential leaks, and prompt injection vulnerabilities.
Also known as opena2a-org/hackmyagent
- Stars
- 92
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Oct 30, 2026
- License
- Apache-2.0
What is hackmyagent MCP?
hackmyagent is an MCP server. Scans, attacks, and fixes AI agents and MCP servers by identifying shadow AI, credential leaks, and prompt injection vulnerabilities.
Summary generated from the project's README
About hackmyagent MCP server
Securing AI agents and MCP servers from vulnerabilities is what hackmyagent enables for developers and security teams. This tool identifies shadow AI on a machine, scans agent projects for credential leaks, and detects risky configurations like overprivileged filesystem access. It can also perform red-teaming by testing agents with 164 adversarial payloads to check for successful prompt injections.
Users can run the tool locally via npm or Homebrew, or integrate it into CI/CD pipelines to gate pull requests. It can be used as a standalone CLI or initialized as an MCP server for use within Claude Code, Cursor, or VS Code. The server allows an AI assistant to perform deep security scans on a project while maintaining strict boundaries, as the tools only read within specified roots and do not write to files without explicit commands.
Beyond simple scanning, the tool provides automated remediation through the secure --fix command, which applies fixes and maintains backups for easy rollback. It also evaluates governance via SOUL.md files and scans text like pull request bodies for instruction-override payloads.
What you can do with it
- 1Red-team agent endpointsTest a running agent endpoint with aggressive attack payloads to verify its resistance to prompt injection.
Written from the project's README. Every use case is checked against a quote from it.
How to install hackmyagent MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall hackmyagent MCP in Claude Code
$ claude mcp add hackmyagent -- npx -y hackmyagentInstall hackmyagent MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"hackmyagent": {
"command": "npx",
"args": [
"-y",
"hackmyagent"
]
}
}
}Install hackmyagent MCP in VS Code
.vscode/mcp.json
{
"servers": {
"hackmyagent": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"hackmyagent"
]
}
}
}Install hackmyagent MCP in VS Code CLI
$ code --add-mcp '{"name":"hackmyagent","type":"stdio","command":"npx","args":["-y","hackmyagent"]}'Install hackmyagent MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"hackmyagent": {
"command": "npx",
"args": [
"-y",
"hackmyagent"
]
}
}
}Install hackmyagent MCP in Codex
$ codex mcp add hackmyagent -- npx -y hackmyagentInstall hackmyagent MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.hackmyagent] command = "npx" args = ["-y", "hackmyagent"]
Install hackmyagent MCP in Gemini CLI
$ gemini mcp add -s user hackmyagent npx -- -y hackmyagentInstall hackmyagent MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"hackmyagent": {
"command": "npx",
"args": [
"-y",
"hackmyagent"
]
}
}
}Needs a key before it starts
Started on 16 Nov 2026 with no keys, it stopped and asked for one, so a client sees no tools until you set the variables above.
Configuration
OPENA2A_TELEMETRYOPENA2A_TELEMETRY_DEBUG
| Name | Description | |
|---|---|---|
| OPENA2A_TELEMETRY | — | |
| OPENA2A_TELEMETRY_DEBUG | — |
Automated checks
Ran Nov 12, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablePass
- Open source license (OSI)Pass
- Commit or release in the last yearPass
- Package name not close to a popular packagePass
- Remote endpoint uses HTTPSNot checked
- Destructive tools are labelledNot checked
- No hidden instructions to the modelPass
- No critical advisory in the package or its dependenciesNot checked
README
View on GitHubHackMyAgent
OpenA2A: CLI · HackMyAgent · Secretless · AIM · Browser Guard · DVAA
Security scanner for AI agents. It finds the shadow AI on a machine, scans agent projects and packages for credentials, risky MCP configs, prompt injection and weak governance, and tests agents with attack payloads.
Quick start
Scan the project you are in:
npx hackmyagent secure
support-agent v1.0.0 · library · 5 files analyzed
[...]
── Observations ────────────────────────────────────────────
Surfaces library · 5 semantic artifacts · all 5 artifacts reached 0-6 of 7 analyzer families
Checks 261 static declared · 63 of 63 check groups ran · 5 semantic (NanoMind AST, 0-6 of 7 analyzer families) · 5 files read by static checks
[...]
── Findings ────────────────────────────────────────────────
[...]
│ CRITICAL Overprivileged MCP server scope
│ .mcp.json:5
│ Overprivileged filesystem access allows the agent (or an attacker via prompt injection) to read sensitive files like SSH keys, credentials, and system configs.
│ Verify: sed -n '5p' /home/dev/workspace/support-agent/.mcp.json
│ Fix: Scope "filesystem" to the project directory: replace "/" with "./" or a specific subdirectory.
[...]
Path forward: 53 -> 92 by fixing 1 critical + 3 high
No config file or flag is needed. [...] marks omitted lines. The full output, the sample workspace and the build that produced it are in docs/quick-start-capture.txt. The run exits 1 because a critical or high finding fired.
What do you want to check?
- My own project, before I ship it:
npx hackmyagent secure. Next:npx hackmyagent secure --fix. - A package, repository or skill, before I install it:
npx hackmyagent check <target>. Next, for a local copy:npx hackmyagent secure <dir> --fix. - A running agent endpoint you own:
npx hackmyagent attack <url>. Next, with every payload:npx hackmyagent attack <url> --intensity aggressive. - One text, such as a pull request body:
npx hackmyagent scan-text <file>. Next, in a pipeline:npx hackmyagent scan-text - --as pr-body --json. - Every agent project under this folder:
npx hackmyagent detect. Next, for one project:npx hackmyagent secure <project>. - More. A SOUL.md governance file:
npx hackmyagent scan-soul. Attack payloads to run yourself against a skill, MCP config or SOUL.md:npx hackmyagent red-team <file>. MCP endpoints a host you own exposes:npx hackmyagent scan <host>.
What it finds
- Shadow AI: the AI assistants, MCP servers and agent projects on a machine (
detect). Example:1 project MCP server with sensitive access. - Credentials and risky configuration: 261 static checks, from MCP configs to supply chain and sandbox escape. Example:
CRITICAL Overprivileged MCP server scope. - Undeclared capabilities and scanner evasion: 29 semantic checks over skills, prompts and configs. Example:
CRITICAL Data Exfiltration Surface. - Weak governance: SOUL.md graded against a 9-domain model (
scan-soul). Example:Missing SOUL-IH-003 Role-play refusal. - Text that gives orders: pull-request bodies, issues and comments (
scan-text). Example:TEXT-001 HIGH Instruction-override payload. - Attacks an agent falls for: 164 adversarial payloads (
attack). Example:Prompt Injection: 2/2 successfulagainst a deliberately vulnerable agent.
Usage
Fix what a scan finds
hackmyagent secure --fix --dry-run # preview the fixes
hackmyagent secure --fix # apply them
hackmyagent rollback # revert them
Backups go to a store outside the project. Which checks it fixes, and where the backups live: docs/SECURITY_CHECKS.md.
- hackmyagent secure: scores a sample agent project, then applies the fixes it can: text version, provenance.
Find the shadow AI on a machine
npx hackmyagent detect
workspace shadow ai audit · laptop · 2 agents · 3 agent projects
[...]
── Shadow AI agents (3) ────────────────────────────────────
project identified by mcp servers governance cred verdict
support-agent Claude Code 2 mcp critical gov 0/100 cred no CRITICAL
[...]
One row per agent project, worst first. Full output: docs/quick-start-capture.txt.
Gate a pull request in CI
name: Agent Security
on: [push, pull_request]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npx hackmyagent secure --json > security-report.json
- run: npx hackmyagent secure -b oasb-1 --fail-below 70
secure exits 1 on a critical or high finding or a score below --fail-below, and 2 when it did not examine everything it found. Exit codes: docs/commands.md. More recipes: docs/ci.md.
Use it from an AI assistant
hackmyagent init-mcp --root /absolute/path/to/your/project
That adds the server to Claude Code, Cursor or VS Code. Then ask the assistant: "Run a deep security scan on this project." The server reads only inside its roots, and no MCP tool writes to your files.
Install
npm install -g hackmyagent
brew install opena2a-org/tap/hackmyagent
Installing runs the install script of onnxruntime-node, which on Linux x64 downloads an execution-provider package from nuget.org. Node.js versions, skipping that download, and verifying a release: docs/install.md.
Telemetry
Usage telemetry is on by default, and hackmyagent --version says so on its second line: Telemetry: on (opt-out: OPENA2A_TELEMETRY=off ...).
- Sent: one event per command, to the OpenA2A Registry.
- Fields, and only these: tool, version, install ID, event type, command name, success, duration, platform, Node major version.
- Failed command: an error code is added to the command name.
- Install ID: derived from a SHA-256 hash of the machine identifier, or of the hostname where none can be read.
- Not sent: the raw identifier, file paths, scanned content, arguments beyond the command name, environment variables.
- Off under CI:
CI,GITHUB_ACTIONSand the other CI services' variables;--versionthen printsTelemetry: off. - Off under test runners: Vitest, Jest,
node --test,NODE_ENV=test;--versionthen printsTelemetry: off. - On under CI or a test runner: only when
OPENA2A_TELEMETRY=onis set for the run. - Policy: opena2a.org/telemetry.
OPENA2A_TELEMETRY=off hackmyagent secure # off for one run
hackmyagent telemetry off # off on this machine; `telemetry status` shows the state
OPENA2A_TELEMETRY_DEBUG=print hackmyagent secure # print each event on stderr before it is sent
Sharing scan findings with the Registry is a separate opt-in (--contribute, or contribute.enabled in ~/.opena2a/config.json; --no-contribute or --ci turns it off for a run). hackmyagent telemetry off covers usage telemetry only.
Documentation
- Commands: the main commands and their flags, the MCP server, use through opena2a-cli, and exit codes.
- CI/CD: non-interactive runs, pull-request gates, credentials in git history, and scanning a pipeline's text.
- How it works: discovery, static checks, the semantic layer, scoring, the simulation and the self-integrity check.
- Install: Node.js versions, Homebrew, building from source, the install-time download, verifying provenance.
- Security checks: check categories with representative checks, what each count includes, and what
--fixchanges. - Use cases: scanning an agent, red-teaming an MCP server, securing OpenClaw and wiring a CI pipeline.
- Programmatic API: TypeScript entry points for the scanner, runtime protection and the NanoMind semantic compiler; plugin authoring.
- Contributing: outside pull requests are welcome. Report security issues through SECURITY.md, not a public issue.
Part of the OpenA2A security platform. Related: opena2a-cli, the unified CLI that runs HackMyAgent behind opena2a review; aicomply, which classifies PII, credentials and regulated data in agent I/O at runtime: HackMyAgent scans the code, aicomply guards the live stream. More in the OpenA2A docs and research.
License
Apache-2.0. See LICENSE.
hackmyagent MCP questions
How do I add hackmyagent MCP to Claude Code?
Run claude mcp add hackmyagent -- npx -y hackmyagent in your terminal. Add --scope user to make it available in every project.
How do I add hackmyagent MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What can hackmyagent find?
It detects shadow AI, credentials, risky configurations, undeclared capabilities, weak governance, and instruction-override payloads in text.
Can it automatically fix security issues?
Yes, you can use the --fix flag to apply fixes to your project, and you can use rollback to revert them.
How do I use it with an AI assistant like Claude Code or Cursor?
You can initialize it as an MCP server using the init-mcp command, which allows you to ask the assistant to run deep security scans.