loading…
Search for a command to run...
loading…
Enables AI assistants to create, search, and manage OTRS tickets and configuration items via the OTRS API.
Enables AI assistants to create, search, and manage OTRS tickets and configuration items via the OTRS API.
A Model Context Protocol (MCP) server for OTRS (Open Ticket Request System) API integration.
This provides access to OTRS ticket management, configuration items, and other OTRS functionality through standardized MCP interfaces, allowing AI assistants to create, search, and manage tickets and configuration items.
The list of tools is configurable, so you can choose which tools you want to make available to the MCP client.
Before using this MCP server, you need to configure your OTRS instance:
https://your-otrs-server/otrs/index.pl?Action=AdminYour webservice URL should look like:
https://your-otrs-server/otrs/nph-genericinterface.pl/Webservice/YourWebserviceName
Make sure your OTRS user has appropriate permissions for:
The easiest way to run otrs-mcp with Claude Desktop is using Docker. If you don't have Docker installed, you can get it from Docker's official website.
You can use the pre-built Docker image from GitHub Container Registry:
{
"mcpServers": {
"otrs": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"OTRS_BASE_URL=https://your-otrs-server/otrs/nph-genericinterface.pl/Webservice/TestInterface",
"-e",
"OTRS_USERNAME=your-username",
"-e",
"OTRS_PASSWORD=your-password",
"-e",
"OTRS_VERIFY_SSL=false",
"-e",
"OTRS_DEFAULT_QUEUE=Raw",
"-e",
"OTRS_DEFAULT_STATE=new",
"-e",
"OTRS_DEFAULT_PRIORITY=3 normal",
"ghcr.io/yourusername/otrs-mcp-server:latest"
]
}
}
}
If you prefer to build the image locally:
# Clone the repository
git clone https://github.com/yourusername/otrs-mcp-server.git
cd otrs-mcp-server
# Build the Docker image
docker build -t otrs-mcp-server .
# Run the container
docker run --rm -i \
-e OTRS_BASE_URL="https://your-otrs-server/otrs/nph-genericinterface.pl/Webservice/TestInterface" \
-e OTRS_USERNAME="your-username" \
-e OTRS_PASSWORD="your-password" \
-e OTRS_VERIFY_SSL="false" \
otrs-mcp-server
Alternatively, you can run the server directly using UV. First, set your environment variables:
export OTRS_BASE_URL="https://your-otrs-server/otrs/nph-genericinterface.pl/Webservice/TestInterface"
export OTRS_USERNAME="your-username"
export OTRS_PASSWORD="your-password"
export OTRS_VERIFY_SSL="false"
export OTRS_DEFAULT_QUEUE="Raw"
export OTRS_DEFAULT_STATE="new"
export OTRS_DEFAULT_PRIORITY="3 normal"
export OTRS_DEFAULT_TYPE="Unclassified"
Then edit your Claude Desktop config file and add the server configuration:
{
"mcpServers": {
"otrs": {
"command": "uv",
"args": [
"--directory",
"<full path to otrs-mcp-server directory>",
"run",
"src/otrs_mcp/main.py"
],
"env": {
"OTRS_BASE_URL": "https://your-otrs-server/otrs/nph-genericinterface.pl/Webservice/TestInterface",
"OTRS_USERNAME": "your-username",
"OTRS_PASSWORD": "your-password",
"OTRS_VERIFY_SSL": "false"
}
}
}
}
Note: if you see
Error: spawn uv ENOENTin Claude Desktop, you may need to specify the full path touvor set the environment variableNO_UV=1in the configuration.
| Variable | Required | Default | Description |
|---|---|---|---|
OTRS_BASE_URL |
✅ | - | Base URL for OTRS webservice |
OTRS_USERNAME |
✅ | - | OTRS username |
OTRS_PASSWORD |
✅ | - | OTRS password |
OTRS_VERIFY_SSL |
❌ | false |
Enable SSL certificate verification |
OTRS_DEFAULT_QUEUE |
❌ | Raw |
Default queue for new tickets |
OTRS_DEFAULT_STATE |
❌ | new |
Default state for new tickets |
OTRS_DEFAULT_PRIORITY |
❌ | 3 normal |
Default priority for new tickets |
OTRS_DEFAULT_TYPE |
❌ | Unclassified |
Default type for new tickets |
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.
This project uses uv to manage dependencies. Install uv following the instructions for your platform:
curl -LsSf https://astral.sh/uv/install.sh | sh
You can then create a virtual environment and install the dependencies with:
uv venv
source .venv/bin/activate # On Unix/macOS
.venv\Scripts\activate # On Windows
uv pip install -e .
Test your OTRS connection and API functionality:
# Set environment variables
export OTRS_BASE_URL="https://your-otrs-server/otrs/nph-genericinterface.pl/Webservice/TestInterface"
export OTRS_USERNAME="your-username"
export OTRS_PASSWORD="your-password"
export OTRS_VERIFY_SSL="false"
# Run connectivity test
uv run python tests/connectivity_test.py
# Run API functionality test
uv run python tests/test_working_api.py
# Run debug diagnostics
uv run python tests/debug_test.py
The project includes test scripts that help verify your OTRS configuration and API connectivity.
Run the tests with pytest:
# Install development dependencies
uv pip install -e ".[dev]"
# Run the tests
pytest
# Run with coverage report
pytest --cov=src --cov-report=term-missing
To publish the Docker image to GitHub Container Registry for public use:
write:packages permissionCreate GitHub Personal Access Token:
write:packages and read:packages permissionsLogin to GitHub Container Registry:
echo $GITHUB_TOKEN | docker login ghcr.io -u yourusername --password-stdin
Build and Tag the Image:
# Build the image
docker build -t otrs-mcp-server .
# Tag for GitHub Container Registry
docker tag otrs-mcp-server ghcr.io/yourusername/otrs-mcp-server:latest
docker tag otrs-mcp-server ghcr.io/yourusername/otrs-mcp-server:v0.1.0
Push to Registry:
# Push latest tag
docker push ghcr.io/yourusername/otrs-mcp-server:latest
# Push version tag
docker push ghcr.io/yourusername/otrs-mcp-server:v0.1.0
Make Package Public (Optional):
Create .github/workflows/docker-publish.yml:
name: Build and Push Docker Image
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
To publish to Docker Hub instead:
# Login to Docker Hub
docker login
# Tag for Docker Hub
docker tag otrs-mcp-server yourusername/otrs-mcp-server:latest
docker tag otrs-mcp-server yourusername/otrs-mcp-server:v0.1.0
# Push to Docker Hub
docker push yourusername/otrs-mcp-server:latest
docker push yourusername/otrs-mcp-server:v0.1.0
Then update the Claude Desktop config to use:
"ghcr.io/yourusername/otrs-mcp-server:latest"
or
"yourusername/otrs-mcp-server:latest"
create_ticket - Create a new ticket in OTRSget_ticket - Get detailed information about a specific ticketsearch_tickets - Search for tickets based on various criteriaupdate_ticket - Update an existing ticket's propertiesget_ticket_history - Get the complete history of a ticketget_config_item - Get detailed information about a configuration itemsearch_config_items - Search for configuration itemscreate_session - Create a new OTRS session for authenticationotrs://ticket/{ticket_id} - Direct access to ticket dataotrs://ticket/{ticket_id}/history - Access to ticket historyotrs://search/tickets - Overview of recent ticketsotrs://configitem/{config_item_id} - Access to configuration item dataOTRS_VERIFY_SSL=false for self-signed certificatesRun the debug script to diagnose connection issues:
uv run python tests/debug_test.py
This will test both HTTP and HTTPS connections and provide detailed error information.
For reference, here's a working configuration example:
# Environment variables
export OTRS_BASE_URL="https://192.168.5.159/otrs/nph-genericinterface.pl/Webservice/TestInterface"
export OTRS_USERNAME="seasonpoon.admin"
export OTRS_PASSWORD="your-password"
export OTRS_VERIFY_SSL="false"
export OTRS_DEFAULT_QUEUE="Raw"
export OTRS_DEFAULT_STATE="new"
export OTRS_DEFAULT_PRIORITY="3 normal"
export OTRS_DEFAULT_TYPE="Unclassified"
Your OTRS webservice should include these operations:
| Operation Name | Controller | Description |
|---|---|---|
| SessionCreate | Session::SessionCreate | Create authentication sessions |
| TicketCreate | Ticket::TicketCreate | Create new tickets |
| TicketGet | Ticket::TicketGet | Retrieve ticket details |
| TicketSearch | Ticket::TicketSearch | Search for tickets |
| TicketUpdate | Ticket::TicketUpdate | Update existing tickets |
| TicketHistoryGet | Ticket::TicketHistoryGet | Get ticket history |
| ConfigItemGet | ConfigItem::ConfigItemGet | Retrieve configuration items |
| ConfigItemSearch | ConfigItem::ConfigItemSearch | Search configuration items |
MIT
Выполни в терминале:
claude mcp add otrs-mcp-server -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.