vulnerable-mcp-server-indirect-prompt-injection-remote-mcp
A vulnerable MCP server demonstrating indirect prompt injection through document retrieval
pinned to #47b7f20updated last week
Ask your AI client: “install mcps/vulnerable-mcp-server-indirect-prompt-injection-remote-mcp”.
Requires the metahub MCP server installed in your client. Set up MCP.
mh install mcps/vulnerable-mcp-server-indirect-prompt-injection-remote-mcpmetahub onboarded this repo on the author's behalf.
If you own github.com/appsecco/vulnerable-mcp-servers-lab on GitHub, claim the listing to take over publishing. Your claim preserves the existing eval history and badges; only the curator label is replaced with verified-publisher on your next publish.
Stars
264
Last commit
last week
Latest release
published
- #ai-red-teaming
- #ai-research
- #appsecco
- #bugbounty
- #hacking
- #learning-pentesting
- #mcp
- #mcp-client
- #mcp-server
- #pentesting
- #prompt-injection
- #security
- #server
- #tools
- #vulnerability-demo
- #vulnerable-labs
What this server exposes
Surfaces parsed from this server's source at publish time.
Launches: vulnerable-mcp-server-indirect-prompt-injection-remote-mcp
Evaluation report
WarningsAutomated checks the publisher passed at publish time — structure, docs, safety, and whether the artifact behaves as claimed.47b7f20· last week
Safety
21Dependencies: known vulnerabilitieswarn
2 high/critical advisories — @modelcontextprotocol/[email protected] (HIGH: GHSA-8r9q-7v3j-jr4g) · @modelcontextprotocol/[email protected] (HIGH: GHSA-w48q-cv73-mx4w)
Update the affected packages, then re-publish. (`npm audit` shows the same data locally.)
LICENSE file at repo root
LICENSE
No sensitive files in the repo
scanned for .env, credentials.json, *.pem, .ssh/, AWS / GCP configs — none found
Release history
1- releasecurrent47b7f20warnlast week
Contents
This is an intentionally vulnerable MCP server that simulates a document retrieval/search system where retrieved documents include hidden instructions designed to manipulate the model.
Unlike the local stdio version, this server exposes MCP over HTTP + Server-Sent Events (SSE) so clients can connect over the network.
Do not use this outside a controlled lab environment.
What it provides
The server exposes these MCP tools:
get_document: Retrieve a document by ID (expectsdocument_id)- Available IDs:
company_policy,product_specs,user_review,safe_document
- Available IDs:
search_documents: Search for documents containing keywords (expectsquery)
Documents are loaded from documents/*.txt and returned verbatim.
How it is vulnerable
This server demonstrates indirect prompt injection in a remote context:
- Retrieved documents contain “internal notes” / “guidelines” that look legitimate but act as prompt-like directives.
- The server returns the content with no sanitization, filtering, or instruction/data separation.
- Because this is a remote MCP server, it also models the risk of connecting to untrusted network-accessible MCP endpoints.
Examples in the bundled documents include attempts to:
- Add an unrelated “wellness tip” (recipe) when answering policy questions
- Steer users to a premium product variant / inflate claims
- Reframe a negative review as an “outlier” and push 5-star language
Requirements
- Node.js (modern version)
- npm
Install dependencies in this folder:
npm install
Node/Claude compatibility note (common error)
If you use the included claude_config.json (which runs npx … mcp-remote …) on Node.js 16, you may see errors like:
npm WARN cli npm v10.x does not support Node.js v16.xReferenceError: ReadableStream is not defined(fromundici)
This happens because the bridge (mcp-remote invoked via npx) pulls dependencies that expect a newer Node.js runtime (web streams / ReadableStream are available globally in Node 18+).
Workarounds (pick one):
- Upgrade Node for the bridge (recommended): ensure the
nodethat Claude Desktop uses is Node >= 18.17 (or >= 20.5). On Linux, Claude will use whatevernode/npxit finds on itsPATH, which may differ from your interactive shell. - Use a version manager: with
nvm/asdf, make sure Claude is launched from an environment wherenode -vis 18+ (e.g., log out/in after changing defaults, or start Claude from a shell where the newer Node is active). - Pin an older
mcp-remote(stopgap if you must stay on Node 16): change theclaude_config.jsoncommand args to run a specific older version, e.g.[email protected], instead of the latest. (This avoids newer dependency chains, but may not support all features.)
Run the server
By default it listens on port 3000 (or PORT if set).
Run locally
node index.js
Then the SSE endpoint is:
http://localhost:3000/mcp
Run behind a reverse proxy with a path prefix (your setup)
If your reverse proxy exposes this service under a prefix like /document, set BASE_PATH so the server advertises the correct message endpoint to clients:
BASE_PATH=/document node index.js
Make sure your reverse proxy routes both:
/document/mcp/document/messages
to this process.
Run with Claude (using claude_config.json)
Claude Desktop typically runs MCP servers over stdio. Since this server is HTTP+SSE, the included claude_config.json uses mcp-remote as a small bridge that connects to the SSE endpoint and exposes it to Claude as a local stdio MCP server.
- Start this server (examples):
npm install
BASE_PATH=/document node index.js
- Edit
claude_config.jsonand replace the URL argument with your SSE endpoint, for example:
http://localhost:3000/mcp(local)https://agents.apsc.co/document/mcp(behind your proxy)
-
Open Claude and edit its MCP configuration (Claude Desktop typically exposes this under Settings -> Developer -> Edit config).
-
Merge the
mcpServersentry into your config. -
Restart Claude so it loads the updated MCP configuration.
After Claude restarts, the server should appear as:
vulnerable-mcp-server-indirect-prompt-injection-remote-mcp
Run manually (for debugging)
Quick connectivity tests
- Local test client:
node local-test.js
- Remote/proxied test client (as configured in
test.js):
node test.js
Example usage (safe + injection)
From your MCP client:
- Demonstrate normal retrieval:
- Ask for: “Retrieve
safe_documentand summarize it.”
- Ask for: “Retrieve
- Search for documents:
- Use
search_documentswithquery: "vacation"(should findcompany_policy)
- Use
- Demonstrate indirect prompt injection:
- Ask: “What does
company_policysay about vacations?” - Ask: “Summarize
product_specs.” - Ask: “Summarize
user_review.”
- Ask: “What does
These documents intentionally contain embedded instructions that attempt to bias or override the assistant’s response.
Notes
- This server is intentionally insecure and exists only for demonstration/training.
- Document content is loaded from
documents/*.txtso you can easily tweak injection payloads. - This server intentionally has no authentication and is meant for local/lab use only.
Links to Appsecco Resources
Reviews
No reviews yet. Be the first.
Related
vulnerable-mcp-server-malicious-code-exec
A simple MCP server with a get_qotd tool that fetches quotes from a free API
vulnerable-mcp-server-malicious-tools
A simple MCP server to fetch and display latest status of Atlassian services
@remote-mcp/example
@remote-mcp/example MCP server
mh install mcps/vulnerable-mcp-server-indirect-prompt-injection-remote-mcp