erlik-graph

erlik-graph

Enables LLMs to perform OSINT link-analysis by exposing transforms (DNS, WHOIS, Shodan, etc.) as MCP tools for autonomous investigation and graph enrichment.

Category
Visit Server

README

Erlik Graph

Version License Python Type CI

A Maltego-style OSINT link-analysis graph with one shared transform core and two front-ends: a visual FastAPI + Cytoscape app and an MCP server for LLM-driven investigation.

πŸ‡©πŸ‡ͺ Deutsche Version

Part of the Erlik portfolio of open-source AI OSINT tools.

Overview

Erlik Graph rebuilds Maltego's core idea β€” Entities (nodes) connected by Transforms (functions that take one entity and return related ones) on an interactive Graph β€” as a small, hackable Python project.

The point is the architecture: transform logic is written once as plain Python functions and exposed through two adapters that share the same graph store:

  • FastAPI + Cytoscape β€” a visual, clickable investigation graph. You drive it, every step is deterministic and auditable.
  • MCP β€” the same transforms as tools an LLM agent (e.g. Claude) calls autonomously to enrich and follow leads.

Add a transform once, and it appears in both.

Features

  • πŸ”— Entity/Transform/Graph model with automatic node de-duplication
  • 🧩 13 transforms out of the box β€” DNS (A/MX/NS/TXT), reverse DNS, certificate-transparency subdomains (crt.sh), RDAP/WHOIS, Wayback Machine, IP geolocation, HIBP breaches, Gravatar, Shodan services, username enumeration across 10 platforms
  • πŸ–₯️ Visual graph front-end (Cytoscape.js), click a node β†’ run applicable transforms β†’ the graph grows
  • πŸ€– MCP adapter exposing every transform as a tool for LLM-driven OSINT
  • ♻️ Shared core β€” one @transform decorator, both adapters pick it up automatically
  • πŸ”Œ Pluggable storage β€” in-memory networkx by default, or a shared Neo4j backend so the MCP and FastAPI adapters read/write the same graph (Claude enriches, you inspect it live in the browser)

Prerequisites

  • Python 3.11+
  • Optional: a SHODAN_API_KEY for the Shodan transform and a HIBP_API_KEY for the breach transform
  • Optional: a running Neo4j instance to share one graph across both adapters

Installation

git clone https://github.com/malkreide/erlik-graph.git
cd erlik-graph
python -m venv .venv
# Windows: .\.venv\Scripts\Activate.ps1   |   Unix: source .venv/bin/activate
pip install -r requirements.txt

Usage

Variant A β€” visual graph (FastAPI)

python -m uvicorn erlik_graph.adapters.api_server:app --reload

Open http://127.0.0.1:8000 β†’ add a seed entity β†’ click a node β†’ run a transform β†’ the graph expands.

Variant B β€” MCP (LLM-driven)

Register the server (see .mcp.json) with your MCP client. The transforms appear as tools (domain_to_subdomains, username_to_profiles, get_graph, …) and the agent decides which leads to follow.

{
  "mcpServers": {
    "erlik-graph": {
      "command": "python",
      "args": ["-m", "erlik_graph.adapters.mcp_server"],
      "cwd": "/path/to/erlik-graph"
    }
  }
}

Configuration

Variable Purpose Required
SHODAN_API_KEY Enables the ipv4_to_services transform No (transform returns a hint if unset)
HIBP_API_KEY Enables the email_to_breaches transform (Have I Been Pwned) No (transform returns a hint if unset)
ERLIK_GRAPH_BACKEND Graph backend: memory (default) or neo4j No
NEO4J_URI Bolt URI when the backend is neo4j Only for neo4j (default bolt://localhost:7687)
NEO4J_USER / NEO4J_PASSWORD Neo4j credentials Only for neo4j

Shared graph via Neo4j

By default each process keeps its own in-memory graph, so the MCP and FastAPI adapters don't see each other's data. Point both at Neo4j to share one graph β€” the intended "Claude enriches, you inspect visually" loop:

export ERLIK_GRAPH_BACKEND=neo4j
export NEO4J_URI=bolt://localhost:7687
export NEO4J_USER=neo4j
export NEO4J_PASSWORD=your-password

# Adapter 1 β€” the LLM enriches through MCP
python -m erlik_graph.adapters.mcp_server
# Adapter 2 β€” you watch the same graph grow in the browser
python -m uvicorn erlik_graph.adapters.api_server:app --reload

Swap in a different store by subclassing BaseGraphStore and returning it from create_store().

Adding a transform

  1. Write a function decorated with @transform(name, input_type, description) in a file under erlik_graph/transforms/.
  2. Import that file in erlik_graph/transforms/__init__.py.

It now appears in both adapters automatically.

@transform("domain_to_ipv4", "domain", "Resolves a domain to its IPv4 addresses.")
def domain_to_ipv4(value: str, properties: dict) -> list[Entity]:
    return [Entity(type="ipv4", value=ip, link_label="resolves_to")
            for ip in query(value, "A")]

Project Structure

erlik_graph/
β”œβ”€β”€ core/                 Data model, registry, graph stores
β”‚   β”œβ”€β”€ entity.py         Entity / Edge, de-dup key
β”‚   β”œβ”€β”€ registry.py       @transform decorator + registry
β”‚   β”œβ”€β”€ base_store.py     BaseGraphStore β€” shared expand() logic
β”‚   β”œβ”€β”€ graph_store.py    in-memory networkx store
β”‚   β”œβ”€β”€ neo4j_store.py    shared Neo4j-backed store
β”‚   └── factory.py        create_store() β€” picks backend from env
β”œβ”€β”€ transforms/           the actual logic β€” this is where the system grows
β”‚   β”œβ”€β”€ dns_transforms.py
β”‚   β”œβ”€β”€ rdns_transforms.py
β”‚   β”œβ”€β”€ crtsh_transforms.py
β”‚   β”œβ”€β”€ whois_transforms.py
β”‚   β”œβ”€β”€ wayback_transforms.py
β”‚   β”œβ”€β”€ geo_transforms.py
β”‚   β”œβ”€β”€ breach_transforms.py
β”‚   β”œβ”€β”€ gravatar_transforms.py
β”‚   β”œβ”€β”€ shodan_transforms.py
β”‚   └── username_transforms.py
β”œβ”€β”€ adapters/
β”‚   β”œβ”€β”€ api_server.py     FastAPI endpoints
β”‚   └── mcp_server.py     MCP tools
└── web/index.html        Cytoscape front-end

tests/                    offline pytest suite (run in CI)
.github/workflows/ci.yml  install + import check + pytest on 3.11 / 3.12

The Erlik Portfolio

Erlik β€” named after the lord of the underworld in Turkic-Mongolic (Tengrist) mythology β€” is a growing family of small, focused, open-source AI OSINT tools. Each tool lives in its own repository and shares the erlik topic for discoverability. erlik-graph is the link-analysis flagship; further tools (scouts, enrichers, monitors) join the portfolio as separate repos.

Legal Notice

For use only against systems and data you are authorized to investigate. When aggregating personal data, comply with the GDPR and applicable law.

Changelog

See CHANGELOG.md.

License

MIT License β€” see LICENSE.

Author

Hayal Γ–zkan Β· @malkreide

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured