MCP Server
The Threatray MCP server connects your AI agent to Threatray and lets it work with the whole platform: over 100 million analyzed samples, over one billion labeled functions, code-based retrohunting and clustering, the AI Reverser, full behavioral analysis and more. Its answers are grounded in what the code shows and what the sample did, and it can follow a lead through dozens of pivots in minutes.
The MCP server is a service hosted by Threatray and works with Claude Code, Codex, Cursor and other MCP clients. Your agent uses your Threatray account, with the same permissions and quota as the web app and the API.
What your agent can do
- Triage unknown samples: Works through unknown samples on its own: verdict, family, behavior and IOCs for each one, grounded in code similarity and the AI Reverser, plus related samples and public reporting. You get the evidence, ready to judge.
Example: "Analyze these five files, tell me which are malicious, what they do and whether they belong together." - Hunt and pivot: Start from a few known samples or IOCs. Your agent finds related samples by shared code and behavior and groups them into clusters, with how closely they are related, which ones are new variants and what new IOCs they bring.
Example: "Here are the samples and IOCs from this report. Find related samples in Threatray and list any new IOCs." - Reverse in depth: Get to the bottom of how a sample works. Your agent starts from a map of the binary with library code set aside, reads the decompiled code, diffs functions between variants and explains the result down to the individual function.
Example: "Find the C2 functions in<hash>, explain how the protocol works, and check which other samples share the same C2 code."
Anything you can do in Threatray, your agent can do too, and it can chain the steps on its own.
Capabilities
- Code detections: identify malware families from code similarity against over one billion labeled functions, so new variants with new hashes are still recognized.
- Goodware and library identification: separate known library and runtime code from unknown code, so your agent focuses on the functions that matter.
- Retrohunt: find code-wise similar samples across over 100 million samples, by whole sample or with function-level retrohunting.
- AI Reverser: AI code explanations, AI capabilities and AI verdicts for every code region and function, including unpacked and injected code, each claim pointing to function addresses.
- Function diffing and decompilation: what was added, removed or changed between samples, and the decompiled code of any function.
- OSINT Hunt: surface public reporting through code similarity, even when hashes and IOCs differ.
- Analyses, search and submission: dynamic analysis results with behavior, IOCs and memory regions, plus strings and file metadata; search by IOCs, families, YARA rules and hashes; submit files and URLs.
Before you start
- MCP URL:
https://api-<instance-name>.analysis.threatray.com/mcp, where<instance-name>is the first part of the address you use to open Threatray in your browser:<instance-name>.analysis.threatray.com. - Prerequisites: a Threatray account on an instance where the MCP server is enabled.
You can connect in two ways:
- OAuth (recommended): your client opens a browser, and you sign in to Threatray and approve access.
- API key: your client sends the key in an HTTP header. Use it for scripts, CI and headless machines, or clients without OAuth. Your API key is described in Authentication.
In the API key examples, replace <api-key> with your key.
Install
OAuth (recommended)
claude mcp add --transport http --scope user threatray https://api-<instance-name>.analysis.threatray.com/mcp
claude mcp login threatrayTo check the connection, run claude mcp list. If the tools don't appear right after your first sign-in, restart Claude Code.
- Open Customize › Connectors and choose Add custom connector. On Team and Enterprise plans, members can't add a custom connector themselves: an owner adds it under Organization settings › Connectors › Add › Custom, and each member then selects Connect on it under Customize › Connectors.
- Enter the name
Threatrayand your MCP URL. Leave Advanced settings empty, or, if Claude asks, choose Sign in now and the OAuth client Register automatically. Select Add. To change these settings later, remove the connector and add it again. - Select Connect, sign in to Threatray and approve.
- In a chat, select + › Connectors and turn on Threatray. The connector also works on claude.ai.
The Codex CLI, the IDE extension and the ChatGPT desktop app share ~/.codex/config.toml, so you set Threatray up once.
codex mcp add threatray --url https://api-<instance-name>.analysis.threatray.com/mcpCodex opens your browser to sign in. If it doesn't, or to sign in again later, run codex mcp login threatray. To check the connection, run codex mcp list, or /mcp in a session.
In the ChatGPT desktop app: open Settings › Plugins › MCPs, select Add MCP server, choose Streamable HTTP and enter your MCP URL. Save, then Authenticate.
Add to ~/.cursor/mcp.json, then sign in from Customize › MCPs:
{
"mcpServers": {
"threatray": {
"url": "https://api-<instance-name>.analysis.threatray.com/mcp"
}
}
}gemini mcp add --scope user --transport http threatray https://api-<instance-name>.analysis.threatray.com/mcpThen start gemini and run /mcp auth threatray. Gemini CLI turns MCP servers off in folders you haven't trusted. Trust the folder, then check with /mcp.
In the app or IDE, open the MCP server settings and edit the raw configuration (mcp_config.json). In the Antigravity CLI, edit ~/.gemini/config/mcp_config.json, or .agents/mcp_config.json in your workspace.
{
"mcpServers": {
"threatray": {
"serverUrl": "https://api-<instance-name>.analysis.threatray.com/mcp"
}
}
}In the app, select Authenticate (Customizations › Installed), sign in in your browser, then paste the authorization code back. In the CLI, use /mcp.
Add to opencode.json in your project, or to ~/.config/opencode/opencode.json for all projects:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"threatray": {
"type": "remote",
"url": "https://api-<instance-name>.analysis.threatray.com/mcp"
}
}
}Then run opencode mcp auth threatray. To check the connection, run opencode mcp list.
API key
Each client sends your key in the header Authorization: apikey <api-key>.
claude mcp add --transport http --scope user threatray https://api-<instance-name>.analysis.threatray.com/mcp --header "Authorization: apikey <api-key>"To check the connection, run claude mcp list.
Add to ~/.codex/config.toml:
[mcp_servers.threatray]
url = "https://api-<instance-name>.analysis.threatray.com/mcp"
http_headers = { "Authorization" = "apikey <api-key>" }To check the connection, run codex mcp list, or /mcp in a session.
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"threatray": {
"url": "https://api-<instance-name>.analysis.threatray.com/mcp",
"headers": {
"Authorization": "apikey <api-key>"
}
}
}
}gemini mcp add --scope user --transport http threatray https://api-<instance-name>.analysis.threatray.com/mcp -H "Authorization: apikey <api-key>"Gemini CLI turns MCP servers off in folders you haven't trusted. Trust the folder, then check with /mcp.
Edit the same mcp_config.json as for OAuth:
{
"mcpServers": {
"threatray": {
"serverUrl": "https://api-<instance-name>.analysis.threatray.com/mcp",
"headers": {
"Authorization": "apikey <api-key>"
}
}
}
}Add to opencode.json in your project, or to ~/.config/opencode/opencode.json for all projects:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"threatray": {
"type": "remote",
"url": "https://api-<instance-name>.analysis.threatray.com/mcp",
"oauth": false,
"headers": {
"Authorization": "apikey <api-key>"
}
}
}
}To check the connection, run opencode mcp list.
OAuth is not available in VS Code. Add to .vscode/mcp.json:
{
"servers": {
"threatray": {
"type": "http",
"url": "https://api-<instance-name>.analysis.threatray.com/mcp",
"headers": {
"Authorization": "apikey <api-key>"
}
}
}
}Other MCP clients
Any client that supports remote MCP servers over Streamable HTTP can connect. OAuth works if the client registers itself without a client secret and returns to a web address or to localhost with a port. Otherwise use an API key, if the client lets you set the header Authorization: apikey <api-key>.
Check the connection
Ask your assistant: "Call threatray_connection and summarize the result." It reports who you're signed in as and the available tools. Then try a read-only question, such as "Look up 79d0b4b169e9be3e6b794106b424086f in Threatray."
Upload and download files
Threatray's tools never pass file contents through the AI model. To upload or download a file, your agent runs a command, typically curl or a short Python script, that transfers the file between your computer and Threatray. Coding agents do this once you approve the command.
If the agent runs in a sandbox, allow network access to api-<instance-name>.analysis.threatray.com. Each upload or download uses a one-time link that is valid for 10 minutes. If a download fails, ask the agent to try again. If an upload fails, have the agent check your latest submissions before submitting again, so the sample isn't submitted twice.
In chat apps, upload and download files in the Threatray web app.
Updated 16 days ago
