BloodHound MCP Server

BloodHound MCP Server

Enables security professionals to query and analyze Active Directory attack paths from BloodHound Community Edition data using natural language through Claude Desktop's Model Context Protocol interface.

Category
访问服务器

README

BloodHound Model Context Protocol Server

License: GPL v3

A Model Context Protocol (MCP) server that enables Large Language Models to interact with BloodHound Community Edition data through Claude Desktop. This tool allows security professionals to query and analyze Active Directory attack paths using natural language.

Architecture

This MCP server provides a comprehensive interface to BloodHound Community Edition's REST API, not just a wrapper around Cypher queries. The implementation includes:

API Coverage

  • Complete REST API Integration: Utilizes BloodHound CE's full REST API endpoints (/api/v2/domains, /api/v2/users, /api/v2/groups, etc.)
  • Structured Data Access: Leverages purpose-built API endpoints for users, computers, groups, OUs, and GPOs
  • Advanced Functionality: Includes ADCS analysis, graph search, shortest path algorithms, and edge composition analysis
  • Authentication: Implements BloodHound's signature-based authentication system

Why Not Just Cypher Queries?

While Cypher queries are powerful, this MCP goes beyond simple query execution:

  • Structured API Responses: Returns properly formatted, paginated data with counts and metadata
  • Built-in Relationships: Utilizes BloodHound's pre-computed relationship mappings
  • Error Handling: Proper HTTP status code handling and meaningful error messages
  • Performance: Leverages BloodHound's optimized endpoints rather than raw graph traversal
  • Completeness: Access to administrative rights, sessions, group memberships, and other complex relationships through dedicated endpoints

MCP Benefits

As a proper Model Context Protocol implementation:

  • Tool Discoverability: LLM automatically discovers available analysis capabilities
  • Type Safety: Strongly typed parameters and responses
  • Contextual Help: Built-in documentation and examples for the LLM
  • Resource Access: Provides Cypher query examples and patterns as MCP resources

Demo

Watch the demonstration video

Features

Core Capabilities

  • Domain Analysis: Query domain information, users, groups, computers, and organizational structure
  • User Intelligence: Analyze user privileges, group memberships, sessions, and administrative rights
  • Group Analysis: Examine group memberships, controllers, and privilege relationships
  • Computer Assessment: Investigate computer privileges, sessions, and administrative access
  • Organizational Units: Explore OU structure and contained objects
  • Group Policy Objects: Analyze GPO assignments and controllers
  • Certificate Services: Investigate ADCS infrastructure and certificate templates
  • Custom Cypher Queries: Execute advanced Neo4j queries for complex analysis
  • Graph Search: Find shortest paths between security principals

Advanced Features

  • Natural language querying of BloodHound data
  • Attack path visualization and analysis
  • Privilege escalation identification
  • Cross-domain relationship analysis
  • Kerberoasting target identification
  • Administrative relationship mapping

Prerequisites

  • Python 3.11+
  • uv (Python package manager)
  • Claude Desktop
  • BloodHound Community Edition instance (accessible via network)
  • BloodHound data loaded (from SharpHound, BloodHound.py, etc.)
  • BloodHound API credentials (Token ID and Token Key)

Installation

  1. Clone the repository

    git clone <repository-url>
    cd bloodhound-mcp
    
  2. Install dependencies

    uv sync
    
  3. Configure environment variables

    Create a .env file in the project root:

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

    Note: By default, the server connects using https on port 443. If you're using BloodHound Community Edition with a different configuration, add these optional variables:

    BLOODHOUND_PORT=8080
    BLOODHOUND_SCHEME=http
    

Configuration

Claude Desktop Setup

  1. Open Claude Desktop and navigate to SettingsDeveloper Tools
  2. Add the following configuration to your claude_desktop_config.json:
{
  "mcpServers": {
    "bloodhound_mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/your/bloodhound-mcp",
        "run",
        "main.py"
      ]
    }
  }
}
  1. Replace /path/to/your/bloodhound-mcp with the actual path to your installation
  2. Restart Claude Desktop

BloodHound API Token Setup

  1. Log into your BloodHound CE instance
  2. Navigate to AdministrationAPI Tokens
  3. Create a new token with appropriate permissions
  4. Note the Token ID and Token Key for your .env file

Usage

Getting Started

  1. Start a new conversation in Claude Desktop
  2. Look for the hammer icon (🔨) indicating MCP tools are available
  3. Begin by asking about your domains:
What domains are available in BloodHound?

Example Queries

Domain Reconnaissance:

Show me all users in the DOMAIN.LOCAL domain
What computers are in the domain?
Find all Domain Admins

User Analysis:

What administrative rights does john.doe@domain.local have?
Show me all sessions for the user administrator
What groups is this user a member of?

Privilege Escalation:

Find all kerberoastable users
Show me users with DCSync privileges
What computers can I RDP to from this user?

Advanced Analysis:

Run a cypher query to find all paths to Domain Admin
Show me the shortest path from user A to user B
Find all users with SPN set

Security Considerations

Data Sensitivity Warning

This tool processes BloodHound data through Claude Desktop, which means Active Directory information is transmitted to Anthropic's servers. Do not use this tool with production or sensitive BloodHound data.

Recommended Use Cases

  • Training environments (GOAD, DetectionLab, etc.)
  • Demonstration purposes
  • Learning and research
  • Non-production domain analysis

Best Practices

  • Use isolated lab environments
  • Sanitize data before analysis
  • Consider local LLM alternatives for sensitive environments
  • Regular token rotation for BloodHound API access

Testing

Run the test suite to verify functionality:

# Basic functionality tests
uv run pytest tests/test_basics.py -v

# HTTP request testing
uv run pytest tests/test_bloodhound_http.py -v

# MCP tools testing
uv run pytest tests/test_mcp_tools.py -v

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

Contributing

Contributions are welcome! This project is designed for learning and experimentation with MCPs and BloodHound APIs.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Run the test suite
  6. Submit a pull request

Roadmap

  • [ ] Enhanced attack path analysis
  • [ ] Azure Active Directory support
  • [ ] Advanced graph visualizations
  • [ ] Asset management integration
  • [ ] Local LLM compatibility
  • [ ] Additional ADCS attack scenarios

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Acknowledgments

  • Orange Cyberdefense for GOAD (used for testing)
  • SpecterOps for BloodHound Community Edition
  • @jlowin for FastMCP
  • @xpn for MCP inspiration through the Mythic MCP project

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选