threatlocker-mcp-server
MCP server for interacting with the ThreatLocker Portal API, enabling querying of computers, applications, policies, audit logs, and more through AI assistants.
README
ThreatLocker MCP Server
An MCP (Model Context Protocol) server for interacting with the ThreatLocker Portal API through Claude Desktop, Claude Code, or any MCP-compatible client.
About
This server exposes ThreatLocker Portal functionality as MCP tools, enabling AI assistants to query computers, applications, policies, audit logs, and more. It supports both local (stdio) and remote (HTTP/SSE) transports.
Current Status: Full read/write support for applications and policies. Set THREATLOCKER_READ_ONLY=true to enforce read-only mode.
Disclaimer
USE AT YOUR OWN RISK
This software is provided "as is" without warranty of any kind. This is an unofficial, community-developed integration and is not affiliated with, endorsed by, or supported by ThreatLocker.
- API keys are currently stored in plain text (in environment variables,
.envfiles, or MCP client config files). A more secure credential storage solution is planned for a future release.- Always test in a non-production environment first
- Review the source code before deploying
- Monitor API usage and audit logs
- The authors are not responsible for any damages, security incidents, or unintended actions resulting from use of this software
By using this software, you accept full responsibility for its use in your environment.
Protecting API Keys with ThreatLocker Storage Control
Since API keys are stored in plain text, you can use ThreatLocker's own Storage Control to restrict which applications can read the config files. This ensures that even if an unauthorized process runs on your machine, it cannot access the keys.
Files to protect:
| File | Used By |
|---|---|
.env |
MCP server (stdio mode) |
claude_desktop_config.json |
Claude Desktop |
.mcp.json / ~/.claude.json |
Claude Code |
Recommended Storage Control policy:
- In ThreatLocker Portal, navigate to Application Control > Storage Control
- Create a Deny policy that blocks all applications from reading the config files listed above
- Create Permit policies that allow only the specific applications that need access. Example:
node.exe/node— for the MCP server processClaude Desktop.exe/Claude Desktop— for Claude Desktopclaude— for Claude Code CLI
- Apply the policies to the relevant computer group
This way, ThreatLocker prevents any other process from reading your API keys, even though they are stored in plain text.
Installation
Prerequisites
- Node.js 24+ or Docker
- ThreatLocker API key (generate in Portal)
Option 1: Docker (Recommended)
docker pull ghcr.io/bigfootbytes/threatlocker-mcp-server:latest
Option 2: From Source
git clone https://github.com/BigfootBytes/threatlocker-mcp-server.git
cd threatlocker-mcp-server
npm install
npm run build
Configuration
Claude Desktop / Claude Code
Add to your MCP config file:
| Client | OS | Config Path |
|---|---|---|
| Claude Desktop | macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Claude Desktop | Windows | %APPDATA%\Claude\claude_desktop_config.json |
| Claude Desktop | Linux | ~/.config/Claude/claude_desktop_config.json |
| Claude Code | All | Project .mcp.json or ~/.claude.json |
Docker configuration:
{
"mcpServers": {
"threatlocker": {
"command": "docker",
"args": ["run", "-i", "--rm", "ghcr.io/bigfootbytes/threatlocker-mcp-server:latest"],
"env": {
"THREATLOCKER_API_KEY": "your-api-key",
"THREATLOCKER_BASE_URL": "https://portalapi.g.threatlocker.com/portalapi",
"THREATLOCKER_ORG_ID": "optional-managed-org-id"
}
}
}
}
Node.js configuration:
{
"mcpServers": {
"threatlocker": {
"command": "node",
"args": ["/path/to/threatlocker-mcp-server/dist/index.js"],
"env": {
"THREATLOCKER_API_KEY": "your-api-key",
"THREATLOCKER_BASE_URL": "https://portalapi.g.threatlocker.com/portalapi"
}
}
}
}
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
THREATLOCKER_API_KEY |
Yes* | - | API key (stdio mode) |
THREATLOCKER_BASE_URL |
Yes* | - | Portal API URL |
THREATLOCKER_ORG_ID |
No | - | Managed organization ID |
TRANSPORT |
No | stdio |
Transport mode: stdio or http |
PORT |
No | 8080 |
HTTP server port |
LOG_LEVEL |
No | INFO |
Logging: ERROR, INFO, DEBUG |
ALLOWED_ORIGINS |
No | - | CORS origins (comma-separated) |
THREATLOCKER_READ_ONLY |
No | - | Set to true, 1, or yes to block all write operations server-wide |
*Required for stdio mode. HTTP mode uses per-request headers.
ThreatLocker API URLs
| Environment | Base URL |
|---|---|
| Production | https://portalapi.g.threatlocker.com/portalapi |
| Beta | https://betaportalapi.g.threatlocker.com/portalapi |
Available Tools
CRUD Capabilities
| Tool | Create | Read | Update | Delete | Description |
|---|---|---|---|---|---|
computers |
- | :white_check_mark: | - | - | Query computers, check-ins, install info |
computer_groups |
- | :white_check_mark: | - | - | List groups, dropdowns |
applications |
- | :white_check_mark: | - | - | Search apps, research details, files |
policies |
- | :white_check_mark: | - | - | View policies by ID or application |
action_log |
- | :white_check_mark: | - | - | Unified audit logs, file history |
approval_requests |
- | :white_check_mark: | - | - | Pending approvals, permit details |
organizations |
- | :white_check_mark: | - | - | Child orgs, auth keys |
reports |
- | :white_check_mark: | - | - | List and run reports |
maintenance_mode |
- | :white_check_mark: | - | - | Computer maintenance history |
scheduled_actions |
- | :white_check_mark: | - | - | Scheduled agent updates |
system_audit |
- | :white_check_mark: | - | - | Portal audit logs, health center |
tags |
- | :white_check_mark: | - | - | Network and policy tags |
storage_policies |
- | :white_check_mark: | - | - | Storage control policies |
network_access_policies |
- | :white_check_mark: | - | - | Network access control policies |
versions |
- | :white_check_mark: | - | - | Available ThreatLocker agent versions |
online_devices |
- | :white_check_mark: | - | - | Currently online/connected devices |
Tool Details
| Tool | Actions |
|---|---|
computers |
list, get, checkins, get_install_info |
computer_groups |
list, dropdown, dropdown_with_org, get_for_permit, get_by_install_key |
applications |
search, get, research, files, match, get_for_maintenance, get_for_network_policy |
policies |
get, list_by_application |
action_log |
search, get, file_history, get_file_download, get_policy_conditions, get_testing_details |
approval_requests |
list, get, count, get_file_download_details, get_permit_application, get_storage_approval |
organizations |
list_children, get_auth_key, get_for_move_computers |
reports |
list, get_data |
maintenance_mode |
get_history |
scheduled_actions |
list, search, get, get_applies_to |
system_audit |
search, health_center |
tags |
get, dropdown |
storage_policies |
get, list |
network_access_policies |
get, list |
versions |
list |
online_devices |
list |
HTTP Mode (Remote Server)
For remote deployments, run in HTTP mode:
docker run -d -p 8080:8080 -e TRANSPORT=http ghcr.io/bigfootbytes/threatlocker-mcp-server:latest
Endpoints
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /health |
No | Health check |
| GET | /tools |
No | List available tools |
| GET | /sse |
Yes | SSE stream (Claude Desktop) |
| POST | /messages |
Session | SSE client messages |
| POST | /mcp |
Yes | Streamable HTTP MCP |
| POST | /tools/:name |
Yes | Direct REST API |
Authentication Headers
| Header | Required | Description |
|---|---|---|
Authorization |
Yes | ThreatLocker API key |
X-ThreatLocker-Base-URL |
Yes | Portal API base URL |
X-ThreatLocker-Org-ID |
No | Managed organization ID |
Claude Remote Configuration
Streamable HTTP via mcp-remote (Claude Desktop):
Claude Desktop does not yet support Streamable HTTP natively. Use mcp-remote as a proxy:
{
"mcpServers": {
"threatlocker": {
"command": "npx",
"args": [
"mcp-remote",
"https://your-server.example.com/mcp",
"--header",
"Authorization:${THREATLOCKER_API_KEY}",
"--header",
"X-ThreatLocker-Base-URL:${THREATLOCKER_BASE_URL}"
],
"env": {
"THREATLOCKER_API_KEY": "your-api-key",
"THREATLOCKER_BASE_URL": "https://portalapi.g.threatlocker.com/portalapi"
}
}
}
}
SSE (legacy):
{
"mcpServers": {
"threatlocker": {
"url": "https://your-server.example.com/sse",
"headers": {
"Authorization": "your-api-key",
"X-ThreatLocker-Base-URL": "https://portalapi.g.threatlocker.com/portalapi"
}
}
}
}
Development
npm install # Install dependencies
npm run build # Compile TypeScript
npm test # Run tests
npm run dev # Watch mode
License
GPL-3.0 - see LICENSE for details.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。