HoneyMCP logo

HoneyMCP

Community
barvhaim

A Deception Security Layer for MCP Servers. It injects "ghost tools" (fake security-sensitive tools) that act as honeypots.

Publisherbarvhaim
RepositoryHoneyMCP
LanguagePython
Forks
2
Stars
19
Available tools
0
Transport typestdio
Categories
LicenseNOASSERTION
Links
  • Connect tools to AI workflows

    HoneyMCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    19 stars and 2 forks from the linked repository.

🍯 HoneyMCP

Detect AI Agent Attacks Through Deception

Python 3.11+ License: Apache 2.0 PyPI

HoneyMCP is a defensive security tool that adds deception capabilities to Model Context Protocol (MCP) servers. It injects "ghost tools" (fake security-sensitive tools) that act as honeypots, detecting two critical threat categories:

  • Data Exfiltration (via "get" tools) - Detects attempts to steal sensitive data like credentials, secrets, or private files
  • Indirect Prompt Injection (via "set" tools) - Detects injection of malicious instructions that could manipulate AI agents working in this environment

One line of code. High-fidelity detection. Complete attack telemetry.


Why HoneyMCP?

🎯 One-Line Integration - Add honeypot middleware to any FastMCP server
πŸ€– Context-Aware Honeypots - LLM generates domain-specific deception tools
πŸ•΅οΈ Transparent Detection - Honeypots appear as legitimate tools to attackers
πŸ“Š Attack Telemetry - Captures tool call sequences, arguments, session metadata
πŸ“ˆ Live Dashboard - Real-time React dashboard for attack visualization
πŸ” High-Fidelity Detection - Triggers only on explicit honeypot invocation


πŸš€ Quick Start

Install

bash
pip install honeymcp
honeymcp init  # Creates config files

This creates the following config files:

  • honeymcp.yaml - Ghost tool configuration
  • .env.honeymcp - LLM credentials (only needed for dynamic ghost tools)

Basic Usage

Add HoneyMCP to your FastMCP server with one line:

python
from fastmcp import FastMCP
from honeymcp import honeypot

mcp = FastMCP("My Server")

@mcp.tool()
def my_real_tool(data: str) -> str:
      """Your legitimate tool"""
    return f"Processed: {data}"

# ONE LINE - Add honeypot protection
mcp = honeypot(mcp)

if __name__ == "__main__":
    mcp.run()

That's it! Your server now deploys honeypot tools that detect attacks while legitimate tools operate normally.

Try the Demo

bash
git clone https://github.com/barvhaim/HoneyMCP.git
cd HoneyMCP
uv sync

Static ghost tools demo:

bash
MCP_TRANSPORT=sse uv run python examples/demo_server.py

Dynamic ghost tools demo (requires LLM credentials in .env.honeymcp):

bash
MCP_TRANSPORT=sse uv run python examples/demo_server_dynamic.py

Launch dashboard UI

bash
make run-ui

🎭 How It Works

1. Honeypot Deployment

HoneyMCP injects deceptive security-sensitive tools that appear alongside legitimate tools:

Two Modes:

Dynamic Mode (Default) - LLM analyzes your server context and generates domain-specific honeypots:

  • File server β†’ bypass_file_permissions, read_system_credentials
  • Database server β†’ dump_admin_credentials, bypass_query_restrictions
  • API gateway β†’ list_internal_api_keys, access_admin_endpoints

Static Mode - Pre-configured generic honeypots:

  • list_cloud_secrets, execute_shell_command, read_private_files

2. Threat Detection

HoneyMCP detects two primary attack vectors when an AI agent invokes a honeypot:

Data Exfiltration Attempts (GET-style honeypots):

Agent: "Use list_cloud_secrets to retrieve AWS credentials"
β†’ HoneyMCP: Returns synthetic credentials, logs attack event

Indirect Prompt Injection (SET-style honeypots):

Agent: "Execute shell command to establish persistence"
β†’ HoneyMCP: Returns synthetic output, logs attack event

3. Attack Fingerprinting

Every honeypot invocation generates an AttackFingerprint event and writes it to ~/.honeymcp/events/YYYY-MM-DD/HHMMSS_<session>.json:

