# OpenCTI MCP
## 基本信息
- Slug: `spathodea-network-opencti-mcp`
- Source: modelscope
- Publisher: @Spathodea-Network/opencti-mcp
- Categories: security-and-iam / databases / 其他
- Hosted: No
- License: MIT License
- Source URL: https://www.modelscope.cn/mcp/servers/@Spathodea-Network/opencti-mcp
## 简介
一个模型上下文协议服务器，便于与OpenCTI集成，允许用户通过标准化接口查询和检索网络威胁情报数据。
## 安装提示

```bash
npx -y @smithery/cli install opencti-server --client claude
```

## MCP Server 详情

# OpenCTI MCP Server

[![smithery badge](https://smithery.ai/badge/opencti-server)](https://smithery.ai/server/opencti-server)
[繁體中文](README.zh-TW.md)

<a href="https://glama.ai/mcp/servers/ml61kiz1gm"><img width="380" height="200" src="https://glama.ai/mcp/servers/ml61kiz1gm/badge" alt="OpenCTI Server MCP server" /></a>

## 概述
OpenCTI MCP Server 是一个 Model Context Protocol (MCP) 服务器，它提供了与 OpenCTI（开放网络威胁情报）平台的无缝集成。它通过标准化接口实现了查询和检索威胁情报数据的功能。

## 功能
- 获取和搜索威胁情报数据
  - 获取最新报告并按 ID 搜索
  - 搜索恶意软件信息
  - 查询妥协指标
  - 搜索威胁行为者
- 用户和组管理
  - 列出所有用户和组
  - 按 ID 获取用户详细信息
- STIX 对象操作
  - 列出攻击模式
  - 按名称获取活动信息
- 系统管理
  - 列出连接器
  - 查看状态模板
- 文件操作
  - 列出所有文件
  - 按 ID 获取文件详细信息
- 引用数据访问
  - 列出标记定义
  - 查看可用标签
- 可自定义的查询限制
- 完全支持 GraphQL 查询

## 前提条件
- Node.js 16 或更高版本
- 访问 OpenCTI 实例
- OpenCTI API 令牌

## 安装

### 通过 Smithery 安装

要通过 [Smithery](https://smithery.ai/server/opencti-server) 自动安装适用于 Claude Desktop 的 OpenCTI Server：

```bash
npx -y @smithery/cli install opencti-server --client claude
```


### 手动安装
```bash
# Clone the repository
git clone https://github.com/yourusername/opencti-mcp-server.git

# Install dependencies
cd opencti-mcp-server
npm install

# Build the project
npm run build
```


## 配置

### 环境变量
将 `.env.example` 复制为 `.env` 并使用您的 OpenCTI 凭据进行更新：
```bash
cp .env.example .env
```


必需的环境变量：
- `OPENCTI_URL`: 您的 OpenCTI 实例 URL
- `OPENCTI_TOKEN`: 您的 OpenCTI API 令牌

### MCP 设置
在您的 MCP 设置位置创建一个配置文件：
```json
{
  "mcpServers": {
    "opencti": {
      "command": "node",
      "args": ["path/to/opencti-server/build/index.js"],
      "env": {
        "OPENCTI_URL": "${OPENCTI_URL}",  // Will be loaded from .env
        "OPENCTI_TOKEN": "${OPENCTI_TOKEN}"  // Will be loaded from .env
      }
    }
  }
}
```


### 安全注意事项
- 永远不要将 `.env` 文件或 API 令牌提交到版本控制系统
- 保护您的 OpenCTI 凭据安全
- `.gitignore` 文件已配置为排除敏感文件

## 可用工具

### 报告
#### get_latest_reports
检索最新的威胁情报报告。
```typescript
{
  "name": "get_latest_reports",
  "arguments": {
    "first": 10  // Optional, defaults to 10
  }
}
```


#### get_report_by_id
按 ID 检索特定报告。
```typescript
{
  "name": "get_report_by_id",
  "arguments": {
    "id": "report-uuid"  // Required
  }
}
```


### 搜索操作
#### search_malware
在 OpenCTI 数据库中搜索恶意软件信息。
```typescript
{
  "name": "search_malware",
  "arguments": {
    "query": "ransomware",
    "first": 10  // Optional, defaults to 10
  }
}
```


#### search_indicators
搜索妥协指标。
```typescript
{
  "name": "search_indicators",
  "arguments": {
    "query": "domain",
    "first": 10  // Optional, defaults to 10
  }
}
```


#### search_threat_actors
搜索威胁行为者信息。
```typescript
{
  "name": "search_threat_actors",
  "arguments": {
    "query": "APT",
    "first": 10  // Optional, defaults to 10
  }
}
```


### 用户管理
#### get_user_by_id
按 ID 检索用户信息。
```typescript
{
  "name": "get_user_by_id",
  "arguments": {
    "id": "user-uuid"  // Required
  }
}
```


#### list_users
列出系统中的所有用户。
```typescript
{
  "name": "list_users",
  "arguments": {}
}
```


#### list_groups
列出所有组及其成员。
```typescript
{
  "name": "list_groups",
  "arguments": {
    "first": 10  // Optional, defaults to 10
  }
}
```


### STIX 对象
#### list_attack_patterns
列出系统中的所有攻击模式。
```typescript
{
  "name": "list_attack_patterns",
  "arguments": {
    "first": 10  // Optional, defaults to 10
  }
}
```


#### get_campaign_by_name
按名称检索活动信息。
```typescript
{
  "name": "get_campaign_by_name",
  "arguments": {
    "name": "campaign-name"  // Required
  }
}
```


### 系统管理
#### list_connectors
列出所有系统连接器。
```typescript
{
  "name": "list_connectors",
  "arguments": {}
}
```

#### list_status_templates
列出所有状态模板。
```typescript
{
  "name": "list_status_templates",
  "arguments": {}
}
```


### 文件操作
#### get_file_by_id
通过ID检索文件信息。
```typescript
{
  "name": "get_file_by_id",
  "arguments": {
    "id": "file-uuid"  // Required
  }
}
```


#### list_files
列出系统中的所有文件。
```typescript
{
  "name": "list_files",
  "arguments": {}
}
```


### 参考数据
#### list_marking_definitions
列出所有标记定义。
```typescript
{
  "name": "list_marking_definitions",
  "arguments": {}
}
```


#### list_labels
列出所有可用标签。
```typescript
{
  "name": "list_labels",
  "arguments": {}
}
```


## 贡献
欢迎贡献！请随时提交拉取请求。

## 许可证
MIT 许可证

