Logo: BloodHound Model Context Protocol Server

BloodHound Model Context Protocol Server

Communautéit
mwnickerson

A Model Context Protocol (MCP) server to converse with data in Bloodhound

Editeurmwnickerson
Repositorybloodhound_mcp
SproochPython
Forks
28
Stären
134
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzGPL-3.0
Linken
  • Tools mat KI-Workflows verbannen

    BloodHound Model Context Protocol Server bitt MCP-Funktiounen un, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • Disponibel Tools: 0

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an deem MCP-Client ze konfiguréieren, deen Dir am léifste benotzt.

  • Interessi vun der Communautéit um Open-Source-Projet

    Zuele vum verlinkte Repository – Stären: 134, Forks: 28.

BloodHound MCP

License: GPL v3

A Model Context Protocol (MCP) server that connects LLMs to BloodHound Community Edition and BloodHound Enterprise. Ask questions in natural language, get attack path analysis, run Cypher queries, and explore Active Directory, Azure/Entra ID, and OpenGraph environments — all from your AI assistant.

Demo

Watch the demonstration video


How It Works

The server exposes BloodHound CE's REST API and Neo4j graph through a set of 13 composite MCP tools, 10 reference resources, and a system prompt tuned for offensive security analysis.

Composite Tools

Each tool uses an info_type parameter to select what data is returned, keeping the tool surface small and token-efficient:

Toolinfo_type Options
domain_infolist, info, users, groups, computers, ous, gpos, dc_syncers, foreign_admins, foreign_group_members, linked_gpos, search
user_infoinfo, sessions, memberships, admin_rights, rdp_rights, dcom_rights, ps_remote_rights, sql_admin_rights, constrained_delegation, controllables, controllers
group_infoinfo, members, memberships, admin_rights, rdp_rights, dcom_rights, ps_remote_rights, controllers, controllables
computer_infoinfo, sessions, local_admins, rdp_rights, dcom_rights, ps_remote_rights, sql_admins, constrained_delegation, controllables, controllers
ou_infoinfo, users, groups, computers, gpos
gpo_infoinfo, controllers
graph_analysisshortest_path, edge_composition, search
adcs_infotemplates, esc_paths
cypher_queryrun, saved_list, saved_get
data_qualitystats, platform_list, platform_info
asset_groupslist, members, custom_selectors
custom_nodeslist, get, create, update, delete, validate_icon, extension_list, extension_upsert, extension_delete, extension_edges
file_uploadupload, start_job, upload_to_job, upload_bytes, upload_bytes_to_job, end_job

Resources

Reference material the LLM loads on demand — no extra API calls:

Resource URIContents
bloodhound://cypher/referenceCypher syntax, schema, property names, patterns
bloodhound://cypher/offensive-queriesBattle-tested templates: DCSync, Kerberoasting, GPO abuse, delegation, ADCS, shadow credentials, NTLM relay, and more
bloodhound://guides/adAD node types and relationships quick reference
bloodhound://guides/ad-methodologyFull AD attack methodology and workflow
bloodhound://guides/azureAzure/Entra ID analysis quick reference
bloodhound://guides/azure-methodologyFull Azure attack chains
bloodhound://guides/adcsADCS ESC1–ESC13 quick reference
bloodhound://guides/adcs-methodologyDetailed ESC analysis and exploitation
bloodhound://opengraph/guideCustom node schema design and best practices
bloodhound://opengraph/examplesSQL Server and Web App OpenGraph examples

System Prompt

The bloodhound_assistant prompt includes behavioral rules that guide the LLM:

  • Load the offensive query library before writing Cypher for any attack scenario
  • Never draw privilege conclusions without checking group memberships and admincount
  • Respect BloodHound's property naming conventions (hasspn, enabled, admincount — all lowercase)
  • Handle uppercase name storage (DOMAIN ADMINS@CORP.LOCAL) correctly in filters
  • Follow proper DCSync and GPO edge traversal patterns

Prerequisites

  • Python 3.11+
  • uv
  • BloodHound Community Edition instance with data loaded
  • BloodHound API credentials (Token ID + Token Key)

Installation

Run the MCP server directly from Git without cloning it first:

bash
export BLOODHOUND_DOMAIN=your-bloodhound-instance.domain.com
export BLOODHOUND_TOKEN_ID=your-token-id
export BLOODHOUND_TOKEN_KEY=your-token-key
uvx --from git+https://github.com/mwnickerson/bloodhound_mcp bloodhound-mcp