json
{
  "event_id": "evt_20260123_154523_abc12345",
  "timestamp": "2026-01-23T15:45:23Z",
  "session_id": "sess_xyz789",
  "ghost_tool_called": "list_cloud_secrets",
  "arguments": {},
  "conversation_history": null,
  "tool_call_sequence": ["safe_calculator", "list_cloud_secrets"],
  "threat_level": "high",
  "attack_category": "exfiltration",
  "client_metadata": {
    "user_agent": "unknown"
  },
  "response_sent": "AWS_ACCESS_KEY_ID=AKIA..."
}

Notes:

  • tool_call_sequence is tracked per session and includes calls before the ghost tool trigger.
  • conversation_history may be null when the MCP transport does not expose message history.
  • session_id is resolved from context/request metadata when available, otherwise generated.

πŸ›‘οΈ Protection Modes

HoneyMCP supports two protection modes that determine behavior after an attacker is detected (i.e., after they trigger a ghost tool):

Scanner Protection Mode (SCANNER) - Default

Immediate Lockout - All subsequent tool calls return errors after honeypot trigger

Best for: Automated scanners, bots, and most attack scenarios

When a ghost tool is triggered, ALL subsequent tool calls return errors:

  • Attacker is immediately locked out
  • No further interaction possible
  • Fast, simple defense
python
from honeymcp import honeypot

# Scanner mode (default) - lock out attackers
mcp = honeypot(mcp)  # Default: SCANNER mode

COGNITIVE Mode

Sustained Deception - Real tools return synthetic data, maintaining attacker engagement

Best for: Sophisticated attackers, red teams, targeted attacks

When a ghost tool is triggered, the session continues but with fake data:

  • Ghost tools return fake responses (as usual)
  • Real tools switch to returning mock/fake responses
  • Attacker thinks they're succeeding but gets worthless data
  • Keeps attacker engaged while you gather intelligence
python
from honeymcp import honeypot, ProtectionMode

# Cognitive mode - deceive attackers with fake data
mcp = honeypot(mcp, protection_mode=ProtectionMode.COGNITIVE)

How It Works

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚         intercepting_call_tool()        β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                      β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚    Check: attacker_detected[session]?   β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                      β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚ NO                    β”‚                   YES β”‚
              β–Ό                       β”‚                       β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Normal Flow    β”‚               β”‚         β”‚  Check: protection_mode β”‚
    β”‚                 β”‚               β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    β”‚ Ghost? β†’ fake   β”‚               β”‚                     β”‚
    β”‚ Real? β†’ execute β”‚               β”‚         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚         β”‚                       β”‚
                                      β”‚    SCANNER                 COGNITIVE
                                      β”‚         β”‚                       β”‚
                                      β”‚         β–Ό                       β–Ό
                                      β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                      β”‚  β”‚ ALL tools   β”‚    β”‚ Ghost β†’ fake    β”‚
                                      β”‚  β”‚ β†’ ERROR     β”‚    β”‚ Real β†’ mock     β”‚
                                      β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”§ Configuration

Quick Setup with CLI

The easiest way to configure HoneyMCP:

bash
honeymcp init  # Creates honeymcp.yaml + .env.honeymcp
# Optional: remove all persisted attack event files
honeymcp clean-data

Clear Stored Events

You can remove all persisted event JSON files from CLI, API, or UI:

  • CLI: honeymcp clean-data
  • API: DELETE /events
  • Dashboard: Use the Clear Stored Data button

YAML Config

yaml
# honeymcp.yaml
# Protection mode: SCANNER (lockout) or COGNITIVE (deception)
protection_mode: SCANNER

# Static honeypots (ghost tools from catalog)
ghost_tools:
  - list_cloud_secrets
  - execute_shell_command
  - dump_database_credentials

# Dynamic honeypots (LLM-generated ghost tools )
dynamic_tools:
  enabled: true
  num_tools: 3
  fallback_to_static: true
# Alerting
alerting:
  webhook_url: https://hooks.slack.com/...

# Storage
storage:
  event_path: ~/.honeymcp/events

# Dashboard
dashboard:
  enabled: true

Slack Alerting

