Skip to main content
Glama

maltego-mcp

Model Context Protocol (MCP) server for Maltego v4.13.0 graphs (.mtgx / GraphML), entity schemas, local and remote (TDS v2 / TRX v3) transforms, native OSINT transforms, .machine scripts, and Maltego Desktop CLI / AutomationServer IPC.

Requirements

  • Node.js v24+ (v24.21.0 tested) and npm 12+

  • Optional: Maltego Desktop v4.13.0 (/usr/bin/maltego and ~/.maltego/v4.13.0) for environment inspection, local/cached discovery, .machine inspection, and --automationPort GraphML push

  • Optional: Python 3 (python3) if executing Python local transforms

Related MCP server: maltego-mcp

Installation & Build

git clone https://github.com/Steph-ux/maltego-mcp.git
cd maltego-mcp
npm install
npm run build

Run the full test suite (compiles TypeScript and executes all test/*.test.mjs suites):

npm test

Transport & CLI Options

By default, maltego-mcp starts on stdio JSON-RPC (all server logs go to stderr so stdout stays clean for MCP framing).

# stdio transport (default)
node dist/index.js
node dist/index.js --stdio

# Streamable HTTP transport (/mcp and /health)
node dist/index.js --http
node dist/index.js --http 3000 --host 127.0.0.1 --token my-secret-token
node dist/index.js --http --port 3000 --token my-secret-token

Flags:

  • --stdio - Use stdio MCP transport (default)

  • --http [port] - Use Streamable HTTP MCP transport (/mcp and /health)

  • --host <addr> - HTTP bind address (default 127.0.0.1, or MCP_HTTP_HOST)

  • --port <port> - HTTP listen port (default 3000, or MCP_HTTP_PORT)

  • --token <secret> - Require Authorization: Bearer <secret> on /mcp

  • -h, --help - Show CLI usage

Tool outputs are automatically bounded to <= 4 MiB (4194304 bytes) for safe MCP transport framing.

Environment Variables

Variable

Default

Description

MALTEGO_BIN

/usr/bin/maltego

Path to the Maltego launcher binary

MALTEGO_HOME

~/.maltego/v4.13.0

Path to the Maltego user configuration directory

MALTEGO_WORKSPACE_DIR

Current working directory

Base directory confining relative/workspace .mtgx, .entity, .machine, and transform outputs

MALTEGO_PYTHON_BIN

python3

Python interpreter used by generated Python local transform templates

MALTEGO_TRANSFORM_TIMEOUT_MS

30000

Default timeout (ms) for local and remote transforms

MALTEGO_MAX_GRAPH_BYTES

33554432 (32 MiB)

Maximum uncompressed GraphML / .mtgx graph size

MALTEGO_ALLOW_EXTERNAL_TRANSFORMS

false

Set "true" to allow remote TDS/TRX, external DNS, RDAP/WHOIS, or HTTP/TLS fetches against non-localhost targets

MCP_TRANSPORT

stdio

Default transport (stdio or http)

MCP_HTTP_HOST

127.0.0.1

Default HTTP bind host

MCP_HTTP_PORT

3000

Default HTTP listen port

MCP_HTTP_TOKEN

""

Default Bearer token required for Streamable HTTP /mcp requests

Registered Tools (31)

.mtgx / GraphML Archive Tools (8)

  • mtgx_inspect - Inspect a .mtgx archive: returns metadata, entity/link type counts, and paginated entities and links (cleanly detects .mtgl Pandora/Lucene archives with a structured error).

  • mtgx_create - Atomically create a new Maltego v4.13.0 .mtgx archive from entities, directed links, and metadata.

  • mtgx_add_entities - Add entities to an existing .mtgx archive with auto-generated IDs, grid placement, and optional deduplication.

  • mtgx_add_links - Add directed links between existing entities in a .mtgx archive.

  • mtgx_query_graph - Query entities and induced links by type, value substring, property match, bookmark, or k-hop BFS neighborhood.

  • mtgx_update_entity - Update an entity's value, properties, notes, bookmark, position, or weight in a .mtgx archive.

  • mtgx_remove_entities - Remove entities by ID from a .mtgx archive and cascade-delete incident links.

  • mtgx_export_graphml - Export a .mtgx archive as standalone GraphML XML or JSON (optionally writing atomically to a file).

Entity Schema & Builder Tools (5)

  • entity_list_types - List built-in Maltego v4.13.0 entity types and optionally scan custom/local plain-XML .entity directories (skipping binary/encrypted files safely).

  • entity_get_schema - Return the full property schema, inheritance chain, primary property, and JSON/XML examples for an entity type.

  • entity_build - Validate an entity's type, primary value, and typed fields and emit canonical JSON plus optional Transform <Entity> XML and GraphML <mtg:MaltegoEntity> XML.

  • entity_parse_xml - Parse Transform <Entity> / <MaltegoMessage>, GraphML <mtg:MaltegoEntity> / <node>, or .entity <MaltegoEntity> definition XML into normalized JSON.

  • entity_create_definition - Build a custom .entity XML definition and optionally write it safely within MALTEGO_WORKSPACE_DIR.

Local & Remote (TDS/TRX) Transform Tools (7)

  • transform_run_local - Execute a local Maltego transform binary/script (shell: false) using Maltego's CLI field escaping protocol and parse its XML response or exception message (supports optional output_mtgx merge).

  • transform_list_local - Discover local, cached remote, custom transforms, transform sets, and server entries without reading secrets or activation files.

  • transform_discover_tds - Query TDS v2 XML (_TRANSFORMS, _CONFIG, _PERFORMANCE) or TRX v3 JSON (/transforms, /assets/*) discovery endpoints.

  • transform_run_tds - Execute a remote transform via TDS v2 XML or TRX v3 JSON (external hosts gated by MALTEGO_ALLOW_EXTERNAL_TRANSFORMS=true; supports optional output_mtgx merge).

  • transform_build_request - Build a TDS v2 <MaltegoTransformRequestMessage> XML or TRX v3 JSON request payload offline.

  • transform_parse_response - Parse a TDS v2 XML or TRX v3 JSON transform response into normalized entities, UI messages, buttons, and exceptions.

  • transform_create_local_template - Generate an executable Python 3 or Node.js local transform script plus a matching .transform XML descriptor.

Built-in OSINT Transform Tools (5)

All 5 OSINT tools support optional output_mtgx to write or merge discovered entities and links directly into a .mtgx archive.

  • osint_domain_to_dns - Resolve A, AAAA, MX, NS, TXT, and CNAME records plus SPF/DMARC policies into normalized Maltego entities, links, GraphML, and Transform XML.

  • osint_ip_analyze - Classify IPv4/IPv6 addresses (RFC1918, loopback, link-local, CGNAT, multicast, ULA, public) with optional PTR reverse DNS and RDAP/WHOIS enrichment.

  • osint_website_and_tls - Fetch an HTTP(S) page and inspect its TLS certificate, extracting status, title, tech hints, links, hosts, emails, and TLS SANs/Issuer/Subject.

  • osint_extract_entities - Extract deduplicated EmailAddress, Domain, IPv4Address, URL, Hash, and PhoneNumber entities from raw text or a workspace file.

  • osint_run_pipeline - Run a bounded, cycle-free multi-step OSINT pipeline chaining extract, dns, ip_analyze, and website_tls.

Desktop, CLI, Machines & Automation IPC Tools (6)

  • maltego_environment_info - Inspect Maltego binary, clusters, Java 11 JVM info, non-secret userdir counts, and redacted messages.log tail (strictly excludes MaltegoID.* and Certificates/).

  • maltego_list_servers_and_machines - List .tas servers (credentials redacted), .seed/.hub files, TransformSets, and .machine scripts, or inspect a specific .machine script.

  • maltego_parse_machine - Parse and validate a .machine DSL script, extracting metadata, blocks, and transform invocations.

  • maltego_create_machine - Validate, format, and optionally write a .machine DSL script safely within MALTEGO_WORKSPACE_DIR.

  • maltego_automation_push - Push a validated <graphml> payload over TCP to Maltego Desktop's --automationPort (AutomationServer) to merge into the active UI graph.

  • maltego_cli_launch - Build and optionally execute a validated shell-free invocation of /usr/bin/maltego (defaults to dry_run: true).

Security Notes

  • The built-in XML parser (src/utils/xml.ts) rejects all <!DOCTYPE, <!ENTITY, and DTD declarations to prevent XXE and billion-laughs attacks, and enforces size, depth, and node limits.

  • Archive utilities (src/utils/zip.ts) reject zip-slip path traversal and bound uncompressed entry and archive sizes.

  • Path inputs are validated through assertSafePath, local process execution uses spawn(..., { shell: false }), and non-local network calls in OSINT and TDS/TRX tools are disabled unless MALTEGO_ALLOW_EXTERNAL_TRANSFORMS=true.

  • Sensitive Maltego identity/key files (MaltegoID.activation, MaltegoID.keypair, Certificates/, and .tas credentials) are excluded or redacted.

Available Tools

31 tools
entity_buildB

Validate an entity's type, primary value, and typed fields against Maltego v4.13.0 rules and emit canonical JSON plus optional Transform XML and GraphML mtg:MaltegoEntity XML.

Inputs: type (required), value (required), id, notes, +12 more.

entity_create_definitionB

Build a custom Maltego .entity XML definition and optionally write it safely within the configured workspace directory.

Inputs: id (required), displayName (required), primaryProperty (required), fields, +12 more.

entity_get_schemaA

Return the full property schema, inheritance chain, primary value key, and canonical JSON/XML examples for a Maltego entity type.

Inputs: type (required), customDir, includeInherited.

entity_list_typesB

List built-in Maltego v4.13.0 entity types and optionally scan a custom directory or local Maltego Entities directory for plain-XML .entity files (skipping binary/encoded files with warnings). Supports filtering by category/search and pagination.

Inputs: limit, offset, search, category, +2 more.

entity_parse_xmlA

Parse Transform (or ), GraphML mtg:MaltegoEntity (or ), or .entity definition XML into normalized JSON.

Inputs: xml (required), kind, customDir.

maltego_automation_pushA

Push a validated UTF-8 GraphML (...) payload over TCP to a running Maltego Desktop AutomationServer (--automationPort), closing write side (EOF) to trigger PasteRequestHandler.

Inputs: port (required), graphml (required), host, timeout_ms, +1 more.

maltego_cli_launchB

Build and optionally execute a validated shell-free argv invocation of Maltego CLI (/usr/bin/maltego) supporting --nosplash, --nogui, --open, --import, --machine, --automationPort, --userdir, --cachedir, --serverHttpAllowed, and --help. Defaults to dry_run=true.

Inputs: help, nogui, dry_run, machine, +10 more.

maltego_create_machineA

Validate, format, and optionally write a Maltego .machine DSL script from structured fields or raw DSL source, enforcing balanced braces, valid transform IDs, and assertSafePath.

Inputs: id, paths, write, author, +8 more.

maltego_environment_infoA

Inspect Maltego v4.13.0 installation binary, JVM info, non-secret userdir summary (TransformRepositories, TransformSets, Servers, Machines, Seeds), and optional var/log/messages.log tail. Strictly excludes MaltegoID/Certificates/credentials.

Inputs: log_tail_lines, include_jvm_version.

maltego_list_servers_and_machinesA

List .tas servers (credentials redacted), .seed/.hub files, TransformSets, and .machine scripts from Maltego userdir, or read/inspect a specific .machine script safely.

Inputs: kind, limit, machine_name.

maltego_parse_machineB

Parse and validate a Maltego .machine DSL script (from inline source or a safe .machine file path), extracting machine id, displayName, execution blocks, and transform invocations.

Inputs: source, file_path.

mtgx_add_entitiesB

Add one or more entities to an existing .mtgx archive with auto-generated IDs and automatic grid layout when position is omitted.

Inputs: path (required), entities (required), deduplicate.

mtgx_createA

Create a new Maltego v4.13.0 .mtgx archive atomically from entities and directed links.

Inputs: path (required), links, entities, metadata, +1 more.

mtgx_export_graphmlA

Export a .mtgx archive as a standalone GraphML XML string or JSON, optionally writing atomically to an output .graphml or .json file.

Inputs: path (required), format, pretty, output_path.

mtgx_inspectA

Inspect a Maltego .mtgx archive: returns metadata, entity/link type counts, and paginated entities and links. Cleanly detects and explains .mtgl (Pandora/Lucene) files.

Inputs: path (required), limit, offset, include_properties.

mtgx_query_graphA

Query entities and induced links in a .mtgx archive by entity type, value substring, property match, bookmark, or k-hop BFS neighborhood from an entity_id.

Inputs: path (required), hops, type, limit, +7 more.

mtgx_remove_entitiesA

Remove one or more entities by ID from a .mtgx archive and cascade-delete all incident links.

Inputs: path (required), entity_ids (required).

mtgx_update_entityC

Update an entity's value, properties, notes, bookmark, position, or weight in a .mtgx archive.

Inputs: path (required), entity_id (required), notes, value, +5 more.

osint_domain_to_dnsA

Resolve DNS records (A, AAAA, MX, NS, TXT, CNAME) for a domain via node:dns/promises, parse SPF/DMARC policies, and return normalized Maltego entities, links, GraphML, and MaltegoTransformResponseMessage XML.

Inputs: domain (required), nameserver, output_mtgx, record_types.

osint_extract_entitiesB

Extract deduplicated Maltego entities (EmailAddress, Domain, IPv4Address, URL, Hash, PhoneNumber) from input text or a safe local file path within workspaceDir, linking back to a root Document/Phrase.

Inputs: text, file_path, output_mtgx, source_type, +2 more.

osint_ip_analyzeB

Validate and classify an IPv4/IPv6 address (RFC1918, loopback, link-local, CGNAT, multicast, public), optionally perform reverse DNS PTR and RDAP/WHOIS enrichment, and emit Maltego graph/XML outputs.

Inputs: ip (required), rdap_url, nameserver, output_mtgx, +2 more.

osint_run_pipelineB

Run a bounded, cycle-free multi-step OSINT transform pipeline chaining extraction, DNS, IP analysis, and HTTP/TLS inspection, returning { graph, graphml, transform_xml, trace }.

Inputs: seed_type (required), seed_value (required), steps, rdap_url, +7 more.

osint_website_and_tlsA

Fetch an HTTP(S) page and inspect its TLS certificate via node:tls, extracting status, headers, title, tech hints, links, hosts, emails, and TLS SANs/Issuer/Subject into Maltego entities and GraphML/Transform XML. Non-local targets require allowExternalTransforms=true.

Inputs: url (required), timeout_ms, output_mtgx, max_body_bytes, +2 more.

transform_build_requestA

Build a Maltego TDS v2 XML (<MaltegoTransformRequestMessage>) or TRX v3 JSON (TransformRunRequest) transform request payload without making network calls.

Inputs: entity, limits, protocol, parameters, +3 more.

transform_create_local_templateB

Generate a ready-to-run local Maltego transform script (Python 3 or Node.js) with executable permissions plus a matching .transform XML descriptor file.

Inputs: name (required), language (required), author, overwrite, +5 more.

transform_discover_tdsB

Discover transforms, config/performance (TDS v2 XML) or transforms/machines/sets/entities (TRX v3 JSON) from a TDS/TRX server URL. Always permits localhost/127.0.0.1/::1; external hosts require MALTEGO_ALLOW_EXTERNAL_TRANSFORMS=true.

Inputs: url (required), api_key, command, protocol, +4 more.

transform_list_localB

Discover local and installed Maltego transforms, transform sets, and server definitions from Maltego v4.13.0 config directories (TransformRepositories/, TransformSets/, Servers/) plus an optional custom workspace directory, without reading secret keys or activation files.

Inputs: limit, filter, custom_dir, include_sets, +3 more.

transform_parse_responseB

Parse a Maltego TDS v2 / local XML (<MaltegoTransformResponseMessage> or <MaltegoTransformExceptionMessage>) or TRX v3 JSON response string into structured entities, UI messages, buttons, and exceptions.

Inputs: payload (required), protocol.

transform_run_localA

Execute a local Maltego transform binary/script directly (shell: false) using the Maltego v4.13.0 CLI protocol ([...params, entityValue, escapedAdditionalFields]) and parse its XML response or exception message.

Inputs: command (required), entity_value (required), parse_xml, parameters, +6 more.

transform_run_tdsA

Execute a remote transform via TDS v2 XML (POST ?Command=_RUN&TransformToRun=...) or TRX v3 JSON (POST <base>/transforms/<id>/run). Always permits localhost/127.0.0.1/::1; external hosts require MALTEGO_ALLOW_EXTERNAL_TRANSFORMS=true.

Inputs: url (required), transform_name (required), oem, entity, +8 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 31 tools

    Disambiguation4/5

    Tools are grouped by domain and mostly target distinct operations across .mtgx archives, entity schemas, transforms, machines, and OSINT. A few clusters are close, such as entity_build vs. entity_create_definition and mtgx_inspect vs. mtgx_query_graph, but their descriptions make the boundaries workable.

    Naming Consistency4/5

    Names consistently use snake_case with semantic prefixes for domain grouping (mtgx_, entity_, transform_, osint_, maltego_). Most names follow prefix_action_object patterns, though a few like osint_domain_to_dns and maltego_automation_push are less verb-first.

    Tool Count3/5

    Thirty-one tools is heavy for a single MCP server, but the breadth of the Maltego integration means the tools are split across several coherent subdomains. The count is on the high side and could overwhelm selection, but most tools do appear to earn their place.

    Completeness4/5

    The surface covers graph archive creation/inspection/editing, entity schema/build/parse, local and TDS transform workflows, machine scripting, automation push, and OSINT transforms. Minor gaps remain, such as standalone link removal/update and archive deletion lifecycle operations.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Enables LLMs to author Maltego .mtgx graph files and perform OSINT lookups, with an optional transform layer for pivoting into MISP, TheHive, Cortex, and MITRE ATT\&CK directly in Maltego Desktop.
      13
      41 npm
      13
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables LLMs to perform OSINT link-analysis by exposing transforms (DNS, WHOIS, Shodan, etc.) as MCP tools for autonomous investigation and graph enrichment.
      MIT
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables agents to work with an embedded graph database over MCP by exposing tools for entity storage, declarative rule creation, similarity search, association explanations, role-filtered queries, and historical edge inspection. It supports building and querying self-maintaining graphs locally with explainable derived relationships.
      5
      -