Zammad MCP Server
An MCP server that connects AI assistants to Zammad, providing tools for managing tickets, users, organizations, and attachments.
README
Zammad MCP Server
An MCP server that connects AI assistants to Zammad, providing tools for managing tickets, users, organizations, and attachments.
Disclaimer: This project is not affiliated with or endorsed by Zammad GmbH or the Zammad Foundation. This is an independent integration that uses the Zammad API.
Features
Tools
-
Ticket Management
zammad_search_tickets- Search tickets with multiple filterszammad_get_ticket- Get detailed ticket information with articles (supports pagination)zammad_create_ticket- Create new ticketszammad_update_ticket- Update ticket propertieszammad_add_article- Add comments/notes to ticketszammad_add_ticket_tag/zammad_remove_ticket_tag- Manage ticket tagszammad_get_ticket_tags- Get tags assigned to a specific ticketzammad_list_tags- List all tags defined in the system (requires admin.tag permission)
-
Attachment Support
zammad_get_article_attachments- List attachments for a ticket articlezammad_download_attachment- Download attachment content (base64-encoded)zammad_delete_attachment- Delete attachments from ticket articles
-
User & Organization Management
zammad_get_user/zammad_search_users- User information and searchzammad_get_organization/zammad_search_organizations- Organization datazammad_get_current_user- Get authenticated user info
-
System Information
zammad_list_groups- Get all available groups (cached for performance)zammad_list_ticket_states- Get all ticket states (cached for performance)zammad_list_ticket_priorities- Get all priority levels (cached for performance)zammad_get_ticket_stats- Get ticket statistics (optimized with pagination)
Resources
Access Zammad data directly:
zammad://ticket/{id}- Individual ticket detailszammad://user/{id}- User profile informationzammad://organization/{id}- Organization detailszammad://queue/{group}- Ticket queue for a group
Prompts
Pre-configured prompts:
analyze_ticket- Comprehensive ticket analysisdraft_response- Generate ticket responsesescalation_summary- Summarize escalated tickets
Installation
Option 1: Run Directly with uvx (Recommended)
Run without installation:
# Install uv if you haven't already
# macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows:
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Run directly from GitHub
uvx --from git+https://github.com/basher83/zammad-mcp.git mcp-zammad
# Or with environment variables
ZAMMAD_URL=https://your-instance.zammad.com/api/v1 \
ZAMMAD_HTTP_TOKEN=your-api-token \
uvx --from git+https://github.com/basher83/zammad-mcp.git mcp-zammad
Option 2: Docker Run
For production or containerized deployments:
# Basic usage with environment variables
docker run --rm -i \
-e ZAMMAD_URL=https://your-instance.zammad.com/api/v1 \
-e ZAMMAD_HTTP_TOKEN=your-api-token \
ghcr.io/basher83/zammad-mcp:latest
# If you must skip TLS verification (self-signed / internal CA), add:
# -e ZAMMAD_INSECURE=true
# Using Docker secrets for better security
docker run --rm -i \
-e ZAMMAD_URL=https://your-instance.zammad.com/api/v1 \
-e ZAMMAD_HTTP_TOKEN_FILE=/run/secrets/token \
-v ./secrets/zammad_http_token.txt:/run/secrets/token:ro \
ghcr.io/basher83/zammad-mcp:latest
# With .env file
docker run --rm -i \
--env-file .env \
ghcr.io/basher83/zammad-mcp:latest
Docker Image Versioning
The project publishes Docker images with semantic versioning:
latest- Most recent stable release1.2.3- Specific version (recommended for production)1.2- Latest patch of 1.2 minor release1- Latest minor/patch of 1.x major releasemain- Latest main branch (may be unstable)
# Recommended for production - pin to specific version
docker pull ghcr.io/basher83/zammad-mcp:1.0.0
View all versions on GitHub Container Registry.
Option 3: For Developers
To contribute or modify the code:
# Clone the repository
git clone https://github.com/basher83/zammad-mcp.git
cd zammad-mcp
# Run the setup script
# On macOS/Linux:
./setup.sh
# On Windows (PowerShell):
.\setup.ps1
For manual setup, see the Development section below.
Configuration
The server requires Zammad API credentials. Use a .env file:
-
Copy the example configuration:
cp .env.example .env -
Edit
.envwith your Zammad credentials:# Required: Zammad instance URL (include /api/v1) ZAMMAD_URL=https://your-instance.zammad.com/api/v1 # Authentication (choose one method): # Option 1: API Token (recommended) ZAMMAD_HTTP_TOKEN=your-api-token # Option 2: OAuth2 Token # ZAMMAD_OAUTH2_TOKEN=your-oauth2-token # Option 3: Username/Password # ZAMMAD_USERNAME=your-username # ZAMMAD_PASSWORD=your-password # Optional: Disable TLS certificate verification (NOT recommended for production) # Truthy values only: 1, true, yes, on. Unset (default) keeps TLS verification enabled. # ZAMMAD_INSECURE=true # Optional: Logging level (default: INFO) # Valid values: DEBUG, INFO, WARNING, ERROR, CRITICAL # LOG_LEVEL=INFO # Optional: Transport Configuration # MCP_TRANSPORT=stdio # Transport type: stdio (default) or http # MCP_HOST=127.0.0.1 # Host address for HTTP transport # MCP_PORT=8000 # Port number for HTTP transport -
The server will automatically load the
.envfile on startup.
Transport Configuration (Optional)
| Variable | Default | Description |
|---|---|---|
MCP_TRANSPORT |
stdio |
Transport type: stdio or http |
MCP_HOST |
127.0.0.1 |
Host address for HTTP transport |
MCP_PORT |
- | Port number for HTTP transport (required if MCP_TRANSPORT=http) |
Important: Keep your .env file out of version control (already in .gitignore).
Response Formats
All data-returning tools support two output formats:
- Markdown (default): Human-readable format optimized for LLM consumption
- JSON: Machine-readable format with complete metadata
Example:
# Markdown (default)
zammad_search_tickets(query="network", response_format="markdown")
# JSON
zammad_search_tickets(query="network", response_format="json")
Usage
With Claude Desktop
Add to your Claude Desktop configuration:
{
"mcpServers": {
"zammad": {
"command": "uvx",
"args": ["--from", "git+https://github.com/basher83/zammad-mcp.git", "mcp-zammad"],
"env": {
"ZAMMAD_URL": "https://your-instance.zammad.com/api/v1",
"ZAMMAD_HTTP_TOKEN": "your-api-token"
}
}
}
}
Or using Docker:
{
"mcpServers": {
"zammad": {
"command": "docker",
"args": ["run", "--rm", "-i",
"-e", "ZAMMAD_URL=https://your-instance.zammad.com/api/v1",
"-e", "ZAMMAD_HTTP_TOKEN=your-api-token",
"ghcr.io/basher83/zammad-mcp:latest"]
}
}
}
Note: The server supports stdio (default) and HTTP transports. Stdio mode requires the -i flag for Docker. See the HTTP Transport section below for remote deployments.
Important: The -i flag is required—without it, the MCP server cannot receive stdin. Preserve this flag in wrapper scripts or shell aliases.
Or if you have it installed locally:
{
"mcpServers": {
"zammad": {
"command": "python",
"args": ["-m", "mcp_zammad"],
"env": {
"ZAMMAD_URL": "https://your-instance.zammad.com/api/v1",
"ZAMMAD_HTTP_TOKEN": "your-api-token"
}
}
}
}
Standalone Usage
# Run the server
python -m mcp_zammad
# Or with environment variables
ZAMMAD_URL=https://instance.zammad.com/api/v1 ZAMMAD_HTTP_TOKEN=token python -m mcp_zammad
HTTP Transport (Remote/Cloud Deployment)
The server supports Streamable HTTP transport for remote deployments.
Environment Configuration
Set these environment variables to enable HTTP transport:
export MCP_TRANSPORT=http # Enable HTTP transport
export MCP_HOST=127.0.0.1 # Host to bind (default: 127.0.0.1)
export MCP_PORT=8000 # Port to listen on
Running with HTTP Transport
Direct Python:
MCP_TRANSPORT=http \
MCP_HOST=127.0.0.1 \
MCP_PORT=8000 \
ZAMMAD_URL=https://your-instance.zammad.com/api/v1 \
ZAMMAD_HTTP_TOKEN=your-api-token \
uvx --from git+https://github.com/basher83/zammad-mcp.git mcp-zammad
Docker:
docker run -d \
--name zammad-mcp-http \
-p 8000:8000 \
-e MCP_TRANSPORT=http \
-e MCP_HOST=0.0.0.0 \
-e MCP_PORT=8000 \
-e ZAMMAD_URL=https://your-instance.zammad.com/api/v1 \
-e ZAMMAD_HTTP_TOKEN=your-api-token \
ghcr.io/basher83/zammad-mcp:latest
Access the MCP endpoint at http://localhost:8000/mcp/.
Production Deployment with Reverse Proxy
⚠️ SECURITY WARNING: Bind to 0.0.0.0 only behind a reverse proxy with TLS.
Use a reverse proxy (nginx/Caddy) for HTTPS and security:
Example with Caddy:
# Start the MCP server (binds to all interfaces for reverse proxy)
MCP_TRANSPORT=http \
MCP_HOST=0.0.0.0 \
MCP_PORT=8000 \
ZAMMAD_URL=https://your-instance.zammad.com/api/v1 \
ZAMMAD_HTTP_TOKEN=your-api-token \
uvx --from git+https://github.com/basher83/zammad-mcp.git mcp-zammad
Caddyfile configuration:
mcp.yourdomain.com {
reverse_proxy localhost:8000
# Caddy automatically handles HTTPS/TLS
}
Production checklist:
- Use
MCP_HOST=0.0.0.0only behind a reverse proxy - Enable HTTPS/TLS via reverse proxy
- Implement authentication at the proxy or application layer
- Restrict access with firewall rules
Client Configuration for HTTP
Configure your MCP client to use HTTP transport:
{
"mcpServers": {
"zammad": {
"url": "http://localhost:8000/mcp/"
}
}
}
Security Considerations
- Local Development: Use
MCP_HOST=127.0.0.1(localhost only) - Production: Implement authentication (see Security)
- HTTPS: Use reverse proxy for TLS
- Firewall: Restrict access to trusted networks
- DNS Rebinding: Built-in origin validation protects against these attacks
Examples
Search for Open Tickets
Use search_tickets with state="open" to find all open tickets
Create a Support Ticket
Use create_ticket with:
- title: "Customer needs help with login"
- group: "Support"
- customer: "customer@example.com"
- article_body: "Customer reported unable to login..."
Update and Respond to a Ticket
1. Use get_ticket with ticket_id=123 to see the full conversation
2. Use add_article to add your response
3. Use update_ticket to change state to "pending reminder"
Analyze Escalated Tickets
Use the escalation_summary prompt to get a report of all tickets approaching escalation
Upload Attachments to a Ticket
Use add_article with attachments parameter:
- ticket_id: 123
- body: "See attached documentation"
- attachments: [
{
"filename": "guide.pdf",
"data": "JVBERi0xLjQKJ...", # base64-encoded content
"mime_type": "application/pdf"
}
]
Delete an Attachment
Use delete_attachment with:
- ticket_id: 123
- article_id: 456
- attachment_id: 789
Development
Setup
Using Setup Scripts (Recommended)
# Clone the repository
git clone https://github.com/basher83/zammad-mcp.git
cd zammad-mcp
# Run the setup script
# On macOS/Linux:
./setup.sh
# On Windows (PowerShell):
.\setup.ps1
Manual Setup
# Clone the repository
git clone https://github.com/basher83/zammad-mcp.git
cd zammad-mcp
# Create a virtual environment with uv
uv venv
# Activate the virtual environment
# On macOS/Linux:
source .venv/bin/activate
# On Windows:
# .venv\Scripts\activate
# Install in development mode
uv pip install -e ".[dev]"
Project Structure
zammad-mcp/
├── mcp_zammad/
│ ├── __init__.py
│ ├── __main__.py
│ ├── server.py # MCP server implementation
│ ├── client.py # Zammad API client wrapper
│ └── models.py # Pydantic models
├── tests/
├── scripts/
│ └── uv/ # UV single-file scripts
├── pyproject.toml
├── README.md
├── Dockerfile
└── .env.example
Running Tests
# Install development dependencies
uv pip install -e ".[dev]"
# Run tests
uv run pytest
# Run with coverage
uv run pytest --cov=mcp_zammad
Code Quality
# Format code
uv run ruff format mcp_zammad tests
# Lint
uv run ruff check mcp_zammad tests
# Type checking
uv run mypy mcp_zammad
# Run all quality checks
./scripts/quality-check.sh
API Token Generation
To generate an API token in Zammad:
- Log into your Zammad instance
- Click on your avatar → Profile
- Navigate to "Token Access"
- Click "Create"
- Name your token (e.g., "MCP Server")
- Select appropriate permissions
- Copy the generated token
Troubleshooting
Connection Issues
- Verify your Zammad URL includes the protocol (https://)
- Check that your API token has the necessary permissions
- Ensure your Zammad instance is accessible from your network
- For self-signed/internal certs only: set
ZAMMAD_INSECURE=trueto bypass TLS verification
Authentication Errors
- Use API tokens over username/password
- Ensure tokens have permissions for the operations
- Check token expiration in Zammad settings
Rate Limiting
The server respects Zammad's rate limits. If you hit rate limits:
- Reduce request frequency
- Paginate large result sets
- Cache frequently accessed data
Security
The server implements multiple layers of protection following industry best practices.
Reporting Security Issues
⚠️ IMPORTANT: Do not create public GitHub issues for security vulnerabilities.
Report via GitHub Security Advisories (preferred) or see SECURITY.md.
Security Features
- ✅ Input Validation: Validates and sanitizes all user inputs (models.py)
- ✅ SSRF Protection: URL validation prevents server-side request forgery (client.py)
- ✅ XSS Prevention: Sanitizes HTML in all text fields (models.py)
- ✅ Secure Authentication: Prefers API tokens over passwords (client.py)
- ✅ Dependency Scanning: Dependabot detects vulnerabilities automatically
- ✅ Security Testing: CI runs Bandit, Safety, and pip-audit (security-scan.yml)
See SECURITY.md for complete documentation.
Contributing
See CONTRIBUTING.md for development setup, code standards, testing, and pull request guidelines.
License
AGPL-3.0-or-later — matches the Zammad project license.
Documentation
- ARCHITECTURE.md — Technical design
- SECURITY.md — Security policy
- CONTRIBUTING.md — Development guidelines
- CHANGELOG.md — Version history
Support
Trademark Notice
"Zammad" is a trademark of Zammad GmbH. This independent integration is not affiliated with or endorsed by Zammad GmbH or the Zammad Foundation. The name "Zammad" indicates compatibility with the Zammad ticket system.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。