Polarion ALM MCP Server
A Model Context Protocol (MCP) server for Polarion ALM (Application Lifecycle Management) integration. This server provides comprehensive tools for managing projects, work items, attachments, comments, linked work items, and other ALM operations through the Polarion REST API.
Features
- Project Management: List and retrieve project information with flexible field filtering
- Work Item Operations: Create, read, update, delete, and query work items with full relationship support
- Assignee Management: Add and retrieve work item assignees
- Attachment Handling: Upload, list, download, and remove attachments
- Comment System: Add, list, update, and remove comments with structured data support
- Linked Work Items: Create, update, delete, and query linked work items with role-based relationships
- Advanced Query Support: Comprehensive query parameters including pagination, field filtering, and includes
- Relationship Management: Detailed support for assignees, categories, linked revisions, votes, and watches
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
For security reasons, only personal access tokens are supported:
POLARION_ACCESS_TOKENor--access-token
Environment Variables
Create a .env file with the following variables:
POLARION_BASE_URL=your-alm-base-url
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 --access-token "your-token"
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
Available Tools (25 APIs)
Project Operations
get_projects- Get all projectsget_project- Get specific project information
Work Item Operations
get_all_work_items- Get all work items in a projectget_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 itemdownload_attachment- Download attachment content
Comment Operations
get_comments- Get work item commentsget_comment_details- Get specific comment detailsadd_comment- Add comment to work itemupdate_comment- Update specific commentremove_comment- Remove comment from work item
Linked Work Items Operations
create_linked_work_items- Create linked work itemsget_linked_work_items- Get all linked work itemsget_linked_work_item- Get specific linked work itemupdate_linked_work_item- Update specific linked work itemdelete_linked_work_items- Delete multiple linked work itemsdelete_linked_work_item- Delete specific linked work item
Query Parameters
Most API endpoints support comprehensive query parameters for filtering and pagination:
Field Filtering
Use fields parameter to specify which fields to return:
{
"fields": {
"workitems": "@basic",
"categories": "@all",
"workitem_comments": "@basic"
}
}
Available field types:
categories,collections,document_attachments,document_commentsdocument_parts,documents,enumerations,externallylinkedworkitemsfeatureselections,globalroles,icons,jobs,linkedoslcresourceslinkedworkitems,page_attachments,pages,plans,projectrolesprojects,projecttemplates,revisions,testparameter_definitionstestparameters,testrecord_attachments,testrecords,testrun_attachmentstestrun_comments,testruns,teststep_results,teststepresult_attachmentsteststeps,usergroups,users,workitem_approvals,workitem_attachmentsworkitem_comments,workitems,workrecords
Field values:
@basic- Basic set of fields@all- All available fields- Custom comma-separated field list
Pagination
{
"page_size": 50,
"page_number": 1
}
Additional Parameters
{
"include": "related_entities",
"revision": "revision_id"
}
Body Parameters
Work Item Creation/Update
{
"data": {
"type": "workitems",
"id": "WORK_ITEM_ID",
"attributes": {
"title": "Work Item Title",
"description": {
"type": "text/html",
"value": "<p>Description content</p>"
},
"dueDate": "2024-12-31",
"priority": "high",
"status": "open",
"severity": "major",
"hyperlinks": [
{
"role": "external_ref",
"title": "External Link",
"uri": "https://example.com"
}
]
},
"relationships": {
"assignee": {
"data": [
{
"id": "user123",
"type": "users"
}
]
},
"categories": {
"data": [
{
"id": "category456",
"type": "categories"
}
]
},
"linkedRevisions": {
"data": [
{
"id": "revision789",
"type": "revisions"
}
]
},
"votes": {
"data": [
{
"id": "user456",
"type": "users"
}
]
},
"watches": {
"data": [
{
"id": "user789",
"type": "users"
}
]
}
}
}
}
Comment Creation
{
"data": [
{
"type": "workitem_comments",
"attributes": {
"resolved": false,
"title": "Comment Title",
"text": {
"type": "text/html",
"value": "<p>Comment content</p>"
}
},
"relationships": {
"author": {
"data": {
"id": "user123",
"type": "users"
}
},
"parentComment": {
"data": {
"id": "parent_comment_id",
"type": "workitem_comments"
}
}
}
}
]
}
Comment Update
{
"data": {
"type": "workitem_comments",
"id": "comment_id",
"attributes": {
"resolved": true
}
}
}
Linked Work Items Creation
{
"data": [
{
"type": "linkedworkitems",
"attributes": {
"revision": "1.0",
"role": "relates_to",
"suspect": false
},
"relationships": {
"workItem": {
"data": {
"id": "target_work_item_id",
"type": "workitems"
}
}
}
}
]
}
Usage Examples
Basic Work Item Query with Field Filtering
{
"name": "get_all_work_items",
"arguments": {
"project_id": "PROJECT_ID",
"page_size": 25,
"page_number": 1,
"fields": {
"workitems": "@basic",
"categories": "@all"
},
"include": "assignee,categories"
}
}
Create Work Item with Relationships
{
"name": "create_work_item",
"arguments": {
"project_id": "PROJECT_ID",
"work_item_data": {
"data": {
"type": "workitems",
"attributes": {
"title": "New Feature Request",
"description": {
"type": "text/html",
"value": "<p>Feature description</p>"
},
"priority": "high"
},
"relationships": {
"assignee": {
"data": [
{
"id": "user123",
"type": "users"
}
]
}
}
}
}
}
}
Update Work Item with Complete Structure
{
"name": "update_work_item",
"arguments": {
"project_id": "PROJECT_ID",
"work_item_id": "WORK_ITEM_ID",
"data": {
"type": "workitems",
"id": "WORK_ITEM_ID",
"attributes": {
"status": "resolved",
"resolution": "fixed"
},
"relationships": {
"assignee": {
"data": [
{
"id": "new_assignee_id",
"type": "users"
}
]
}
}
}
}
}
Add Comment with Rich Structure
{
"name": "add_comment",
"arguments": {
"project_id": "PROJECT_ID",
"work_item_id": "WORK_ITEM_ID",
"data": [
{
"type": "workitem_comments",
"attributes": {
"resolved": false,
"title": "Review Comment",
"text": {
"type": "text/html",
"value": "<p>This needs more testing</p>"
}
},
"relationships": {
"author": {
"data": {
"id": "reviewer_user_id",
"type": "users"
}
}
}
}
]
}
}
Query Work Items with Advanced Filtering
{
"name": "query_work_items",
"arguments": {
"project_id": "PROJECT_ID",
"query": "type:task AND status:open AND assignee.id:user123"
}
}
Create Linked Work Items
{
"name": "create_linked_work_items",
"arguments": {
"project_id": "PROJECT_ID",
"work_item_id": "SOURCE_WORK_ITEM_ID",
"data": [
{
"type": "linkedworkitems",
"attributes": {
"role": "implements",
"suspect": false
},
"relationships": {
"workItem": {
"data": {
"id": "TARGET_WORK_ITEM_ID",
"type": "workitems"
}
}
}
}
]
}
}
Get Linked Work Items with Pagination
{
"name": "get_linked_work_items",
"arguments": {
"project_id": "PROJECT_ID",
"work_item_id": "WORK_ITEM_ID",
"page_size": 10,
"fields": {
"linkedworkitems": "@basic",
"workitems": "@all"
}
}
}
API Endpoints Supported
Based on the Polarion REST API specification, this server supports all 25 APIs:
Core APIs (10-18)
/projects- Project listing and details/projects/{projectId}/workitems- Work item operations/projects/{projectId}/workitems/{workItemId}- Individual work item operations
Management APIs (19-34)
/projects/{projectId}/workitems/{workItemId}/assignees- Assignee management/projects/{projectId}/workitems/{workItemId}/attachments- Attachment management/projects/{projectId}/workitems/{workItemId}/attachments/{attachmentId}/content- Attachment downloads/projects/{projectId}/workitems/{workItemId}/comments- Comment management/projects/{projectId}/workitems/{workItemId}/comments/{commentId}- Individual comment operations
Linked Work Items APIs (35-40)
/projects/{projectId}/workitems/{workItemId}/linkedworkitems- Linked work items management/projects/{projectId}/workitems/{workItemId}/linkedworkitems/{roleId}/{targetProjectId}/{linkedWorkItemId}- Individual linked work item operations
Authentication
The server uses personal access token authentication as required by Polarion:
- Authorization Header:
Bearer {personal_access_token}
Error Handling
The server includes comprehensive error handling:
- HTTP status code validation (401, 403, 404, etc.)
- Connection timeout handling
- JSON parsing error handling
- Missing environment variable validation
- Detailed error logging with truncated responses
Security Notes
- Only personal access tokens are supported for enhanced security
- Never commit credentials to version control
- Use environment variables or secure input prompts for sensitive data
- All authentication tokens are redacted in logs
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
Reference
Metadata
Release files for alm-mcp 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| alm_mcp-1.0.5.tar.gz | 12.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| alm_mcp-1.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.8 kB
Release files / alm_mcp-1.0.5.tar.gz
| Download URL | alm_mcp-1.0.5.tar.gz |
|---|---|
| Size | 12.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a2bb2b05695e22e7a7a2ee1cb39c7015c7d4b67772956d290ed6832a2511ace5
|
|
BLAKE2b-256 checksum How to use checksums |
d48f3dc527c39d28e900de6bf8181ea2c0acd4b87e606b71e71c12dae6b5def5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / alm_mcp-1.0.5-py3-none-any.whl
| Download URL | alm_mcp-1.0.5-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a05e31638ff619360aa9105579ba54fd6bf60ac2eec801b713306b8fdece0c3
|
|
BLAKE2b-256 checksum How to use checksums |
f9dd2813e1629f01f34f288414b0aba70300f70147a4efeb599bfb98612e74a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Security for alm-mcp 1.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.