Skip to main content
Glama
cjmateoo0221

OpenCTI MCP Server

by cjmateoo0221
README.md
# OpenCTI MCP Server

This MCP server provides tools to interact with the OpenCTI platform using the pycti library.

## Features

- **check_campaign_exists**: Check if a campaign exists in OpenCTI by name

## Requirements

- Python 3.8+
- pycti 5.12.33
- fastmcp

## Installation

1. Install dependencies:
```bash
pip install -r requirements.txt
```

2. Set up environment variables:
- `OPENCTI_URL`: The URL of your OpenCTI instance (e.g., https://your-opencti-instance.com)
- `OPENCTI_TOKEN`: Your OpenCTI API token

## Configuration

Add the following to your MCP settings configuration file:

```json
{
  "mcpServers": {
    "opencti": {
      "command": "python",
      "args": ["C:/Users/JIT/Documents/Cline/MCP/opencti-server/server.py"],
      "env": {
        "OPENCTI_URL": "your-opencti-url",
        "OPENCTI_TOKEN": "your-opencti-token"
      }
    }
  }
}
```

## Usage

Once configured, you can use the following tool:

### check_campaign_exists

Check if a campaign exists in OpenCTI by providing its name:

```
Input: {"name": "APT28"}
Output: {
  "exists": true,
  "campaign": {
    "id": "campaign-id",
    "name": "APT28",
    "description": "...",
    ...
  },
  "message": "Campaign 'APT28' found in OpenCTI"
}
```

## Getting OpenCTI Credentials

1. Log in to your OpenCTI instance
2. Navigate to your profile settings
3. Generate an API token
4. Copy the token and your OpenCTI instance URL