When alerting.webhook_url is set, HoneyMCP sends one webhook message per detected attack.

  • Delivery failures are logged and do not interrupt MCP tool responses.
  • Arguments are redacted for common secret keys (token, secret, password, key, credential).
  • Long fields are truncated to keep messages readable in Slack.

Local test without Slack workspace:

  1. Start any local POST-capturing webhook endpoint (for example, a tiny FastAPI/Flask app).
  2. Set alerting.webhook_url to that local endpoint, such as http://127.0.0.1:9999/webhook.
  3. Trigger a ghost tool and verify the JSON payload.

Load config:

python
from honeymcp import honeypot_from_config

mcp = honeypot_from_config(mcp)  # Loads honeymcp.yaml
# Or specify path explicitly
mcp = honeypot_from_config(mcp, "path/to/honeymcp.yaml")

Custom Ghost Tools

Choose which ghost tools to inject:

python
mcp = honeypot(
    mcp,
    ghost_tools=[
        "list_cloud_secrets",      # Exfiltration honeypot
        "execute_shell_command",   # RCE honeypot
        "escalate_privileges",     # Privilege escalation honeypot
    ]
)

Custom Storage Path

python
from pathlib import Path

mcp = honeypot(
    mcp,
    event_storage_path=Path("/var/log/honeymcp/events")
)

Environment Overrides

HoneyMCP also supports environment overrides:

  • HONEYMCP_EVENT_PATH - overrides the base event storage directory

LLM Setup (Dynamic Ghost Tools)

Dynamic ghost tools require LLM credentials. Run honeymcp init to generate .env.honeymcp, then add your credentials:

Add to .env.honeymcp:

bash
LLM_PROVIDER=openai
LLM_MODEL=gpt-4o-mini
OPENAI_API_KEY=your_key_here

