Dangerous MCP
Allows access to environment variables, which could potentially expose sensitive configuration data as demonstrated in the security warning
Provides access to local files on the host machine, which is mentioned as a security risk that could expose sensitive information
References accessing OpenAI API keys stored in environment variables, highlighting the potential security risk of exposing these credentials
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Dangerous MCPshow me all environment variables"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP is Dangerous
Function tool usage makes AI Agents very powerful, which is akin to introducing app stores to smartphones. Especially with the release of MCP (Model Context Protocol), tool sharing has become easier than ever. That's why I've created the extendable-agents project to showcase how easy you can extend the capabilities of AI Agents through open-source tools or your custom tools.
While working on extendable-agents, I've realized that tool usage is a double-edged sword. The danger is that the tools you use have powerful access to your machine, such as your environment variables, files, etc.
⚠️ Security Warning
This project is a simple demonstration of the security risks associated with tool usage. The example below illustrates how malicious actors could potentially exploit MCP servers to access sensitive information:
# WARNING: This is a demonstration of security risks.
# DO NOT use this code maliciously!
import os
from mcp.server.fastmcp import FastMCP
server = FastMCP("Dangerous MCP")
@server.tool()
async def get_environment_variables() -> str:
"""Get all environment variables."""
result = [
"Here are what I could find:",
]
for key, value in os.environ.items():
result.append(f"{key:<30} {value[:5]}***")
# This means I can open a backdoor to send your data to me!!
return "\n".join(result)⚠️ Warning: I recommend running this example in a sandboxed environment and deleting your OpenAI API key afterwards. You can also test it with your own MCP client, using the following command:
uvx mcp-is-dangerous.
When using this tool with extendable-agents (choose PoliceAgent), the output appears like this:
It might look harmless or even intentionally benign, right? But consider this scenario: you simply ask for the current time, and meanwhile, your sensitive data is being leaked without your knowledge.
Related MCP server: Vulnerable MCP Server
Best Practices for Security
To protect yourself when using MCP or similar tools:
Always review the source code of tools before using them
Run tools in isolated environments when possible
Be cautious of tools requesting access to sensitive information
Use environment variable filtering when deploying tools
Regularly audit the tools you're using
Disclaimer
This project is meant for educational purposes only to demonstrate potential security risks. Do not use this knowledge for malicious purposes. The author is not responsible for any misuse of this information.
License
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityFmaintenanceAn educational project that deliberately implements vulnerable MCP servers to demonstrate various security risks like prompt injection, tool poisoning, and code execution for training security researchers and AI safety professionals.Last updated1,324
- Flicense-qualityCmaintenanceA deliberately insecure MCP server designed as a pentest lab to demonstrate common vulnerabilities in MCP deployments.Last updated
- Flicense-qualityCmaintenanceAn intentionally vulnerable MCP server designed as a live demo target for the MCP Trust security scanner. It contains deliberate insecure patterns to demonstrate scanning capabilities.Last updated
- AlicenseCqualityCmaintenanceAn educational MCP server exposing shell command execution (PowerShell and sh) and a benign tool for learning about MCP tools, resources, and security risks like tool poisoning.Last updated32MIT
Related MCP Connectors
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
MCP server teaching AI agents to implement TideCloak: auth, E2EE, IGA, security analysis
An MCP server for deep research or task groups
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ShaojieJiang/mcp-is-dangerous'
If you have feedback or need assistance with the MCP directory API, please join our Discord server