Polarion ALM MCP Server
Project description
Polarion ALM MCP Server
A Model Context Protocol (MCP) server for Polarion ALM (Application Lifecycle Management) integration. This server provides tools for managing projects, work items, attachments, comments, and other ALM operations through the Polarion REST API.
Features
- Project Management: List and retrieve project information
- Work Item Operations: Create, read, update, delete, and query work items
- Assignee Management: Add and retrieve work item assignees
- Attachment Handling: Upload, list, and remove attachments
- Comment System: Add, list, and remove comments
- Link Role Management: Manage work item relationships
- Watcher Management: Add and remove watchers for work items
Installation
Option 1: Local Development Setup
- Clone this repository:
git clone <repository-url>
cd alm-mcp
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables (optional):
cp .env.example .env
# Edit .env with your Polarion credentials
Option 2: Package Installation (Future)
# For future package distribution
uvx alm-mcp
# or
pip install alm-mcp
Configuration
The MCP server supports multiple configuration methods with the following priority:
- Command line arguments (highest priority)
- Environment variables (lower priority)
Authentication Methods
The server supports three authentication methods:
-
Access Token (recommended):
POLARION_ACCESS_TOKENor--access-token
-
Username + Password:
POLARION_USERNAME+POLARION_PASSWORDor--username+--password
-
API Key only (limited functionality):
POLARION_API_KEYor--api-key
Environment Variables
Create a .env file with the following variables:
POLARION_BASE_URL=your-alm-base-url
POLARION_API_KEY=your-api-key-here
POLARION_USERNAME=your-username
POLARION_PASSWORD=your-password
POLARION_ACCESS_TOKEN=your-access-token
Usage
Running the Server Directly
# Using environment variables
python main.py
# Using command line arguments
python main.py --base-url "your-alm-base-url" --access-token "your-token"
# Mixed approach (args override env vars)
python main.py --password "your-password"
VS Code Integration with GitHub Copilot
Setup Steps
-
Install GitHub Copilot Extension in VS Code
-
Create MCP Configuration: Add the following to your project's
.vscode/mcp.json:
{
"mcpServers": {
"alm-mcp-server": {
"command": "python",
"args": ["/absolute/path/to/alm-mcp/main.py"],
"env": {
"POLARION_BASE_URL": "your-alm-base-url",
"POLARION_ACCESS_TOKEN": "${input:alm_access_token}"
},
"type": "stdio"
}
},
"inputs": [
{
"type": "promptString",
"id": "alm_access_token",
"description": "ALM Access Token",
"password": true
}
]
}
-
Update File Paths: Replace
/absolute/path/to/alm-mcp/main.pywith the actual path to yourmain.pyfile -
Restart VS Code to load the MCP server configuration
Alternative Configuration Methods
The mcp-config-examples/ directory contains several configuration templates:
direct-python.json: Direct Python execution with environment variablescommand-line-args.json: Using command line arguments instead of env varsuvx-package.json: For future package installation via uvx
Configuration Priority
When both environment variables and command line arguments are provided:
- Command line arguments take precedence
- Environment variables are used as fallback
- VS Code will prompt for sensitive values using the
inputsconfiguration
Security Notes
- Use
${input:variable_name}for sensitive values to prompt user input - Set
"password": truein inputs for password fields - Never commit actual credentials to version control
Available Tools
Project Operations
get_projects- Get all projectsget_project- Get specific project information
Work Item Operations
get_work_item- Get specific work itemcreate_work_item- Create new work itemupdate_work_item- Update existing work itemdelete_work_item- Delete work itemquery_work_items- Query work items using Lucene syntax
Assignee Operations
get_assignees- Get work item assigneesadd_assignee- Add assignee to work item
Attachment Operations
get_attachments- Get work item attachmentsadd_attachment- Add attachment to work itemremove_attachment- Remove attachment from work item
Comment Operations
get_comments- Get work item commentsadd_comment- Add comment to work itemremove_comment- Remove comment from work item
Example Tool Usage
Query Work Items
{
"name": "query_work_items",
"arguments": {
"project_id": "PROJECT_ID",
"query": "type:task AND status:open"
}
}
Create Work Item
{
"name": "create_work_item",
"arguments": {
"project_id": "PROJECT_ID",
"work_item_data": {
"title": "New Task",
"type": "task",
"description": "Task description"
}
}
}
Add Comment
{
"name": "add_comment",
"arguments": {
"project_id": "PROJECT_ID",
"work_item_id": "WORK_ITEM_ID",
"comment_data": {
"text": "This is a comment"
}
}
}
API Endpoints Supported
Based on the Polarion REST API specification:
/projects- Project listing and details/workitems/{projectId}- Work item operations/workitems/{projectId}/query- Work item queries/workitems/{projectId}/{workItemId}/assignees- Assignee management/workitems/{projectId}/{workItemId}/attachments- Attachment management/workitems/{projectId}/{workItemId}/link-roles- Link role management/workitems/{projectId}/{workItemId}/watchers- Watcher management/workitems/{projectId}/{workItemId}/comments- Comment management
Authentication
The server uses the following authentication methods as required by Polarion:
- API Key: Sent via
x-apikeyheader - Basic Authentication: Username/password combination
Error Handling
The server includes comprehensive error handling:
- HTTP status code validation
- Connection timeout handling
- JSON parsing error handling
- Missing environment variable validation
- Detailed error logging
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
[MIT License. Copyright (c) 2025 hy74.hwang@gmail.com]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alm_mcp-1.0.1.tar.gz.
File metadata
- Download URL: alm_mcp-1.0.1.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b294f5f1d9755c31a2766591647655def34dea0750d5bd58e592382cf17bc1da
|
|
| MD5 |
a1549a4fea58ad204d6a0a8ef476d88e
|
|
| BLAKE2b-256 |
8424360997637d6f83c4262fd43d0b9ca40a394e9ff1a2d9b6507a9f1675467c
|
File details
Details for the file alm_mcp-1.0.1-py3-none-any.whl.
File metadata
- Download URL: alm_mcp-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5e58b541a308f4d3b28102c424debf6956dd70a97912573bd17a3ab1b397743
|
|
| MD5 |
58b151ee03def91e85951f6d4aa0b62c
|
|
| BLAKE2b-256 |
d407a12667820ace17d7c5eb989499c1dc249cd6340bbcbf273628bedaf83ecd
|