For a reproducible integration, append a commit after the repository URL, for example git+https://github.com/mwnickerson/bloodhound_mcp@<commit>. An uvx installation does not read the .env from a separate checkout, so the process that launches the MCP client must provide the credential variables.

For development, clone the repository and install its environment:

bash
git clone https://github.com/mwnickerson/bloodhound_mcp.git
cd bloodhound-mcp
uv sync

Create a .env file in the project root:

env
BLOODHOUND_DOMAIN=your-bloodhound-instance.domain.com
BLOODHOUND_TOKEN_ID=your-token-id
BLOODHOUND_TOKEN_KEY=your-token-key

At startup, the MCP server makes a signed, read-only request to /api/v2/self. Invalid credentials, connectivity failures, and TLS failures stop the server before it accepts MCP tool calls. The startup request times out after 10 seconds.

The server defaults to https on port 443. Override if needed:

env
BLOODHOUND_PORT=8080
BLOODHOUND_SCHEME=http

TLS certificate verification remains enabled when no additional setting is provided. For a trusted lab deployment that uses a self-signed certificate, verification can be explicitly disabled:

env
BLOODHOUND_VERIFY_TLS=false

Disabling verification weakens transport security and logs a warning. Do not use this option on untrusted networks.


Configuration

Claude Desktop

Add to claude_desktop_config.json:

json
{
  "mcpServers": {
    "bloodhound_mcp": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/mwnickerson/bloodhound_mcp",
        "bloodhound-mcp"
      ]
    }
  }
}

Claude Code

Add to ~/.claude/mcp.json:

json
{
  "mcpServers": {
    "bloodhound_mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/mwnickerson/bloodhound_mcp",
        "bloodhound-mcp"
      ]
    }
  }
}

OpenAI Codex CLI

Add to ~/.codex/config.toml (or .codex/config.toml for project-scoped config):

toml
[mcp_servers.bloodhound_mcp]
command = "uvx"
args = ["--from", "git+https://github.com/mwnickerson/bloodhound_mcp", "bloodhound-mcp"]

The server inherits credentials from the process that launches Codex. To keep them in the MCP configuration instead, pass them explicitly:

toml
[mcp_servers.bloodhound_mcp]
command = "uvx"
args = ["--from", "git+https://github.com/mwnickerson/bloodhound_mcp", "bloodhound-mcp"]

[mcp_servers.bloodhound_mcp.env]
BLOODHOUND_DOMAIN = "your-bloodhound-instance.domain.com"
BLOODHOUND_TOKEN_ID = "your-token-id"
BLOODHOUND_TOKEN_KEY = "your-token-key"

MCP Inspector

  • Command: uvx
  • Args: --from git+https://github.com/mwnickerson/bloodhound_mcp bloodhound-mcp

BloodHound API Token

  1. Log into BloodHound CE or BloodHound Enterprise
  2. Navigate to Administration → API Tokens
  3. Create a new token and copy the Token ID and Token Key into your .env

Usage

Example Queries

Reconnaissance:

What domains are in BloodHound?
Show me all Domain Admins in CORP.LOCAL
Find all kerberoastable users
Which computers have unconstrained delegation?

User and Group Analysis:

What admin rights does jsmith@corp.local have?
Show me all sessions for the administrator account
What groups is this user a member of?
Who controls the IT ADMINS group?

Attack Path Analysis:

Find the shortest path from jsmith@corp.local to Domain Admins
Who has DCSync rights in the domain?
Show me all GPO abuse paths
Find ADCS ESC1 paths in the domain

Custom Cypher:

Run a Cypher query to find all users with SPN set and admincount=1
Find all computers where DOMAIN USERS can RDP

Collection Uploads:

Upload this SharpHound ZIP from /tmp/sharphound.zip into BloodHound
Upload these base64-encoded SharpHound ZIP bytes as sharphound.zip
Start an upload job, upload these base64 JSON bytes as users.json, then end the job

Agents that already hold a SharpHound or AzureHound collection in memory should base64-encode the collection bytes and call:

python
file_upload(
    info_type="upload_bytes",
    file_name="sharphound.zip",
    file_bytes_base64="<base64-encoded zip bytes>"
)

For multi-file jobs, call start_job, then upload_bytes_to_job for each base64 payload, then end_job.


OpenGraph Support

BloodHound 8.0+ supports custom node types via OpenGraph, letting you model non-AD infrastructure (cloud resources, databases, custom assets) in the same graph as Active Directory.

