@atoms-tech/polarion-mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,108 @@
1
+ # @atoms-tech/polarion-mcp
2
+
3
+ > Connect any AI IDE to Siemens Polarion ALM in under 2 minutes.
4
+
5
+ ## Prerequisites
6
+
7
+ 1. **Node.js ≥ 18** — [Download](https://nodejs.org/)
8
+ 2. **ATOMS API Key** — [Get one free at portal.atoms.tech](https://portal.atoms.tech)
9
+
10
+ ## Installation
11
+
12
+ ### Claude Code
13
+
14
+ ```bash
15
+ claude mcp add polarion-mcp \
16
+ --env ATOMS_API_KEY=atoms-sk-xxxx \
17
+ -- npx @atoms-tech/polarion-mcp@0.1.0
18
+ ```
19
+
20
+ ### Cursor / VS Code / Windsurf
21
+
22
+ Add to your MCP settings file (`.cursor/mcp.json`, `.vscode/mcp.json`, etc.):
23
+
24
+ ```json
25
+ {
26
+ "mcpServers": {
27
+ "polarion-mcp": {
28
+ "command": "npx",
29
+ "args": ["@atoms-tech/polarion-mcp@0.1.0"],
30
+ "env": {
31
+ "ATOMS_API_KEY": "atoms-sk-xxxx"
32
+ }
33
+ }
34
+ }
35
+ }
36
+ ```
37
+
38
+ ### Other IDEs
39
+
40
+ Add to your MCP configuration:
41
+
42
+ ```json
43
+ {
44
+ "mcpServers": {
45
+ "polarion-mcp": {
46
+ "command": "npx",
47
+ "args": ["@atoms-tech/polarion-mcp@0.1.0"],
48
+ "env": {
49
+ "ATOMS_API_KEY": "atoms-sk-xxxx"
50
+ }
51
+ }
52
+ }
53
+ }
54
+ ```
55
+
56
+ ## How It Works
57
+
58
+ 1. You register at [portal.atoms.tech](https://portal.atoms.tech) and enter your Polarion URL + Personal Access Token (PAT). These are stored securely server-side — never on your machine.
59
+ 2. You get an **ATOMS API Key** (`atoms-sk-xxxx`) — the only thing you put in your IDE config.
60
+ 3. This package starts a lightweight local MCP bridge and forwards requests to `https://mcp.polarion.atoms.tech/mcp`.
61
+ 4. The hosted ATOMS service validates your key, retrieves your Polarion credentials server-side, and executes the Polarion API call on your behalf.
62
+ 5. One credit is deducted per successful tool call. Failed calls cost nothing.
63
+
64
+ ## Available Tools
65
+
66
+ | Tool | Description |
67
+ |------|-------------|
68
+ | `check_connection` | Verify your Polarion connection is working |
69
+ | `list_projects` | List all accessible Polarion projects |
70
+ | `get_project` | Get details about a specific project |
71
+ | `search_workitems` | Search work items with Lucene queries |
72
+ | `get_workitem` | Get a work item by ID |
73
+ | `get_workitem_details` | Get full work item details including custom fields |
74
+ | `get_workitem_history` | Get work item revision history |
75
+ | `list_workitem_types` | List available work item types |
76
+ | `list_custom_fields` | List custom fields for a work item type |
77
+ | `list_spaces` | List document spaces in a project |
78
+ | `list_documents` | List documents in a space |
79
+ | `get_document_info` | Get document metadata |
80
+ | `get_document_outline` | Get document structure |
81
+ | `get_document_section` | Get a specific section |
82
+ | `search_in_document` | Search within a document |
83
+ | `get_workitems_in_module` | Get work items in a module/document |
84
+
85
+ ## Try It
86
+
87
+ After installation, prompt your AI assistant:
88
+
89
+ ```
90
+ Help me explore my Polarion project with check_connection.
91
+ ```
92
+
93
+ ## Plans & Credits
94
+
95
+ | Plan | Credits/month | Price |
96
+ |------|--------------|-------|
97
+ | Free | 150 | $0 |
98
+ | Starter | 1,500 | $19/mo |
99
+ | Standard | 6,000 | $69/mo |
100
+ | Enterprise | Unlimited | Custom |
101
+
102
+ Manage credits and billing at [portal.atoms.tech](https://portal.atoms.tech).
103
+
104
+ ## Support
105
+
106
+ - Docs: [docs.atoms.tech/polarion-mcp](https://docs.atoms.tech/polarion-mcp)
107
+ - Issues: [github.com/atoms-tech/polarion-mcp-server/issues](https://github.com/atoms-tech/polarion-mcp-server/issues)
108
+ - Email: support@atoms.tech
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @atoms-tech/polarion-mcp
4
+ *
5
+ * Entry point for `npx @atoms-tech/polarion-mcp@0.1.0`
6
+ *
7
+ * This script:
8
+ * 1. Validates prerequisites (Node.js + ATOMS_API_KEY env var)
9
+ * 2. Starts a local stdio MCP bridge
10
+ * 3. Forwards MCP requests to the hosted ATOMS Polarion MCP endpoint
11
+ *
12
+ * No Polarion credentials are stored locally. The hosted ATOMS service resolves
13
+ * Polarion credentials server-side after validating the ATOMS API key.
14
+ *
15
+ * Environment variables:
16
+ * ATOMS_API_KEY (required) Your ATOMS API key from portal.atoms.tech
17
+ * ATOMS_MCP_URL (optional) Override hosted MCP URL for dev/staging
18
+ */
19
+
20
+ "use strict";
21
+
22
+ const { runBridge } = require("../lib/bridge");
23
+ const { checkPrerequisites } = require("../lib/prereqs");
24
+
25
+ async function main() {
26
+ // ── 1. Check prerequisites ──────────────────────────────────────────────
27
+ const precheck = checkPrerequisites();
28
+ if (!precheck.ok) {
29
+ process.stderr.write(`\n❌ ATOMS Polarion MCP — prerequisite check failed:\n`);
30
+ for (const err of precheck.errors) {
31
+ process.stderr.write(` • ${err}\n`);
32
+ }
33
+ process.stderr.write(`\nSee https://docs.atoms.tech/polarion-mcp/installation for help.\n\n`);
34
+ process.exit(1);
35
+ }
36
+
37
+ await runBridge({ apiKey: process.env.ATOMS_API_KEY.trim() });
38
+ }
39
+
40
+ main().catch((err) => {
41
+ process.stderr.write(`\n❌ Failed to start ATOMS Polarion MCP: ${err.message}\n`);
42
+ process.stderr.write(
43
+ " Check your ATOMS_API_KEY, internet connection, and https://mcp.polarion.atoms.tech/health\n\n"
44
+ );
45
+ process.exit(1);
46
+ });
package/lib/bridge.js ADDED
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+
3
+ const { Client } = require("@modelcontextprotocol/sdk/client/index.js");
4
+ const {
5
+ StreamableHTTPClientTransport,
6
+ } = require("@modelcontextprotocol/sdk/client/streamableHttp.js");
7
+ const { Server } = require("@modelcontextprotocol/sdk/server/index.js");
8
+ const { StdioServerTransport } = require("@modelcontextprotocol/sdk/server/stdio.js");
9
+ const {
10
+ CallToolRequestSchema,
11
+ CompleteRequestSchema,
12
+ GetPromptRequestSchema,
13
+ ListPromptsRequestSchema,
14
+ ListResourceTemplatesRequestSchema,
15
+ ListResourcesRequestSchema,
16
+ ListToolsRequestSchema,
17
+ ReadResourceRequestSchema,
18
+ SubscribeRequestSchema,
19
+ UnsubscribeRequestSchema,
20
+ } = require("@modelcontextprotocol/sdk/types.js");
21
+
22
+ const DEFAULT_REMOTE_URL = "https://mcp.polarion.atoms.tech/mcp";
23
+ const DEFAULT_REQUEST_TIMEOUT_MS = 15 * 60 * 1000;
24
+
25
+ function getRemoteUrl() {
26
+ return (process.env.ATOMS_MCP_URL || DEFAULT_REMOTE_URL).trim();
27
+ }
28
+
29
+ function getRequestTimeoutMs() {
30
+ const raw = process.env.ATOMS_MCP_TIMEOUT_MS || String(DEFAULT_REQUEST_TIMEOUT_MS);
31
+ const parsed = Number.parseInt(raw, 10);
32
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_REQUEST_TIMEOUT_MS;
33
+ }
34
+
35
+ function buildRemoteHeaders(apiKey) {
36
+ return {
37
+ Authorization: `Bearer ${apiKey}`,
38
+ };
39
+ }
40
+
41
+ function buildLocalCapabilities(remoteCapabilities = {}) {
42
+ const capabilities = {};
43
+
44
+ if (remoteCapabilities.tools) {
45
+ capabilities.tools = {};
46
+ }
47
+ if (remoteCapabilities.prompts) {
48
+ capabilities.prompts = {};
49
+ }
50
+ if (remoteCapabilities.resources) {
51
+ capabilities.resources = {
52
+ subscribe: Boolean(remoteCapabilities.resources.subscribe),
53
+ };
54
+ }
55
+ if (remoteCapabilities.completions) {
56
+ capabilities.completions = {};
57
+ }
58
+
59
+ return capabilities;
60
+ }
61
+
62
+ async function connectRemoteClient({ apiKey, remoteUrl }) {
63
+ const client = new Client({
64
+ name: "atoms-polarion-mcp-local-bridge",
65
+ version: "0.1.0",
66
+ });
67
+
68
+ const transport = new StreamableHTTPClientTransport(new URL(remoteUrl), {
69
+ requestInit: {
70
+ headers: buildRemoteHeaders(apiKey),
71
+ },
72
+ });
73
+
74
+ await client.connect(transport, { timeout: getRequestTimeoutMs() });
75
+ return { client, transport };
76
+ }
77
+
78
+ function registerForwardingHandlers(server, remoteClient, capabilities) {
79
+ const requestOptions = () => ({ timeout: getRequestTimeoutMs() });
80
+
81
+ if (capabilities.tools) {
82
+ server.setRequestHandler(ListToolsRequestSchema, request =>
83
+ remoteClient.listTools(request.params, requestOptions())
84
+ );
85
+ server.setRequestHandler(CallToolRequestSchema, request =>
86
+ remoteClient.callTool(request.params, undefined, requestOptions())
87
+ );
88
+ }
89
+
90
+ if (capabilities.prompts) {
91
+ server.setRequestHandler(ListPromptsRequestSchema, request =>
92
+ remoteClient.listPrompts(request.params, requestOptions())
93
+ );
94
+ server.setRequestHandler(GetPromptRequestSchema, request =>
95
+ remoteClient.getPrompt(request.params, requestOptions())
96
+ );
97
+ }
98
+
99
+ if (capabilities.resources) {
100
+ server.setRequestHandler(ListResourcesRequestSchema, request =>
101
+ remoteClient.listResources(request.params, requestOptions())
102
+ );
103
+ server.setRequestHandler(ListResourceTemplatesRequestSchema, request =>
104
+ remoteClient.listResourceTemplates(request.params, requestOptions())
105
+ );
106
+ server.setRequestHandler(ReadResourceRequestSchema, request =>
107
+ remoteClient.readResource(request.params, requestOptions())
108
+ );
109
+
110
+ if (capabilities.resources.subscribe) {
111
+ server.setRequestHandler(SubscribeRequestSchema, request =>
112
+ remoteClient.subscribeResource(request.params, requestOptions())
113
+ );
114
+ server.setRequestHandler(UnsubscribeRequestSchema, request =>
115
+ remoteClient.unsubscribeResource(request.params, requestOptions())
116
+ );
117
+ }
118
+ }
119
+
120
+ if (capabilities.completions) {
121
+ server.setRequestHandler(CompleteRequestSchema, request =>
122
+ remoteClient.complete(request.params, requestOptions())
123
+ );
124
+ }
125
+ }
126
+
127
+ async function runBridge({ apiKey, remoteUrl = getRemoteUrl() }) {
128
+ process.stderr.write(`Connecting to ATOMS Polarion MCP at ${remoteUrl}\n`);
129
+
130
+ const { client: remoteClient, transport: remoteTransport } = await connectRemoteClient({
131
+ apiKey,
132
+ remoteUrl,
133
+ });
134
+
135
+ const capabilities = buildLocalCapabilities(remoteClient.getServerCapabilities());
136
+ const server = new Server(
137
+ {
138
+ name: "atoms-polarion-mcp",
139
+ version: "0.1.0",
140
+ },
141
+ {
142
+ capabilities,
143
+ instructions:
144
+ "Local bridge for ATOMS Polarion MCP. Tools run through the hosted ATOMS Polarion service.",
145
+ }
146
+ );
147
+
148
+ registerForwardingHandlers(server, remoteClient, capabilities);
149
+
150
+ const stdioTransport = new StdioServerTransport();
151
+ const close = async () => {
152
+ await Promise.allSettled([stdioTransport.close(), remoteTransport.close()]);
153
+ };
154
+
155
+ for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
156
+ process.once(signal, () => {
157
+ close().finally(() => process.exit(0));
158
+ });
159
+ }
160
+
161
+ await server.connect(stdioTransport);
162
+ process.stderr.write("ATOMS Polarion MCP local bridge is running.\n");
163
+ }
164
+
165
+ module.exports = {
166
+ DEFAULT_REMOTE_URL,
167
+ buildLocalCapabilities,
168
+ buildRemoteHeaders,
169
+ getRemoteUrl,
170
+ getRequestTimeoutMs,
171
+ registerForwardingHandlers,
172
+ runBridge,
173
+ };
package/lib/prereqs.js ADDED
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Prerequisite checks run before starting the MCP server.
5
+ *
6
+ * @returns {{ ok: boolean, errors: string[] }}
7
+ */
8
+ function checkPrerequisites() {
9
+ const errors = [];
10
+
11
+ // ATOMS_API_KEY is the only env var required from the user
12
+ const apiKey = process.env.ATOMS_API_KEY;
13
+ if (!apiKey) {
14
+ errors.push(
15
+ "ATOMS_API_KEY environment variable is not set.\n" +
16
+ " Get your API key at https://portal.atoms.tech → Settings → API Keys"
17
+ );
18
+ } else if (!apiKey.startsWith("atoms-sk-")) {
19
+ errors.push(
20
+ `ATOMS_API_KEY looks invalid (expected format: atoms-sk-xxxx, got: ${apiKey.slice(0, 12)}...)\n` +
21
+ " Generate a new key at https://portal.atoms.tech → Settings → API Keys"
22
+ );
23
+ }
24
+
25
+ return {
26
+ ok: errors.length === 0,
27
+ errors,
28
+ };
29
+ }
30
+
31
+ module.exports = { checkPrerequisites };
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@atoms-tech/polarion-mcp",
3
+ "version": "0.1.0",
4
+ "description": "ATOMS Polarion MCP Server — connect any AI IDE to Siemens Polarion ALM in seconds",
5
+ "keywords": [
6
+ "mcp",
7
+ "model-context-protocol",
8
+ "polarion",
9
+ "siemens",
10
+ "alm",
11
+ "requirements",
12
+ "atoms"
13
+ ],
14
+ "homepage": "https://atoms.tech/polarion-mcp",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/atoms-tech/polarion-mcp-server.git",
18
+ "directory": "packages/polarion-mcp-npm"
19
+ },
20
+ "license": "SEE LICENSE IN LICENSE",
21
+ "author": "ATOMS.tech <hello@atoms.tech>",
22
+ "bin": {
23
+ "polarion-mcp": "./bin/polarion-mcp.js"
24
+ },
25
+ "files": [
26
+ "bin/",
27
+ "lib/",
28
+ "README.md"
29
+ ],
30
+ "scripts": {
31
+ "prepublishOnly": "npm test",
32
+ "test": "node test/smoke.js"
33
+ },
34
+ "engines": {
35
+ "node": ">=18"
36
+ },
37
+ "dependencies": {
38
+ "@modelcontextprotocol/sdk": "^1.29.0",
39
+ "zod": "^3.25.76"
40
+ },
41
+ "publishConfig": {
42
+ "access": "public",
43
+ "registry": "https://registry.npmjs.org"
44
+ }
45
+ }