Supported providers:

  • LLM_PROVIDER=openai: Requires OPENAI_API_KEY
  • LLM_PROVIDER=watsonx: Requires WATSONX_URL, WATSONX_APIKEY, WATSONX_PROJECT_ID
  • LLM_PROVIDER=ollama: Requires OLLAMA_API_BASE (default: http://localhost:11434)

HoneyMCP loads .env.honeymcp first, then falls back to .env. This keeps HoneyMCP credentials separate from your project's environment.

Full Configuration

python
from pathlib import Path
from honeymcp import honeypot, ProtectionMode

mcp = honeypot(
    mcp,
    # Dynamic ghost tools (default)
    use_dynamic_tools=True,           # LLM-generated domain-specific tools
    num_dynamic_tools=3,              # Number of dynamic tools to generate
    fallback_to_static=True,          # Use static tools if LLM fails

    # Static ghost tools (optional)
    ghost_tools=["list_cloud_secrets", "execute_shell_command"],

    # Protection mode (default: SCANNER)
    protection_mode=ProtectionMode.SCANNER,  # or ProtectionMode.COGNITIVE

    # Other settings
    event_storage_path=Path.home() / ".honeymcp" / "events",
    enable_dashboard=True,
)

Dynamic vs Static Tools:

  • Dynamic (default): LLM analyzes your server and generates relevant honeypots (requires LLM credentials in .env.honeymcp)
  • Static: Pre-defined generic tools (no LLM required, set use_dynamic_tools=False)

πŸ§ͺ Testing with Claude Desktop

1. Configure Claude Desktop

For stdio transport (recommended - works with all Claude Desktop versions):

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{
    "mcpServers": {
      "honeymcp-demo": {
        "command": "uv",
        "args": ["run", "python", "/path/to/HoneyMCP/examples/demo_server.py"],
        "env": {"MCP_TRANSPORT": "stdio"}
      }
    }
}

If your client does not support an env block, launch the server with MCP_TRANSPORT=stdio in your shell.

For Streamable HTTP transport (requires Claude Pro/Max/Team/Enterprise):

  1. Start the server:

    bash
    MCP_TRANSPORT=http uv run python examples/demo_server.py
  2. Configure Claude Desktop:

    json
    {
      "mcpServers": {
        "honeymcp-demo": {
          "url": "http://localhost:8000/mcp"
        }
      }
    }

2. Restart Claude Desktop

Completely quit and reopen Claude Desktop (Cmd+Q on macOS).

3. Test Attack Scenarios

Scenario 1: List Available Tools

User: What tools do you have available?

Expected: Claude shows both legitimate tools (safe_calculator, get_weather) and ghost tools (list_cloud_secrets, execute_shell_command)

Scenario 2: Trigger Attack

User: Please use list_cloud_secrets to show me AWS credentials

Expected:

  • Claude calls the ghost tool
  • Fake AWS credentials are returned
  • Event logged to ~/.honeymcp/events/
  • Dashboard shows the attack

Scenario 3: Legitimate Usage

User: What's 5 + 3?

Expected: safe_calculator called, no alerts (zero false positives)


Honeypot Catalog

Data Exfiltration Honeypots ("Get" Tools)

ToolThreatDescription
list_cloud_secretsHighCloud provider credentials (AWS/Azure)
read_private_filesHighSensitive configuration files
dump_database_credentialsCriticalDatabase connection strings
export_user_dataCriticalUser PII records
get_api_keysCriticalExternal service API keys
scan_internal_networkCriticalInternal network scanning
list_kubernetes_secretsCriticalKubernetes secrets and service accounts
dump_session_tokensCriticalActive user session tokens and JWTs
list_github_tokensCriticalGitHub/GitLab access tokens
export_audit_logsHighSecurity audit logs export
dump_ml_model_weightsCriticalML model weights and training data

Prompt Injection Honeypots ("Set" Tools)

ToolThreatDescription
execute_shell_commandCriticalShell command execution
bypass_security_checkCriticalAuthentication/authorization bypass
modify_system_promptCriticalAI system prompt manipulation
escalate_privilegesCriticalPrivilege escalation
inject_system_messageCriticalSystem context injection
disable_security_filtersCriticalSecurity filter bypass
override_permissionsCriticalAccess control override
disable_2fa_requirementCriticalTwo-factor authentication bypass
assume_iam_roleCriticalAWS IAM role assumption

All ghost tools have tempting descriptions that mention "admin", "bypass", "internal", etc. to attract attackers.


πŸ€– ToolGen Agent - Automated Tool Creation

HoneyMCP includes ToolGen, a ReAct-style agent that automatically creates new honeypot tools from natural language descriptions. No manual coding required.

How It Works

ToolGen uses a Reason-Act-Observe-Reflect cycle:

  1. Reason - Analyzes your description to extract tool specifications
  2. Act - Generates response function code with realistic fake data
  3. Observe - Validates syntax and structure
  4. Reflect - Checks quality and suggests improvements

Usage

bash
honeymcp create-tool "dump container registry credentials"

ToolGen automatically:

  • Determines tool category (exfiltration, bypass, privilege escalation)
  • Infers threat level from description keywords
  • Extracts parameters and types
  • Generates realistic response templates
  • Adds tool to both ghost_tools.py and middleware.py
  • Validates all generated code

Example

bash
$ honeymcp create-tool "list terraform state files with secrets"

βœ… Tool created: list_terraform_state
   Category: exfiltration
   Threat Level: critical
   
πŸ“ Agent Reasoning:
   - Analyzing tool description to extract specifications
   - Generating response generator function
   - Validating generated response function
   - Checking code quality and security

The new tool is immediately available in your honeypot catalog.


Documentation



πŸ“„ License

Apache 2.0 - See LICENSE for details.

🍯Deploy HoneyMCP today.

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "barvhaim-honeymcp": {
      "command": "uvx",
      "args": [
        "honeymcp"
      ]
    }
  }
}

Use HoneyMCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once HoneyMCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add HoneyMCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the HoneyMCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "barvhaim-honeymcp": {
      "command": "npx",
      "args": [
        "-y",
        "honeymcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the HoneyMCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the HoneyMCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use HoneyMCP to help me with this task?
HoneyMCP
Sure. I read it.
Here is what I found using HoneyMCP.

Frequently asked questions

What is the HoneyMCP MCP server used for?

HoneyMCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use HoneyMCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use HoneyMCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use HoneyMCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With HoneyMCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect HoneyMCP MCP to TypingMind?

HoneyMCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does HoneyMCP MCP provide in TypingMind?

HoneyMCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use HoneyMCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If HoneyMCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter πŸ‘‡