Panther's Model Context Protocol (MCP) server provides functionality to:
概览
Panther's Model Context Protocol (MCP) server provides functionality to:
README
Panther MCP Server
Panther’s Model Context Protocol (MCP) server provides functionality to:
- Write and tune detections from your IDE
- Interactively query security logs using natural language
- Triage, comment, and resolve one or many alerts
Available Tools
Panther Configuration
Follow these steps to configure your API credentials and environment.
-
Create an API token in Panther:
- Navigate to Settings (gear icon) → API Tokens
- Create a new token with the following permissions (recommended read-only approach to start):
-
Store the generated token securely (e.g., 1Password)
-
Copy the Panther instance URL from your browser (e.g.,
https://YOUR-PANTHER-INSTANCE.domain)- Note: This must include
https://
- Note: This must include
MCP Server Installation
Choose one of the following installation methods:
Docker (Recommended)
The easiest way to get started is using our pre-built Docker image:
{
"mcpServers": {
"mcp-panther": {
"command": "docker",
"args": [
"run",
"-i",
"-e", "PANTHER_INSTANCE_URL",
"-e", "PANTHER_API_TOKEN",
"--rm",
"ghcr.io/panther-labs/mcp-panther"
],
"env": {
"PANTHER_INSTANCE_URL": "https://YOUR-PANTHER-INSTANCE.domain",
"PANTHER_API_TOKEN": "YOUR-API-KEY"
}
}
}
}
Version Pinning: For production stability, pin to a specific version tag:
"ghcr.io/panther-labs/mcp-panther:v2.2.0"
Available tags can be found on the GitHub Container Registry.
UVX
For Python users, you can run directly from PyPI using uvx:
-
Configure your MCP client:
{
"mcpServers": {
"mcp-panther": {
"command": "uvx",
"args": ["mcp-panther"],
"env": {
"PANTHER_INSTANCE_URL": "https://YOUR-PANTHER-INSTANCE.domain",
"PANTHER_API_TOKEN": "YOUR-PANTHER-API-TOKEN"
}
}
}
}
Version Pinning: For production stability, pin to a specific version:
"args": ["mcp-panther==2.2.0"]
Available versions can be found on PyPI.
MCP Client Setup
Cursor
Follow the instructions here to configure your project or global MCP configuration. It’s VERY IMPORTANT that you do not check this file into version control.
Once configured, navigate to Cursor Settings > MCP to view the running server:
Tips:
- Be specific about where you want to generate new rules by using the
@symbol and then typing a specific directory. - For more reliability during tool use, try selecting a specific model, like Claude 3.7 Sonnet.
- If your MCP Client is failing to find any tools from the Panther MCP Server, try restarting the Client and ensuring the MCP server is running. In Cursor, refresh the MCP Server and start a new chat.
Claude Code
Claude Code is Anthropic’s official CLI tool. Add the Panther MCP server using Docker:
claude mcp add-json panther '{
"command": "docker",
"args": [
"run",
"-i",
"-e", "PANTHER_INSTANCE_URL",
"-e", "PANTHER_API_TOKEN",
"--rm",
"ghcr.io/panther-labs/mcp-panther"
],
"env": {
"PANTHER_INSTANCE_URL": "https://YOUR-PANTHER-INSTANCE.domain",
"PANTHER_API_TOKEN": "YOUR-API-TOKEN"
}
}'
Alternatively, using UVX:
claude mcp add-json panther '{
"command": "uvx",
"args": ["mcp-panther"],
"env": {
"PANTHER_INSTANCE_URL": "https://YOUR-PANTHER-INSTANCE.domain",
"PANTHER_API_TOKEN": "YOUR-API-TOKEN"
}
}'
After adding, verify the server is configured:
claude mcp list
Claude Desktop
To use with Claude Desktop, manually configure your claude_desktop_config.json:
- Open the Claude Desktop settings and navigate to the Developer tab
- Click “Edit Config” to open the configuration file
- Add the following configuration:
{
"mcpServers": {
"mcp-panther": {
"command": "uvx",
"args": ["mcp-panther"],
"env": {
"PANTHER_INSTANCE_URL": "https://YOUR-PANTHER-INSTANCE.domain",
"PANTHER_API_TOKEN": "YOUR-PANTHER-API-TOKEN"
}
}
}
}
- Save the file and restart Claude Desktop
If you run into any issues, try the troubleshooting steps here.
Goose CLI
Use with Goose CLI, Block’s open-source AI agent:
# Start Goose with the MCP server
goose session --with-extension "uvx mcp-panther"
Goose Desktop
Use with Goose Desktop, Block’s open-source AI agent:
From ‘Extensions’ -> ‘Add custom extension’ provide your configuration information.
Running the Server
The MCP Panther server supports multiple transport protocols:
STDIO (Default)
For local development and MCP client integration:
uv run python -m mcp_panther.server
Streamable HTTP
For running as a persistent web service, use the HTTP transport. This is ideal for:
- Long-running server deployments
- Multiple clients connecting to the same server
- Testing and debugging with continuous log monitoring
Using Docker Run (Detached)
docker run -d \
--name panther-mcp-server \
-p 8000:8000 \
-e PANTHER_INSTANCE_URL=https://YOUR-PANTHER-INSTANCE.domain \
-e PANTHER_API_TOKEN=YOUR-API-TOKEN \
-e MCP_TRANSPORT=streamable-http \
-e MCP_HOST=0.0.0.0 \
-e MCP_PORT=8000 \
-e LOG_LEVEL=INFO \
--restart unless-stopped \
ghcr.io/panther-labs/mcp-panther:latest
Using Docker Compose (Recommended)
Create a docker-compose.yml file:
services:
panther-mcp:
image: ghcr.io/panther-labs/mcp-panther:latest
container_name: panther-mcp-server
ports:
- "8000:8000"
environment:
- PANTHER_INSTANCE_URL=https://YOUR-PANTHER-INSTANCE.domain
- PANTHER_API_TOKEN=YOUR-API-TOKEN
- MCP_TRANSPORT=streamable-http
- MCP_HOST=0.0.0.0
- MCP_PORT=8000
- LOG_LEVEL=INFO
restart: unless-stopped
Start the server:
# Start in detached mode
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the server
docker-compose down
Connecting Claude Code to HTTP Server
Important: The server runs on HTTP (not HTTPS). Configure Claude Code with the http:// URL:
# Add the HTTP endpoint (note: http:// not https://)
claude mcp add-json panther-http '{
"url": "http://localhost:8000/mcp"
}'
# Verify configuration
claude mcp list
Testing the Connection
# Test the HTTP endpoint
curl http://localhost:8000/mcp
# View server logs
docker logs -f panther-mcp-server
# Or with docker-compose:
docker-compose logs -f
You can also test using the FastMCP client:
import asyncio
from fastmcp import Client
async def test_connection():
async with Client("http://localhost:8000/mcp") as client:
tools = await client.list_tools()
print(f"Available tools: {len(tools)}")
asyncio.run(test_connection())
Troubleshooting Streamable HTTP
Port Already in Use
If you see Bind for 0.0.0.0:8000 failed: port is already allocated:
# Check what's using the port
lsof -i :8000
# Stop conflicting containers
docker ps | grep panther
docker stop
# Or use a different port via MCP_PORT environment variable:
-e MCP_PORT=8080
# Then connect to: http://localhost:8080/mcp
Invalid HTTP Request Warnings
If you see WARNING: Invalid HTTP request received in the logs, this usually means:
- Claude Code is trying to connect via HTTPS instead of HTTP
- Check your configuration uses
http://nothttps:// - Verify with:
claude mcp list
Environment Variables
MCP_TRANSPORT: Set transport type (stdioorstreamable-http)MCP_PORT: Port for HTTP transport (default: 3000)MCP_HOST: Host for HTTP transport (default: 127.0.0.1)MCP_LOG_FILE: Log file path (optional)
Security Best Practices
We highly recommends the following MCP security best practices:
- Apply strict least-privilege to Panther API tokens. Scope tokens to the minimal permissions required and bind them to an IP allow-list or CIDR range so they’re useless if exfiltrated. Rotate credentials on a preferred interval (e.g., every 30d).
- Host the MCP server in a locked-down sandbox (e.g., Docker) with read-only mounts. This confines any compromise to a minimal blast radius.
- Monitor credential access to Panther and monitor for anomalies. Write a Panther rule!
- Run only trusted, officially signed MCP servers. Verify digital signatures or checksums before running, audit the tool code, and avoid community tools from unofficial publishers.
Troubleshooting
Check the server logs for detailed error messages: tail -n 20 -F ~/Library/Logs/Claude/mcp*.log. Common issues and solutions are listed below.
Running tools
- If you get a
{"success": false, "message": "Failed to [action]: Request failed (HTTP 403): {\"error\": \"forbidden\"}"}error, it likely means your API token lacks the particular permission needed by the tool. - Ensure your Panther Instance URL is correctly set. You can view this in the
config://pantherresource from your MCP Client.
Contributing
We welcome contributions to improve MCP-Panther! Here’s how you can help:
- Report Issues: Open an issue for any bugs or feature requests
- Submit Pull Requests: Fork the repository and submit PRs for bug fixes or new features
- Improve Documentation: Help us make the documentation clearer and more comprehensive
- Share Use Cases: Let us know how you’re using MCP-Panther and what could make it better
Please ensure your contributions follow our coding standards and include appropriate tests and documentation.
Contributors
This project exists thanks to all the people who contribute. Special thanks to Tomasz Tchorz and Glenn Edwards from Block, who played a core role in launching MCP-Panther as a joint open-source effort with Panther.
See our CONTRIBUTORS.md for a complete list of contributors.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
安装
docker run -i -e PANTHER_INSTANCE_URL -e PANTHER_API_TOKEN --rm ghcr.io/panther-labs/mcp-panther配置
{
"mcpServers": {
"mcp-panther": {
"command": "docker",
"args": [
"run",
"-i",
"-e", "PANTHER_INSTANCE_URL",
"-e", "PANTHER_API_TOKEN",
"--rm",
"ghcr.io/panther-labs/mcp-panther"
],
"env": {
"PANTHER_INSTANCE_URL": "https://YOUR-PANTHER-INSTANCE.domain",
"PANTHER_API_TOKEN": "YOUR-API-KEY"
}
}
}
}