A Model Context Protocol server for providing read-only access to Polarion ALM.
Project description
Polarion MCP Server
A Model Context Protocol server for providing read-only access to Polarion ALM. This server enables LLMs to retrieve and analyze test data, work items, and project information from Polarion instances.
Installation
Using pip
pip install mcp-polarion
Configuration
Environment Variables
The MCP server requires three environment variables for Polarion authentication. You have two options:
Option 1: Using .env file (Recommended)
Create a .env file in your working directory:
POLARION_URL=https://your-polarion-instance.com/polarion
POLARION_USER=your-username
POLARION_TOKEN=your-access-token
Option 2: System Environment Variables
Set environment variables directly:
export POLARION_URL=https://your-polarion-instance.com/polarion
export POLARION_USER=your-username
export POLARION_TOKEN=your-access-token
Configure for Claude
Using pip installation
{
"mcpServers": {
"polarion": {
"command": "mcp-polarion",
"env": {
"POLARION_URL": "https://your-polarion-instance.com/polarion",
"POLARION_USER": "your-username",
"POLARION_TOKEN": "your-access-token"
}
}
}
}
Or if using a .env file, specify the working directory:
{
"mcpServers": {
"polarion": {
"command": "mcp-polarion",
"cwd": "/path/to/directory/with/env/file"
}
}
}
Configure for VS Code
Using pip installation
{
"mcp": {
"servers": {
"polarion": {
"command": "mcp-polarion",
"env": {
"POLARION_URL": "https://your-polarion-instance.com/polarion",
"POLARION_USER": "your-username",
"POLARION_TOKEN": "your-access-token"
}
}
}
}
}
Or if using a .env file, specify the working directory:
{
"mcp": {
"servers": {
"polarion": {
"command": "mcp-polarion",
"cwd": "/path/to/directory/with/env/file"
}
}
}
}
Configure for Cline (Development)
For development setup with local repository, you have two options:
Option 1: Using Python module (Recommended)
{
"mcpServers": {
"polarion": {
"command": "/path/to/your/PolarionMcp/.venv/bin/python",
"args": ["-m", "mcp_server"],
"cwd": "/path/to/your/PolarionMcp"
}
}
}
Option 2: Using installed command (after pip install -e .)
{
"mcpServers": {
"polarion": {
"command": "/path/to/your/PolarionMcp/.venv/bin/mcp-polarion",
"cwd": "/path/to/your/PolarionMcp"
}
}
}
Available Tools
-
get_project_info- Get information about a Polarion projectproject_id(string, required): The ID of the Polarion project
-
get_workitem- Get a specific work item from a Polarion projectproject_id(string, required): The ID of the Polarion projectworkitem_id(string, required): The ID of the work item to retrieve
-
search_workitems- Search for work items in a Polarion project using Lucene query syntaxproject_id(string, required): The ID of the Polarion projectquery(string, required): Lucene query string for searching work itemsfield_list(array, optional): Optional list of fields to return
-
get_test_runs- Get all test runs from a Polarion projectproject_id(string, required): The ID of the Polarion project
-
get_test_run- Get a specific test run from a Polarion projectproject_id(string, required): The ID of the Polarion projecttest_run_id(string, required): The ID of the test run to retrieve
-
get_documents- Get all documents from a Polarion projectproject_id(string, required): The ID of the Polarion project
-
get_test_specs_from_document- Get test specifications from a specific document in a Polarion projectproject_id(string, required): The ID of the Polarion projectdocument_id(string, required): The ID of the document to get test specs from
-
health_check- Check the health of the Polarion connection -
discover_work_item_types- Discover what work item types exist in a Polarion project by sampling work itemsproject_id(string, required): The ID of the Polarion projectlimit(integer, optional): Maximum number of work items to sample (default: 20)
Usage Examples
"Get project information for MyProject"
"Search for all requirements in MyProject"
"Find test runs with status 'passed' in MyProject"
"Get work item REQ-123 from MyProject"
Lucene Query Examples for Work Items
# Search by type
"type:requirement"
"type:testcase"
# Search by status
"status:open"
"status:closed"
# Search by text
"title:authentication"
"description:*login*"
# Combined searches
"type:requirement AND status:open"
"type:testcase AND title:*integration*"
Microsoft Copilot Studio Integration
This MCP server can be integrated with Microsoft Copilot Studio through a FastAPI HTTP wrapper, enabling your Copilot agents to access Polarion data via HTTP REST endpoints.
Quick Setup
-
Install HTTP server dependencies:
# Option 1: Install specific dependencies pip install fastapi uvicorn[standard] # Option 2: Install with HTTP extras pip install -e ".[http]"
-
Start HTTP Server:
# Development (HTTP) python -m mcp_server.http_server # Or using the installed command mcp-polarion-http
-
HTTPS setup for development:
# Generate SSL certificates ./scripts/generate_certs.sh # Start with HTTPS python -m mcp_server.http_server --https --cert certs/cert.pem --key certs/key.pem
-
Generate OpenAPI specification:
python scripts/generate_openapi.py
Available REST Endpoints
POST /tools/health_check- Check Polarion connection healthPOST /tools/get_project_info- Get project informationPOST /tools/search_workitems- Search work itemsPOST /tools/get_test_runs- Get test runsPOST /tools/discover_work_item_types- Discover work item typesGET /openapi.json- OpenAPI specification for Copilot Studio
Microsoft Copilot Studio Configuration
-
Import OpenAPI Specification:
- Generate specification:
python scripts/generate_openapi.py - Use the generated
openapi.jsonfile - Import as custom connector in Copilot Studio
- Set base URL to your HTTPS server endpoint
- Generate specification:
-
Required Settings:
- Authentication: Configure as needed for your environment
- HTTPS: Microsoft Copilot Studio requires HTTPS endpoints
- CORS: Enabled by default in the HTTP server
-
Example Agent Prompts:
"Get project information for MyProject" "Search for open requirements in MyProject" "Find all test runs with status failed" "Discover what work item types exist in MyProject" "Get work item REQ-123 details" "List all documents in MyProject"
Development
Running Tests
Install development dependencies and run tests:
pip install -e ".[dev]"
pytest
Security Notes
- This server provides read-only access to Polarion data
- Ensure your Polarion access token has minimal required permissions
- Deploy in secure environments and networks
- Review data exposure before deploying to production
- Consider using environment-specific configuration
Troubleshooting
Connection Issues
- Verify your
POLARION_URLis correct and accessible - Check that your
POLARION_USERandPOLARION_TOKENare valid - Ensure your Polarion instance supports the required API endpoints
- Test connectivity using the
health_checktool
Test Run Queries
The get_test_runs tool searches for work items with type verificationTest, which is the standard type for test cases/test runs in many Polarion instances. If your Polarion instance uses a different type name for test runs, you can:
- Use the
discover_work_item_typestool to find all available types in your project - Use the
search_workitemstool with a custom query liketype:your-test-type - Contact your Polarion administrator for the appropriate type name
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
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 mcp_polarion-0.1.0.tar.gz.
File metadata
- Download URL: mcp_polarion-0.1.0.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e60bed5144fcec8530f32f927c76927a94401bc5b75efce234c02e9b41d8c37b
|
|
| MD5 |
d9bc7cac431df22b0dee519b9a93645b
|
|
| BLAKE2b-256 |
9101cc51627c90afc10dea24e7e9bba37c7736e67a34ae0db4865207e3276fc2
|
File details
Details for the file mcp_polarion-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_polarion-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a45ec91014f7400d4e88317778077d28ba1f48931e87ecbb7748fbc6cd49b4cd
|
|
| MD5 |
922509aee6b2e5aa67f9bf3dbf30044d
|
|
| BLAKE2b-256 |
0d58f6760696dec87defe1d0e0ff20083a868883606bec229093650d0490f301
|