test_bloodhound_connection
Test connectivity to BloodHound API and retrieve version information for Active Directory penetration testing assessments.
Instructions
connect to bloodhoundapi and get version
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/pentestmcp/server.py:338-340 (handler)The tool handler decorated with @mcp.tool, implementing the core logic by calling bloodhound.connectToApi() to test the BloodHound connection and retrieve version.@mcp.tool(name="test_bloodhound_connection",description="connect to bloodhoundapi and get version") def test_bloodhound_connection(): return bloodhound.connectToApi()
- src/pentestmcp/bloodhound.py:116-125 (helper)Supporting helper function connectToApi() that creates BloodHound client credentials from config and fetches the API version via the Client class.def connectToApi(): # This might be best loaded from a file credentials = Credentials( token_id=config.BHE_TOKEN_ID, token_key=config.BHE_TOKEN_KEY, ) client = Client(scheme=BHE_SCHEME, host=config.BHE_DOMAIN, port=config.BHE_PORT, credentials=credentials) return client.get_version().api_version
- src/pentestmcp/bloodhound.py:109-113 (helper)The Client.get_version() method called by connectToApi() to perform the actual API request for version information.def get_version(self) -> APIVersion: response = self._request("GET", "/api/version") payload = response.json() return APIVersion(api_version=payload["data"]["API"]["current_version"], server_version=payload["data"]["server_version"])
- src/pentestmcp/server.py:338-338 (registration)The @mcp.tool decorator registering the 'test_bloodhound_connection' tool.@mcp.tool(name="test_bloodhound_connection",description="connect to bloodhoundapi and get version")