The custom_nodes tool handles legacy CRUD operations on node type display configurations through /api/v2/custom-nodes. For BloodHound v9.0.0+ instances with OpenGraph extension management enabled, the same composite tool also supports /api/v2/extensions and /api/v2/extensions-edges via extension_list, extension_upsert, extension_delete, and extension_edges.

Use the bloodhound://opengraph/guide and bloodhound://opengraph/examples resources for schema design and Cypher patterns. For structured OpenGraph schemas, upsert the extension schema first, then ingest collection data with file_upload.

Requires BloodHound Enterprise or BloodHound CE 8.0 or later. OpenGraph extension management requires BloodHound 9.0.0+ and the corresponding feature flag to be enabled.


Security Considerations

BloodHound data processed through this tool is transmitted to your LLM provider's servers. Do not use this with production AD data unless you have assessed that risk.

Recommended use cases:

  • Lab environments (GOAD, DetectionLab, custom ranges)
  • Training and certification prep
  • Research and tool development
  • Non-production domain analysis

Best practices:

  • Rotate BloodHound API tokens regularly
  • Use a read-only API token where possible
  • Consider a local LLM bridge for sensitive environments

Testing

bash
# Full test suite
uv run pytest

# Specific modules
uv run pytest tests/test_main_mcp_tools.py -v
uv run pytest tests/test_bloodhound_api.py -v

# Integration tests (requires a live BloodHound instance)
BLOODHOUND_INTEGRATION_TESTS=1 uv run pytest tests/test_integration.py -v

Roadmap

  • Direct Neo4j access mode (bypass REST API for complex graph traversal)
  • Enhanced Azure/Entra ID tooling
  • Improved ADCS attack path coverage
  • Additional OpenGraph examples and templates

Contributing

Contributions are welcome. Open an issue to discuss significant changes before submitting a PR.

  1. Fork the repo
  2. Create a feature branch
  3. Add tests for new functionality
  4. Run uv run pytest and confirm everything passes
  5. Submit a pull request

Acknowledgments

License

GNU General Public License v3.0 — see LICENSE for details.

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "mwnickerson-bloodhound_mcp": {
      "command": "",
      "args": []
    }
  }
}

BloodHound Model Context Protocol Server MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal BloodHound Model Context Protocol Server verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung, fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector: D'Optioun „Dësen Apparat“ ass ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Setzt de kopéierte Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

BloodHound Model Context Protocol Server als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a setzt d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Setzt d'MCP-Serverkonfiguratioun fir BloodHound Model Context Protocol Server an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert d'Säit, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "mwnickerson-bloodhound_mcp": {
      "command": "npx",
      "args": [
        "-y",
        "bloodhound-mcp"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vun der Integratioun BloodHound Model Context Protocol Server. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vun der Integratioun BloodHound Model Context Protocol Server.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierten MCP-Tools an engem ausgewielte KI-Modell
Kënnt Dir mir mat BloodHound Model Context Protocol Server bei dëser Aufgab hëllefen?
BloodHound Model Context Protocol Server
Jo. Ech hunn et gelies.
Dat hunn ech mat BloodHound Model Context Protocol Server fonnt.

Heefeg gestallte Froen

Fir wat gëtt den MCP-Server BloodHound Model Context Protocol Server benotzt?

BloodHound Model Context Protocol Server ass en MCP-Server, deen et kompatibele KI-Clienten erlaabt, op extern Tools a Kontextinformatioune zouzegräifen. An TypingMind kënnt Dir dësen MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech BloodHound Model Context Protocol Server MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir BloodHound Model Context Protocol Server mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni den MCP-Server fir all Modell separat anzeriichten.

Firwat BloodHound Model Context Protocol Server MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann BloodHound Model Context Protocol Server verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Ären Aarbechtsoflaf beim Chatten an TypingMind organiséieren.

Wéi verbannen ech BloodHound Model Context Protocol Server MCP mat TypingMind?

BloodHound Model Context Protocol Server leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann den MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt BloodHound Model Context Protocol Server MCP an TypingMind zur Verfügung?

BloodHound Model Context Protocol Server stellt MCP-Funktioune zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agente zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir BloodHound Model Context Protocol Server MCP ze benotzen?

Nee. TypingMind ass nom Local-first-Prinzip opgebaut a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann BloodHound Model Context Protocol Server eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir deen MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