polarion-mcp-server

saggl/polarion-mcp-server

3.2

If you are the rightful owner of polarion-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Polarion MCP Server is a Model Context Protocol server designed to facilitate interaction between AI assistants and Polarion ALM, enabling seamless management of requirements, work items, projects, and documents.

Tools
5
Resources
0
Prompts
0

Polarion MCP Server

A Model Context Protocol (MCP) server for Polarion ALM, enabling AI assistants to interact with Polarion requirements, work items, projects, and documents.

Features

Work Items

  • Get Work Item: Retrieve detailed information about specific work items
  • Create Work Item: Create new requirements, tasks, defects, test cases, etc.
  • Update Work Item: Modify existing work items (title, description, status, priority, etc.)
  • Delete Work Item: Remove work items from Polarion
  • Search Work Items: Find work items using flexible filters (type, status, assignee, custom queries)

Projects & Spaces

  • Get Project: Retrieve project details
  • List Projects: View all accessible projects
  • Get Space: Get information about a specific space
  • List Spaces: List all spaces within a project

Documents

  • Get Document: Retrieve document details and content
  • List Documents: List all documents in a space

Installation

Prerequisites

  • Node.js 18.0.0 or higher
  • A Polarion ALM instance
  • Polarion API credentials (username/password or access token)

Setup

  1. Clone or download this repository:
cd polarion-mcp-server
  1. Install dependencies:
npm install
  1. Create a .env file with your Polarion credentials:
cp .env.example .env
  1. Edit .env and add your Polarion configuration:
POLARION_URL=https://your-polarion-instance.com
POLARION_ACCESS_TOKEN=your-access-token
# Or use username/password
# POLARION_USERNAME=your-username
# POLARION_PASSWORD=your-password

# Optional: Set a default project
POLARION_DEFAULT_PROJECT=PROJECT_ID
  1. Build the server:
npm run build

Usage

With Claude Desktop

Add this configuration to your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "polarion": {
      "command": "npx",
      "args": ["-y", "/absolute/path/to/polarion-mcp-server"],
      "env": {
        "POLARION_URL": "https://your-polarion-instance.com",
        "POLARION_ACCESS_TOKEN": "your-access-token"
      }
    }
  }
}

With Other MCP Clients

Run the server directly:

npm start

Or use it programmatically with the MCP SDK:

import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';

const transport = new StdioClientTransport({
  command: 'node',
  args: ['path/to/polarion-mcp-server/build/index.js'],
  env: {
    POLARION_URL: 'https://your-polarion-instance.com',
    POLARION_ACCESS_TOKEN: 'your-access-token',
  },
});

const client = new Client({
  name: 'my-client',
  version: '1.0.0',
}, {
  capabilities: {},
});

await client.connect(transport);

Available Tools

Work Item Tools

polarion_get_workitem

Get detailed information about a specific work item.

Parameters:

  • project_id (required): Project ID
  • workitem_id (required): Work item ID (e.g., "PROJ-123")
polarion_create_workitem

Create a new work item.

Parameters:

  • project (required): Project ID
  • title (required): Work item title
  • type (required): Work item type (e.g., "requirement", "task", "defect")
  • description (optional): HTML description
  • status (optional): Initial status
  • priority (optional): Priority level
  • severity (optional): Severity level (for defects)
  • assignee (optional): Array of user IDs
polarion_update_workitem

Update an existing work item.

Parameters:

  • project_id (required): Project ID
  • workitem_id (required): Work item ID
  • title (optional): New title
  • description (optional): New description
  • status (optional): New status
  • priority (optional): New priority
  • severity (optional): New severity
  • assignee (optional): New assignees
polarion_delete_workitem

Delete a work item.

Parameters:

  • project_id (required): Project ID
  • workitem_id (required): Work item ID
polarion_search_workitems

Search for work items with filters.

Parameters:

  • project (optional): Project ID
  • type (optional): Filter by work item type
  • status (optional): Filter by status
  • assignee (optional): Filter by assignee
  • author (optional): Filter by author
  • query (optional): Custom Lucene query
  • max_results (optional): Maximum results (default: 100)

Project & Space Tools

polarion_get_project

Get project details.

Parameters:

  • project_id (required): Project ID
polarion_list_projects

List all accessible projects.

Parameters: None

polarion_get_space

Get space details.

Parameters:

  • project_id (required): Project ID
  • space_id (required): Space ID
polarion_list_spaces

List all spaces in a project.

Parameters:

  • project_id (required): Project ID

Document Tools

polarion_get_document

Get document details.

Parameters:

  • project_id (required): Project ID
  • space_id (required): Space ID
  • document_name (required): Document name/ID
polarion_list_documents

List documents in a space.

Parameters:

  • project_id (required): Project ID
  • space_id (required): Space ID

Example Prompts for Claude

Once configured with Claude Desktop, you can use prompts like:

  • "Show me all open requirements in project PROJECT_A"
  • "Create a new defect in PROJECT_B with title 'Login button not working' and high priority"
  • "Update work item PROJ-123 to set status to 'resolved'"
  • "List all projects I have access to"
  • "Get the details of document 'Requirements_Spec' in space 'Documentation'"
  • "Search for all critical defects assigned to user john.doe"

Development

Building

npm run build

Watch Mode

npm run watch

Running Locally

npm run dev

Authentication

This server supports two authentication methods:

  1. Access Token (Recommended):

    POLARION_ACCESS_TOKEN=your-token
    
  2. Username/Password:

    POLARION_USERNAME=your-username
    POLARION_PASSWORD=your-password
    

Access tokens are more secure and are recommended for production use. You can generate an access token in your Polarion user settings.

API Compatibility

This server is designed to work with Polarion's REST API v1. It has been tested with Polarion versions 2023.x and newer. Older versions may require modifications to the API endpoints.

Troubleshooting

Authentication Errors

  • Verify your credentials in the .env file
  • Ensure your Polarion instance URL is correct (no trailing slash)
  • Check that your user has appropriate permissions

Connection Issues

  • Verify network connectivity to your Polarion instance
  • Check if your Polarion instance requires VPN access
  • Ensure the REST API is enabled on your Polarion instance

Tool Not Found Errors

  • Restart Claude Desktop after configuration changes
  • Verify the path to index.js is absolute
  • Check that the build was successful

License

MIT

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

Resources