OpenCTI MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
OpenCTI MCP Server
A comprehensive Model Context Protocol (MCP) server for querying and exploring OpenCTI threat intelligence platforms. This server exposes 26+ tools for advanced threat intelligence queries including sector analysis, TTP mapping, temporal queries, and relationship traversal.
Features
π Entity Search
Search for STIX entities by name or keyword:
Malware
Intrusion Sets
Attack Patterns (MITRE ATT&CK)
Campaigns
Vulnerabilities (CVEs)
Threat Actors
Tools
Sectors
Reports
π Relationship Traversal
Navigate relationships between entities:
Malware used by intrusion sets/threat actors
Attack patterns (TTPs) used by threat actors
Vulnerabilities exploited
Tools employed
Entities mentioned in reports
π’ Sector-Based Analysis
Answer questions like:
"What are the top 10 threat actors targeting the Financial Sector?"
"Which intrusion sets target Healthcare?"
π― TTP Analysis
Retrieve Tactics, Techniques, and Procedures:
TTPs used by threat actors
TTPs used by intrusion sets
Mapped to MITRE ATT&CK framework
π Temporal Queries
Get time-sorted intelligence:
Latest threat reports
Recent reports mentioning specific sectors
Recent reports mentioning specific threat actors
π΅οΈ Threat Actor Deep-Dive
Comprehensive threat actor profiling:
Malware used
Campaigns attributed
Vulnerabilities exploited
TTPs employed
Recent mentions in reports
Related MCP server: MITRE ATT&CK MCP Server
Installation
Prerequisites
Python 3.8 or higher
Access to an OpenCTI instance
OpenCTI API token
Quick Start
Clone the repository:
git clone https://github.com/jhuntinfosec/mcp-opencti.git cd mcp-openctiCreate a virtual environment:
python3 -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtConfigure environment variables:
cp .env.example .env # Edit .env with your OpenCTI credentialsRun the server:
uv run opencti_mcp_server_v7.py
Configuration
Environment Variables
Create a .env file in the project root:
OPENCTI_URL=http://localhost:8080
OPENCTI_TOKEN=your-api-token-hereOPENCTI_URL: Base URL of your OpenCTI instance (default:
http://localhost:8080)OPENCTI_TOKEN: Your OpenCTI API token (required)
Obtaining an OpenCTI API Token
Log into your OpenCTI instance
Navigate to Settings β Security β API Access
Create a new API token with appropriate permissions
Copy the token to your
.envfile
Usage
Running the Server
Using uv (recommended)
uv run opencti_mcp_server_v7.pyUsing Python directly
export OPENCTI_URL="http://localhost:8080"
export OPENCTI_TOKEN="your-api-token"
python opencti_mcp_server_v7.pyIntegration with MCP Clients
Claude Desktop
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"opencti": {
"command": "uv",
"args": ["run", "/path/to/opencti_mcp_server_v7.py"],
"env": {
"OPENCTI_URL": "http://localhost:8080",
"OPENCTI_TOKEN": "your-api-token"
}
}
}
}Goose
goose mcp add opencti --command "uv run opencti_mcp_server_v7.py"Available Tools
Search Tools
search_malware(search_term)- Search for malwaresearch_intrusion_sets(search_term)- Search for intrusion setssearch_attack_patterns(search_term)- Search for attack patternssearch_campaigns(search_term)- Search for campaignssearch_vulnerabilities(search_term)- Search for CVEssearch_threat_actors(search_term)- Search for threat actorssearch_tools(search_term)- Search for toolssearch_sectors(search_term)- Search for sectorssearch_reports(search_term)- Search for reports
Relationship Tools
get_malwares_of_intrusion_set(name)- Get malware used by intrusion setget_attack_patterns_of_intrusion_set(name)- Get attack patternsget_vulnerabilities_of_malware(name)- Get vulnerabilities exploitedget_tools_used_by_intrusion_set(name)- Get tools used
Sector Analysis Tools
get_threat_actors_targeting_sector(sector, limit)- Get threat actors by sectorget_intrusion_sets_targeting_sector(sector, limit)- Get intrusion sets by sector
TTP Analysis Tools
get_ttps_of_threat_actor(name)- Get TTPs used by threat actorget_ttps_of_intrusion_set(name)- Get TTPs used by intrusion set
Temporal Query Tools
get_latest_reports(limit)- Get most recent reportsget_latest_reports_by_sector(sector, limit)- Get recent reports by sectorget_latest_reports_mentioning_threat_actor(name, limit)- Get recent reports about threat actor
Threat Actor Deep-Dive Tools
get_malwares_used_by_threat_actor(name)- Get malware usedget_campaigns_by_threat_actor(name)- Get campaigns attributedget_vulnerabilities_exploited_by_threat_actor(name)- Get vulnerabilities exploited
Report Tools
get_report_details(title)- Get detailed report informationget_malwares_of_report(title)- Get malware mentioned in reportget_intrusion_sets_of_report(title)- Get intrusion sets mentioned
Example Queries
Sector-Based Analysis
"What are the top 10 threat actors targeting the Financial Sector?"
β Uses: get_threat_actors_targeting_sector("Financial Sector", limit=10)
"What are the latest threat reports about Healthcare?"
β Uses: get_latest_reports_by_sector("Healthcare", limit=10)TTP Analysis
"What TTPs does APT28 use?"
β Uses: get_ttps_of_threat_actor("APT28")
"What techniques does APT29 employ?"
β Uses: get_ttps_of_intrusion_set("APT29")Threat Actor Profiling
"Create a profile of Lazarus Group"
β Uses multiple tools:
- get_malwares_used_by_threat_actor("Lazarus Group")
- get_ttps_of_threat_actor("Lazarus Group")
- get_campaigns_by_threat_actor("Lazarus Group")
- get_vulnerabilities_exploited_by_threat_actor("Lazarus Group")Temporal Queries
"What are the most recent threat reports mentioning APT28?"
β Uses: get_latest_reports_mentioning_threat_actor("APT28", limit=10)Development
Running Tests
# Install test dependencies
pip install -r requirements-test.txt
# Run all tests
pytest test_opencti_mcp_server_v7.py -v
# Run with coverage
pytest test_opencti_mcp_server_v7.py --cov=opencti_mcp_server_v7 --cov-report=htmlSee TESTING.md for detailed testing documentation.
Code Quality
# Format code
black opencti_mcp_server_v7.py
# Lint
flake8 opencti_mcp_server_v7.py --max-line-length=120
# Type check
mypy opencti_mcp_server_v7.py --ignore-missing-importsArchitecture
Data Model
The server leverages OpenCTI's STIX 2.1 data model:
Entities: Malware, Threat Actors, Intrusion Sets, Attack Patterns, etc.
Relationships:
uses,targets,attributed-to, etc.Sectors: Modeled as Identity entities with
identity_classof "sector"TTPs: Represented as Attack-Pattern entities (MITRE ATT&CK)
Design Patterns
Single Client Instance: Reuses one OpenCTI client for all requests
Lazy Initialization: Client created on module load
Graceful Degradation: Returns empty results instead of errors
Flexible Matching: Exact name matching with fallback to fuzzy search
Consistent Return Types: All tools return lists of dictionaries
Troubleshooting
Connection Issues
Error: OPENCTI_TOKEN environment variable must be set
Solution: Ensure your
.envfile exists and contains the token
Error: Connection timeout
Solution: Check that your
OPENCTI_URLis correct and OpenCTI is running
Empty Results
Issue: Tools return empty lists
Possible causes:
Entity doesn't exist in your OpenCTI instance
Exact name mismatch (try using search tools first)
No relationships exist between entities
Solution: Use search tools to find exact entity names:
search_threat_actors("APT") # Find all APT groupsPerformance
Issue: Slow queries
Solution: Reduce the
limitparameter for large result setsTip: Latest reports queries can be slow with high limits
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Write tests for new functionality
Ensure all tests pass (
pytest)Format code with Black (
black .)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
Documentation
NEW_FEATURES.md - Detailed feature documentation
TESTING.md - Testing guide
TEST_SUMMARY.md - Test coverage summary
CHANGELOG.md - Version history
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
OpenCTI - Open Cyber Threat Intelligence Platform
Model Context Protocol - MCP specification
pycti - OpenCTI Python client
Support
Issues: GitHub Issues
OpenCTI Documentation: https://docs.opencti.io/
MCP Documentation: https://modelcontextprotocol.io/
Roadmap
Geographic filtering (threat actors by origin country)
Confidence scoring filters
Date range filtering for reports
Aggregate statistics and counting
Graph visualization export
Bulk query operations
Custom field selection
Pagination support for large result sets
Authors
Version
Current version: 1.0.0
See CHANGELOG.md for version history.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Enrich, search, assess, and manage threat intelligence through 80+ typed MCP tools.
Deltabridge brings an AI-native cyber threat intelligence platform into your AI agent. Search a knowledge graph of 400,000+ threat actors, malware families, vulnerabilities, indicators and campaigns, mapped to MITRE ATT&CK. Look up and enrich IOCs, trace links between entities and read living briefs built from 300+ open sources. Read-only, scoped to your organisation, with OAuth sign-in or an API key. Included on Researcher, Business and Enterprise plans.
Query and retrieve information about various adversarial tactics and techniques used in cyber attaβ¦
AI-powered threat intelligence, smart contract auditing, and cybersecurity OSINT.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered threat intelligence analysis of IPs, domains, URLs, and file hashes across multiple threat intelligence platforms (VirusTotal, AlienVault OTX, AbuseIPDB, IPinfo) with APT attribution and interactive reporting through natural language queries.17 PyPI40Apache 2.0
- FlicenseBqualityDmaintenanceProvides comprehensive access to the MITRE ATT\&CK knowledge base with 50+ tools for querying threat actors, malware, and techniques, including automatic ATT\&CK Navigator layer generation for threat analysis and visualization.5545-
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to query and manage OpenCTI threat intelligence data, including indicators, observables, reports, malware, and more, with read-only and optional write operations.39 PyPI1MIT
- AlicenseNot gradedqualityDmaintenanceEnables security investigation and threat hunting through Microsoft Defender and Entra ID, with 31 tools for KQL queries, alerts, threat intelligence, identity investigation, and advanced threat hunting.MIT