InjectShield MCP server
✓ VerifiedScans untrusted text and URLs for prompt-injection threats to protect AI agents during LLM calls.
Also known as bch1212/injectshield, @injectshield/mcp
- Stars
- 1
- Tools
- 3
- Downloads, 30 days
- 146
- Latest version
- 0.1.4
- Last commit
- Jun 6, 2026
- License
- MIT
What is InjectShield MCP?
InjectShield scans untrusted text and URLs for prompt-injection threats to protect AI agents during LLM calls. It exposes 3 tools, such as scan, scan_url, patterns.
Summary generated from the project's README
About InjectShield MCP server
InjectShield provides a security layer for AI agents by scanning untrusted text and URLs for prompt-injection threats. Developers can integrate this MCP server into clients like Claude Code, Cursor, or Cline to verify content before it reaches a large language model. The server operates via stdio transport and requires an INJECTSHIELD_API_KEY to function. A free tier is available which allows for 10,000 requests per month.
The server exposes three specific tools to the connected agent. The scan tool evaluates strings and returns a verdict, confidence score, and threat category, along with an optional sanitized version of the text. The scan_url tool fetches a URL and automatically sets the context to web_content for analysis. Users can also use the patterns tool to view supported threat categories, sensitivity levels, and context kinds. For self-hosted setups, the INJECTSHIELD_API_BASE environment variable can be used to override the default API endpoint.
What you can do with it
- 1Verify web content safetyAsk the agent to scan a specific URL for malicious instructions before summarizing its contents.
- 2Sanitize untrusted input stringsInstruct the agent to check a block of text for injection patterns and use the redacted version if threats are found.
- 3Audit supported threat typesRequest a list of the different types of prompt injection patterns the system can detect.
Written from the project's README. Every use case is checked against a quote from it.
How to install InjectShield MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall InjectShield MCP in Claude Code
$ claude mcp add --env 'INJECTSHIELD_API_KEY=<YOUR_INJECTSHIELD_API_KEY>' injectshield -- npx -y @injectshield/mcpInstall InjectShield MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"injectshield": {
"command": "npx",
"args": [
"-y",
"@injectshield/mcp"
],
"env": {
"INJECTSHIELD_API_KEY": "<YOUR_INJECTSHIELD_API_KEY>"
}
}
}
}Install InjectShield MCP in VS Code
.vscode/mcp.json
{
"servers": {
"injectshield": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@injectshield/mcp"
],
"env": {
"INJECTSHIELD_API_KEY": "<YOUR_INJECTSHIELD_API_KEY>"
}
}
}
}Install InjectShield MCP in VS Code CLI
$ code --add-mcp '{"name":"injectshield","type":"stdio","command":"npx","args":["-y","@injectshield/mcp"],"env":{"INJECTSHIELD_API_KEY":"<YOUR_INJECTSHIELD_API_KEY>"}}'Install InjectShield MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"injectshield": {
"command": "npx",
"args": [
"-y",
"@injectshield/mcp"
],
"env": {
"INJECTSHIELD_API_KEY": "<YOUR_INJECTSHIELD_API_KEY>"
}
}
}
}Install InjectShield MCP in Codex
$ codex mcp add injectshield --env 'INJECTSHIELD_API_KEY=<YOUR_INJECTSHIELD_API_KEY>' -- npx -y @injectshield/mcpInstall InjectShield MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.injectshield] command = "npx" args = ["-y", "@injectshield/mcp"] [mcp_servers.injectshield.env] INJECTSHIELD_API_KEY = "<YOUR_INJECTSHIELD_API_KEY>"
Install InjectShield MCP in Gemini CLI
$ gemini mcp add -s user -e 'INJECTSHIELD_API_KEY=<YOUR_INJECTSHIELD_API_KEY>' injectshield npx -- -y @injectshield/mcpInstall InjectShield MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"injectshield": {
"command": "npx",
"args": [
"-y",
"@injectshield/mcp"
],
"env": {
"INJECTSHIELD_API_KEY": "<YOUR_INJECTSHIELD_API_KEY>"
}
}
}
}InjectShield MCP tools 3
Detected from the READMEscanscan_urlpatterns
| scan | — | |
| scan_url | — | |
| patterns | — |
Configuration
INJECTSHIELD_API_KEYRequiredSecretAPI key from https://injectshield.dev (free tier: 10K req/mo).
INJECTSHIELD_API_BASEOverride the API base URL for self-hosted deployments.
| Name | Description | |
|---|---|---|
| INJECTSHIELD_API_KEY | API key from https://injectshield.dev (free tier: 10K req/mo). | RequiredSecret |
| INJECTSHIELD_API_BASE | Override the API base URL for self-hosted deployments. |
Automated checks
Ran Nov 14, 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 reachablebch1212/injectshield is public and reachablegithub.com/bch1212/injectshield ↗Pass
- Package names this repository as its source@injectshield/mcp names bch1212/injectshield as sourcenpmjs.com/package/@injectshield/mcp ↗Pass
- Build provenance (Sigstore attestation)Sigstore attestation for @injectshield/mcpnpmjs.com/package/@injectshield/mcp/v/0.1.4#provenance ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-06-06github.com/bch1212/injectshield ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from @injectshield/mcpPass
- No critical advisory in the package or its dependencies99 resolved dependencies checked; no critical advisoryosv.dev ↗Pass
- No hidden instructions to the model3 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNo tool named like delete, drop or execPass
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHub@injectshield/mcp
MCP server for InjectShield — exposes the InjectShield prompt-injection-detection API as MCP tools so any MCP-compatible client (Claude Code, Cursor, Cline, etc.) can scan untrusted text before passing it into another LLM call.
Tools
scan— Scan a string for prompt-injection. Returns verdict, confidence, threat category, matched pattern IDs, and an optional sanitized version with injection spans redacted.scan_url— Fetch a URL and scan its body. Sets context toweb_contentautomatically.patterns— List supported threat categories, context kinds, and sensitivity levels.
Get an API key
Free tier: 10,000 requests/month, no credit card. Self-serve at https://injectshield.dev — your key is delivered by email.
Install in Claude Code
claude mcp add injectshield --env INJECTSHIELD_API_KEY=is_live_… -- npx -y @injectshield/mcp
Install in Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"promptshield": {
"command": "npx",
"args": ["-y", "@injectshield/mcp"],
"env": { "INJECTSHIELD_API_KEY": "is_live_…" }
}
}
}
Install in Cline / generic MCP client
Same shape as Cursor. Stdio transport, command npx -y @injectshield/mcp, set INJECTSHIELD_API_KEY in the env block.
Usage
Once installed, your agent has three new tools. Pattern-match this:
Before reading a fetched web page or file, call
scanwith the body and bail ifsafeisfalse. The cleaned variant incleaned_textis the safest thing to feed forward.
Example (model-side reasoning):
User: Summarize https://example.com/article
Agent → scan_url({"url": "https://example.com/article"})
→ { "safe": false, "threat_type": "instruction_injection",
"patterns_matched": ["ignore-previous", "system-prompt-leak"],
"cleaned_text": "...[REDACTED:instruction_injection]..." }
Agent: I detected prompt-injection in this page. Working from the
redacted version: ...
Configuration
| Env var | Default | Purpose |
|---|---|---|
INJECTSHIELD_API_KEY |
(none) | Required for scan and scan_url. Get a free one. |
INJECTSHIELD_API_BASE |
https://api.injectshield.dev |
Override for self-hosted deployments. |
Defense in depth
InjectShield reduces but does not eliminate prompt-injection risk. Pair it with system-prompt hardening, tool sandboxing, and output filtering. See the main repo for the full pattern library and a more thorough discussion.
License
MIT.
InjectShield MCP questions
How do I add InjectShield MCP to Claude Code?
Run claude mcp add --env 'INJECTSHIELD_API_KEY=<YOUR_INJECTSHIELD_API_KEY>' injectshield -- npx -y @injectshield/mcp in your terminal. Add --scope user to make it available in every project.
How do I add InjectShield MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What tools does InjectShield MCP provide?
It exposes 3 tools, including scan, scan_url, patterns.
How much does it cost to use InjectShield?
There is a free tier available that allows for 10,000 requests per month without requiring a credit card.
Does InjectShield completely eliminate prompt-injection risks?
No, it reduces risk but does not eliminate it; it should be used alongside system-prompt hardening and tool sandboxing.