@atoms-tech/atoms-mcp 0.1.0 → 0.2.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 +136 -0
- package/dist/auth/login.d.ts +6 -4
- package/dist/auth/login.d.ts.map +1 -1
- package/dist/auth/login.js +187 -19
- package/dist/auth/login.js.map +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/server.js +126 -0
- package/dist/server.js.map +1 -1
- package/dist/tools/bulk-import.d.ts +70 -0
- package/dist/tools/bulk-import.d.ts.map +1 -0
- package/dist/tools/bulk-import.js +188 -0
- package/dist/tools/bulk-import.js.map +1 -0
- package/dist/tools/project-summary.d.ts +64 -0
- package/dist/tools/project-summary.d.ts.map +1 -0
- package/dist/tools/project-summary.js +170 -0
- package/dist/tools/project-summary.js.map +1 -0
- package/dist/tools/trace.d.ts +53 -0
- package/dist/tools/trace.d.ts.map +1 -0
- package/dist/tools/trace.js +166 -0
- package/dist/tools/trace.js.map +1 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# @atoms-tech/atoms-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for [ATOMS.tech](https://atoms.tech) — connect AI agents to your requirements management workspace.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@atoms-tech/atoms-mcp)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Quick Start
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
# 1. Login to your ATOMS account
|
|
12
|
+
npx @atoms-tech/atoms-mcp login
|
|
13
|
+
|
|
14
|
+
# 2. Add to Claude Code
|
|
15
|
+
claude mcp add atoms-mcp -- npx @atoms-tech/atoms-mcp
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
That's it. Claude can now read, create, and manage requirements in your ATOMS projects.
|
|
19
|
+
|
|
20
|
+
## What It Does
|
|
21
|
+
|
|
22
|
+
ATOMS MCP gives AI agents direct access to your requirements, test cases, and traceability data through the [Model Context Protocol](https://modelcontextprotocol.io). Agents can:
|
|
23
|
+
|
|
24
|
+
- Browse projects, search requirements, and inspect items
|
|
25
|
+
- Create and update requirements, test cases, and notes
|
|
26
|
+
- Bulk import 100 items at a time
|
|
27
|
+
- Link items with parent/child and verification relationships
|
|
28
|
+
- Record test results and check coverage gaps
|
|
29
|
+
- Export traceability diagrams as Mermaid graphs
|
|
30
|
+
|
|
31
|
+
Every action is logged with AI actor attribution (`mcp_claude`) and enforces your organization's role-based permissions.
|
|
32
|
+
|
|
33
|
+
## Available Tools
|
|
34
|
+
|
|
35
|
+
| Tool | Description | Access |
|
|
36
|
+
|------|-------------|--------|
|
|
37
|
+
| `atoms_list_projects` | List all accessible projects | Read |
|
|
38
|
+
| `atoms_list_items` | Browse items with type/domain/level filters | Read |
|
|
39
|
+
| `atoms_get_item` | Get full item details with relationships | Read |
|
|
40
|
+
| `atoms_search` | Full-text search across items | Read |
|
|
41
|
+
| `atoms_get_coverage` | Find requirements without test cases | Read |
|
|
42
|
+
| `atoms_get_history` | Audit trail for an item | Read |
|
|
43
|
+
| `atoms_export_mermaid` | Generate traceability diagram | Read |
|
|
44
|
+
| `atoms_create_item` | Create a requirement, test case, or note | Write |
|
|
45
|
+
| `atoms_update_item` | Update item fields | Write |
|
|
46
|
+
| `atoms_delete_item` | Soft-delete an item | Write |
|
|
47
|
+
| `atoms_link_items` | Add/remove relationships between items | Write |
|
|
48
|
+
| `atoms_bulk_import` | Bulk create up to 100 items at once | Write |
|
|
49
|
+
| `atoms_record_test_result` | Record pass/fail for a test case | Write |
|
|
50
|
+
| `atoms_trace` | Walk traceability graph (upstream/downstream) | Read |
|
|
51
|
+
| `atoms_project_summary` | Project compliance dashboard (counts, coverage, status) | Read |
|
|
52
|
+
|
|
53
|
+
## Authentication
|
|
54
|
+
|
|
55
|
+
ATOMS MCP uses **OAuth 2.1 with PKCE** — the same flow used by GitHub CLI and Supabase CLI.
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Interactive login (opens browser)
|
|
59
|
+
npx @atoms-tech/atoms-mcp login
|
|
60
|
+
|
|
61
|
+
# Check current session
|
|
62
|
+
npx @atoms-tech/atoms-mcp whoami
|
|
63
|
+
|
|
64
|
+
# Clear credentials
|
|
65
|
+
npx @atoms-tech/atoms-mcp logout
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**How it works:**
|
|
69
|
+
|
|
70
|
+
1. `login` opens your browser to the ATOMS consent page
|
|
71
|
+
2. You approve the MCP connection with your ATOMS account
|
|
72
|
+
3. Tokens are stored locally at `~/.atoms-mcp/credentials.json`
|
|
73
|
+
4. Tokens auto-refresh — you only need to login once
|
|
74
|
+
|
|
75
|
+
You can also set `ATOMS_ACCESS_TOKEN` as an environment variable for CI/headless use.
|
|
76
|
+
|
|
77
|
+
## CLI Commands
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
npx @atoms-tech/atoms-mcp login # Authenticate with ATOMS
|
|
81
|
+
npx @atoms-tech/atoms-mcp logout # Clear stored credentials
|
|
82
|
+
npx @atoms-tech/atoms-mcp whoami # Show current user
|
|
83
|
+
npx @atoms-tech/atoms-mcp --help # Show all commands
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Running without a subcommand starts the MCP server on stdio.
|
|
87
|
+
|
|
88
|
+
## Setup
|
|
89
|
+
|
|
90
|
+
### Claude Code
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
claude mcp add atoms-mcp -- npx @atoms-tech/atoms-mcp
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Claude Desktop
|
|
97
|
+
|
|
98
|
+
Add to your `claude_desktop_config.json`:
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"mcpServers": {
|
|
103
|
+
"atoms-mcp": {
|
|
104
|
+
"command": "npx",
|
|
105
|
+
"args": ["@atoms-tech/atoms-mcp"]
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Cursor / Windsurf
|
|
112
|
+
|
|
113
|
+
Add to your MCP configuration with `command: "npx"` and `args: ["@atoms-tech/atoms-mcp"]`. Refer to your editor's MCP documentation for the exact config file location.
|
|
114
|
+
|
|
115
|
+
## Security
|
|
116
|
+
|
|
117
|
+
- **Row Level Security (RLS)** — All queries run with the user's JWT. The server never uses a service role key. You can only access projects your organization has granted you access to.
|
|
118
|
+
- **Role enforcement** — Write tools check your org role (viewer, editor, admin) before making changes. Viewers are blocked from mutations.
|
|
119
|
+
- **Audit logging** — Every tool call is logged with tool name, parameters, duration, and session ID. Write operations log to `change_history` with `actor: "mcp_claude"`.
|
|
120
|
+
- **Rate limiting** — Built-in per-user rate limiter prevents abuse.
|
|
121
|
+
- **No secrets in the package** — The Supabase anon key is a publishable client key (like a Firebase API key). It grants zero data access without a valid user JWT.
|
|
122
|
+
|
|
123
|
+
## Requirements
|
|
124
|
+
|
|
125
|
+
- Node.js >= 18
|
|
126
|
+
- An [ATOMS.tech](https://atoms.tech) account with at least one project
|
|
127
|
+
|
|
128
|
+
## Links
|
|
129
|
+
|
|
130
|
+
- [ATOMS.tech](https://atoms.tech) — Requirements management platform
|
|
131
|
+
- [Model Context Protocol](https://modelcontextprotocol.io) — Open standard for AI tool integration
|
|
132
|
+
- [GitHub](https://github.com/support-atoms-tech/atoms-mvp-v2) — Source code
|
|
133
|
+
|
|
134
|
+
## License
|
|
135
|
+
|
|
136
|
+
MIT
|
package/dist/auth/login.d.ts
CHANGED
|
@@ -12,10 +12,12 @@
|
|
|
12
12
|
* Run the interactive login flow.
|
|
13
13
|
* Opens browser, waits for callback, stores tokens.
|
|
14
14
|
*
|
|
15
|
-
* Uses OAuth 2.1 PKCE flow:
|
|
16
|
-
* 1.
|
|
17
|
-
* 2.
|
|
18
|
-
* 3.
|
|
15
|
+
* Uses OAuth 2.1 PKCE flow with hosted consent page:
|
|
16
|
+
* 1. Open browser to ATOMS consent page with code_challenge
|
|
17
|
+
* 2. User reviews permissions and clicks "Authorize"
|
|
18
|
+
* 3. Consent page redirects to Supabase OAuth with PKCE params
|
|
19
|
+
* 4. Supabase returns authorization code to localhost callback
|
|
20
|
+
* 5. Exchange code + code_verifier for session tokens
|
|
19
21
|
*/
|
|
20
22
|
export declare function login(): Promise<{
|
|
21
23
|
email: string;
|
package/dist/auth/login.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/auth/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAWH
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/auth/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAWH;;;;;;;;;;GAUG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAkMxD"}
|
package/dist/auth/login.js
CHANGED
|
@@ -12,17 +12,19 @@ import { createServer } from "node:http";
|
|
|
12
12
|
import { randomBytes, createHash } from "node:crypto";
|
|
13
13
|
import { URL } from "node:url";
|
|
14
14
|
import { writeCredentials } from "./token-store.js";
|
|
15
|
-
import { ATOMS_SUPABASE_URL, ATOMS_SUPABASE_ANON_KEY } from "../config.js";
|
|
15
|
+
import { ATOMS_SUPABASE_URL, ATOMS_SUPABASE_ANON_KEY, ATOMS_APP_URL } from "../config.js";
|
|
16
16
|
const CALLBACK_PORT = 19275;
|
|
17
17
|
const CALLBACK_PATH = "/callback";
|
|
18
18
|
/**
|
|
19
19
|
* Run the interactive login flow.
|
|
20
20
|
* Opens browser, waits for callback, stores tokens.
|
|
21
21
|
*
|
|
22
|
-
* Uses OAuth 2.1 PKCE flow:
|
|
23
|
-
* 1.
|
|
24
|
-
* 2.
|
|
25
|
-
* 3.
|
|
22
|
+
* Uses OAuth 2.1 PKCE flow with hosted consent page:
|
|
23
|
+
* 1. Open browser to ATOMS consent page with code_challenge
|
|
24
|
+
* 2. User reviews permissions and clicks "Authorize"
|
|
25
|
+
* 3. Consent page redirects to Supabase OAuth with PKCE params
|
|
26
|
+
* 4. Supabase returns authorization code to localhost callback
|
|
27
|
+
* 5. Exchange code + code_verifier for session tokens
|
|
26
28
|
*/
|
|
27
29
|
export async function login() {
|
|
28
30
|
// Generate PKCE challenge
|
|
@@ -31,10 +33,9 @@ export async function login() {
|
|
|
31
33
|
.update(codeVerifier)
|
|
32
34
|
.digest("base64url");
|
|
33
35
|
const redirectTo = `http://localhost:${CALLBACK_PORT}${CALLBACK_PATH}`;
|
|
34
|
-
// Build
|
|
35
|
-
const authUrl = new URL(`${
|
|
36
|
-
authUrl.searchParams.set("
|
|
37
|
-
authUrl.searchParams.set("redirect_to", redirectTo);
|
|
36
|
+
// Build consent page URL — hosted on ATOMS web app
|
|
37
|
+
const authUrl = new URL(`${ATOMS_APP_URL}/auth/mcp-consent`);
|
|
38
|
+
authUrl.searchParams.set("redirect_uri", redirectTo);
|
|
38
39
|
authUrl.searchParams.set("code_challenge", codeChallenge);
|
|
39
40
|
authUrl.searchParams.set("code_challenge_method", "S256");
|
|
40
41
|
return new Promise((resolve, reject) => {
|
|
@@ -46,6 +47,15 @@ export async function login() {
|
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
48
49
|
try {
|
|
50
|
+
// Check for user cancellation from consent page
|
|
51
|
+
const error = url.searchParams.get("error");
|
|
52
|
+
if (error === "access_denied") {
|
|
53
|
+
res.writeHead(200, { "Content-Type": "text/html" });
|
|
54
|
+
res.end(failurePage("Authorization was cancelled."));
|
|
55
|
+
server.close();
|
|
56
|
+
reject(new Error("Authorization cancelled by user."));
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
49
59
|
// PKCE flow: Supabase redirects with ?code=xxx in query params
|
|
50
60
|
const code = url.searchParams.get("code");
|
|
51
61
|
if (code) {
|
|
@@ -224,22 +234,180 @@ function extractorPage() {
|
|
|
224
234
|
function successPage(email) {
|
|
225
235
|
return `<!DOCTYPE html>
|
|
226
236
|
<html>
|
|
227
|
-
<head
|
|
228
|
-
<
|
|
229
|
-
<
|
|
230
|
-
|
|
231
|
-
|
|
237
|
+
<head>
|
|
238
|
+
<title>ATOMS MCP — Authorized</title>
|
|
239
|
+
<style>
|
|
240
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
241
|
+
body {
|
|
242
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
|
|
243
|
+
background: #0a0a0a;
|
|
244
|
+
color: #fafafa;
|
|
245
|
+
display: flex;
|
|
246
|
+
align-items: center;
|
|
247
|
+
justify-content: center;
|
|
248
|
+
min-height: 100vh;
|
|
249
|
+
}
|
|
250
|
+
.card {
|
|
251
|
+
background: #171717;
|
|
252
|
+
border: 1px solid #262626;
|
|
253
|
+
border-radius: 16px;
|
|
254
|
+
padding: 48px;
|
|
255
|
+
max-width: 480px;
|
|
256
|
+
width: 100%;
|
|
257
|
+
text-align: center;
|
|
258
|
+
}
|
|
259
|
+
.icon {
|
|
260
|
+
width: 56px;
|
|
261
|
+
height: 56px;
|
|
262
|
+
background: #052e16;
|
|
263
|
+
border-radius: 50%;
|
|
264
|
+
display: flex;
|
|
265
|
+
align-items: center;
|
|
266
|
+
justify-content: center;
|
|
267
|
+
margin: 0 auto 24px;
|
|
268
|
+
}
|
|
269
|
+
.icon svg { width: 28px; height: 28px; }
|
|
270
|
+
h1 {
|
|
271
|
+
font-size: 22px;
|
|
272
|
+
font-weight: 600;
|
|
273
|
+
margin-bottom: 8px;
|
|
274
|
+
color: #22c55e;
|
|
275
|
+
}
|
|
276
|
+
.email {
|
|
277
|
+
font-size: 14px;
|
|
278
|
+
color: #a3a3a3;
|
|
279
|
+
margin-bottom: 32px;
|
|
280
|
+
}
|
|
281
|
+
.permissions {
|
|
282
|
+
text-align: left;
|
|
283
|
+
background: #0a0a0a;
|
|
284
|
+
border: 1px solid #262626;
|
|
285
|
+
border-radius: 12px;
|
|
286
|
+
padding: 20px;
|
|
287
|
+
margin-bottom: 24px;
|
|
288
|
+
}
|
|
289
|
+
.permissions h3 {
|
|
290
|
+
font-size: 12px;
|
|
291
|
+
font-weight: 600;
|
|
292
|
+
color: #737373;
|
|
293
|
+
text-transform: uppercase;
|
|
294
|
+
letter-spacing: 0.05em;
|
|
295
|
+
margin-bottom: 12px;
|
|
296
|
+
}
|
|
297
|
+
.perm-item {
|
|
298
|
+
display: flex;
|
|
299
|
+
align-items: center;
|
|
300
|
+
gap: 10px;
|
|
301
|
+
padding: 6px 0;
|
|
302
|
+
font-size: 14px;
|
|
303
|
+
color: #d4d4d4;
|
|
304
|
+
}
|
|
305
|
+
.perm-item .dot {
|
|
306
|
+
width: 6px;
|
|
307
|
+
height: 6px;
|
|
308
|
+
background: #22c55e;
|
|
309
|
+
border-radius: 50%;
|
|
310
|
+
flex-shrink: 0;
|
|
311
|
+
}
|
|
312
|
+
.closing {
|
|
313
|
+
font-size: 13px;
|
|
314
|
+
color: #525252;
|
|
315
|
+
}
|
|
316
|
+
.closing span { color: #a3a3a3; font-variant-numeric: tabular-nums; }
|
|
317
|
+
</style>
|
|
318
|
+
</head>
|
|
319
|
+
<body>
|
|
320
|
+
<div class="card">
|
|
321
|
+
<div class="icon">
|
|
322
|
+
<svg fill="none" viewBox="0 0 24 24" stroke="#22c55e" stroke-width="2.5">
|
|
323
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"/>
|
|
324
|
+
</svg>
|
|
325
|
+
</div>
|
|
326
|
+
<h1>Authorization Granted</h1>
|
|
327
|
+
<p class="email">${email}</p>
|
|
328
|
+
|
|
329
|
+
<div class="permissions">
|
|
330
|
+
<h3>ATOMS MCP can now</h3>
|
|
331
|
+
<div class="perm-item"><span class="dot"></span> Read your projects and requirements</div>
|
|
332
|
+
<div class="perm-item"><span class="dot"></span> Create and edit requirements and test cases</div>
|
|
333
|
+
<div class="perm-item"><span class="dot"></span> Record test results (pass/fail)</div>
|
|
334
|
+
<div class="perm-item"><span class="dot"></span> Manage traceability relationships</div>
|
|
335
|
+
<div class="perm-item"><span class="dot"></span> Export coverage reports and diagrams</div>
|
|
336
|
+
</div>
|
|
337
|
+
|
|
338
|
+
<p class="closing">This tab will close in <span id="countdown">5</span>s</p>
|
|
339
|
+
</div>
|
|
340
|
+
|
|
341
|
+
<script>
|
|
342
|
+
let seconds = 5;
|
|
343
|
+
const el = document.getElementById('countdown');
|
|
344
|
+
const timer = setInterval(() => {
|
|
345
|
+
seconds--;
|
|
346
|
+
el.textContent = seconds;
|
|
347
|
+
if (seconds <= 0) {
|
|
348
|
+
clearInterval(timer);
|
|
349
|
+
window.close();
|
|
350
|
+
// If window.close() is blocked (not opened by script), update message
|
|
351
|
+
setTimeout(() => {
|
|
352
|
+
document.querySelector('.closing').textContent = 'You can close this tab now.';
|
|
353
|
+
}, 500);
|
|
354
|
+
}
|
|
355
|
+
}, 1000);
|
|
356
|
+
</script>
|
|
232
357
|
</body>
|
|
233
358
|
</html>`;
|
|
234
359
|
}
|
|
235
360
|
function failurePage(reason) {
|
|
236
361
|
return `<!DOCTYPE html>
|
|
237
362
|
<html>
|
|
238
|
-
<head
|
|
239
|
-
<
|
|
240
|
-
<
|
|
241
|
-
|
|
242
|
-
|
|
363
|
+
<head>
|
|
364
|
+
<title>ATOMS MCP — Failed</title>
|
|
365
|
+
<style>
|
|
366
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
367
|
+
body {
|
|
368
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
|
|
369
|
+
background: #0a0a0a;
|
|
370
|
+
color: #fafafa;
|
|
371
|
+
display: flex;
|
|
372
|
+
align-items: center;
|
|
373
|
+
justify-content: center;
|
|
374
|
+
min-height: 100vh;
|
|
375
|
+
}
|
|
376
|
+
.card {
|
|
377
|
+
background: #171717;
|
|
378
|
+
border: 1px solid #262626;
|
|
379
|
+
border-radius: 16px;
|
|
380
|
+
padding: 48px;
|
|
381
|
+
max-width: 480px;
|
|
382
|
+
width: 100%;
|
|
383
|
+
text-align: center;
|
|
384
|
+
}
|
|
385
|
+
.icon {
|
|
386
|
+
width: 56px;
|
|
387
|
+
height: 56px;
|
|
388
|
+
background: #450a0a;
|
|
389
|
+
border-radius: 50%;
|
|
390
|
+
display: flex;
|
|
391
|
+
align-items: center;
|
|
392
|
+
justify-content: center;
|
|
393
|
+
margin: 0 auto 24px;
|
|
394
|
+
}
|
|
395
|
+
.icon svg { width: 28px; height: 28px; }
|
|
396
|
+
h1 { font-size: 22px; font-weight: 600; margin-bottom: 16px; color: #ef4444; }
|
|
397
|
+
.reason { font-size: 14px; color: #a3a3a3; line-height: 1.6; }
|
|
398
|
+
.reason a { color: #7c3aed; text-decoration: underline; }
|
|
399
|
+
</style>
|
|
400
|
+
</head>
|
|
401
|
+
<body>
|
|
402
|
+
<div class="card">
|
|
403
|
+
<div class="icon">
|
|
404
|
+
<svg fill="none" viewBox="0 0 24 24" stroke="#ef4444" stroke-width="2.5">
|
|
405
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/>
|
|
406
|
+
</svg>
|
|
407
|
+
</div>
|
|
408
|
+
<h1>Authorization Failed</h1>
|
|
409
|
+
<p class="reason">${reason}</p>
|
|
410
|
+
</div>
|
|
243
411
|
</body>
|
|
244
412
|
</html>`;
|
|
245
413
|
}
|
package/dist/auth/login.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/auth/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAA6C,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAgDe,MAAM;;;QAGtB,CAAC;AACT,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -14,4 +14,6 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const ATOMS_SUPABASE_URL = "https://gmebjyhomsbvhrxffzre.supabase.co";
|
|
16
16
|
export declare const ATOMS_SUPABASE_ANON_KEY = "sb_publishable_b49MUAB8XCrQiF7x5b9lUA_w1aplSBH";
|
|
17
|
+
/** ATOMS web app URL — hosts the MCP consent page */
|
|
18
|
+
export declare const ATOMS_APP_URL: string;
|
|
17
19
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,kBAAkB,6CAA6C,CAAC;AAC7E,eAAO,MAAM,uBAAuB,mDACc,CAAC"}
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,kBAAkB,6CAA6C,CAAC;AAC7E,eAAO,MAAM,uBAAuB,mDACc,CAAC;AAEnD,qDAAqD;AACrD,eAAO,MAAM,aAAa,QAAiE,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -14,4 +14,6 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export const ATOMS_SUPABASE_URL = "https://gmebjyhomsbvhrxffzre.supabase.co";
|
|
16
16
|
export const ATOMS_SUPABASE_ANON_KEY = "sb_publishable_b49MUAB8XCrQiF7x5b9lUA_w1aplSBH";
|
|
17
|
+
/** ATOMS web app URL — hosts the MCP consent page */
|
|
18
|
+
export const ATOMS_APP_URL = process.env.ATOMS_APP_URL ?? "https://atoms-mvp-v2.vercel.app";
|
|
17
19
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,0CAA0C,CAAC;AAC7E,MAAM,CAAC,MAAM,uBAAuB,GAClC,gDAAgD,CAAC"}
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,0CAA0C,CAAC;AAC7E,MAAM,CAAC,MAAM,uBAAuB,GAClC,gDAAgD,CAAC;AAEnD,qDAAqD;AACrD,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,iCAAiC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -18,15 +18,15 @@ async function main() {
|
|
|
18
18
|
const { login } = await import("./auth/login.js");
|
|
19
19
|
try {
|
|
20
20
|
const { email } = await login();
|
|
21
|
-
process.stderr.write(`\
|
|
22
|
-
process.stderr.write(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
process.stderr.write(`\n \x1b[32m✓\x1b[0m Authenticated as ${email}\n`);
|
|
22
|
+
process.stderr.write(` \x1b[32m✓\x1b[0m Credentials saved to ~/.atoms/credentials.json\n\n`);
|
|
23
|
+
process.stderr.write(` \x1b[1mNext steps:\x1b[0m\n`);
|
|
24
|
+
process.stderr.write(` \x1b[36m$\x1b[0m claude mcp add atoms -- npx -y @atoms-tech/atoms-mcp\n`);
|
|
25
|
+
process.stderr.write(`\n Or add to Claude Desktop (Settings → MCP → Edit Config):\n`);
|
|
26
|
+
process.stderr.write(` \x1b[90m{\n "mcpServers": {\n "atoms": {\n "command": "npx",\n "args": ["-y", "@atoms-tech/atoms-mcp"]\n }\n }\n }\x1b[0m\n\n`);
|
|
27
27
|
}
|
|
28
28
|
catch (err) {
|
|
29
|
-
process.stderr.write(
|
|
29
|
+
process.stderr.write(`\n \x1b[31m✗\x1b[0m ${err instanceof Error ? err.message : String(err)}\n\n`);
|
|
30
30
|
process.exit(1);
|
|
31
31
|
}
|
|
32
32
|
break;
|
|
@@ -35,10 +35,10 @@ async function main() {
|
|
|
35
35
|
const { getValidToken } = await import("./auth/refresh.js");
|
|
36
36
|
try {
|
|
37
37
|
const { email, user_id } = await getValidToken();
|
|
38
|
-
process.stderr.write(
|
|
38
|
+
process.stderr.write(`\n \x1b[32m✓\x1b[0m Logged in as ${email}\n \x1b[90mUser ID: ${user_id}\x1b[0m\n\n`);
|
|
39
39
|
}
|
|
40
40
|
catch (err) {
|
|
41
|
-
process.stderr.write(
|
|
41
|
+
process.stderr.write(`\n \x1b[31m✗\x1b[0m Not authenticated.\n Run: npx @atoms-tech/atoms-mcp login\n\n`);
|
|
42
42
|
process.exit(1);
|
|
43
43
|
}
|
|
44
44
|
break;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAExB,KAAK,UAAU,IAAI;IACjB,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC;YAClD,IAAI,CAAC;gBACH,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,KA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,OAAO,CAAC,CAAC,CAAC;YACR,sCAAsC;YACtC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;YAEvE,IAAI,CAAC;gBACH,2BAA2B;gBAC3B,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;gBAC5D,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,aAAa,EAAE,CAAC;gBACxC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAgC,KAAK,IAAI,CAAC,CAAC;YAClE,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,wBAAwB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI;oBAC5E,2DAA2D,CAC5D,CAAC;YACJ,CAAC;YAED,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;YAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAChC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;QACtF,CAAC;IACH,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -472,6 +472,57 @@ Returns:
|
|
|
472
472
|
const { linkItemsHandler } = await import("./tools/link-items.js");
|
|
473
473
|
return linkItemsHandler(params);
|
|
474
474
|
}));
|
|
475
|
+
server.registerTool("atoms_bulk_import", {
|
|
476
|
+
title: "Bulk Import ATOMS Items",
|
|
477
|
+
description: `Bulk create multiple items in a single tool call. Essential for AI agents
|
|
478
|
+
that generate 20+ requirements at once.
|
|
479
|
+
|
|
480
|
+
Checks write access once, generates sequential IDs, batch inserts all items,
|
|
481
|
+
and reports per-item errors without aborting the entire batch.
|
|
482
|
+
|
|
483
|
+
Args:
|
|
484
|
+
- project_id (string, UUID): Target project
|
|
485
|
+
- items (array): Up to 100 items to create, each with:
|
|
486
|
+
- type (string): requirement|test-case|note
|
|
487
|
+
- title (string): Item title (max 500 chars)
|
|
488
|
+
- body (string, optional): Rich text body
|
|
489
|
+
- summary (string, optional): Brief summary
|
|
490
|
+
- domains (string[], optional): Domain tags
|
|
491
|
+
- level (string, optional): System|Subsystem|Component
|
|
492
|
+
- parent_id (string, optional): Parent item ID to link
|
|
493
|
+
|
|
494
|
+
Returns:
|
|
495
|
+
{ created: number, items: [{ id, title, type }], errors: [] }
|
|
496
|
+
|
|
497
|
+
Limits:
|
|
498
|
+
- Maximum 100 items per call
|
|
499
|
+
- If any item fails, others still succeed — errors reported separately
|
|
500
|
+
|
|
501
|
+
Side effects:
|
|
502
|
+
- Logs to change_history with actor='mcp_claude' for each created item
|
|
503
|
+
- Creates parent relationships for items with parent_id`,
|
|
504
|
+
inputSchema: {
|
|
505
|
+
project_id: z.string().uuid().describe("UUID of the target project"),
|
|
506
|
+
items: z.array(z.object({
|
|
507
|
+
type: z.enum(["requirement", "test-case", "note"]).describe("Item type"),
|
|
508
|
+
title: z.string().min(1).max(500).describe("Item title"),
|
|
509
|
+
body: z.string().optional().describe("Rich text body"),
|
|
510
|
+
summary: z.string().optional().describe("Brief summary"),
|
|
511
|
+
domains: z.array(z.string()).optional().describe("Domain tags"),
|
|
512
|
+
level: z.string().optional().describe("System|Subsystem|Component"),
|
|
513
|
+
parent_id: z.string().optional().describe("Parent item ID to link"),
|
|
514
|
+
})).min(1).max(100).describe("Items to create (1-100)"),
|
|
515
|
+
},
|
|
516
|
+
annotations: {
|
|
517
|
+
readOnlyHint: false,
|
|
518
|
+
destructiveHint: false,
|
|
519
|
+
idempotentHint: false,
|
|
520
|
+
openWorldHint: false,
|
|
521
|
+
},
|
|
522
|
+
}, withMiddleware("atoms_bulk_import", async (params) => {
|
|
523
|
+
const { bulkImportHandler } = await import("./tools/bulk-import.js");
|
|
524
|
+
return bulkImportHandler(params);
|
|
525
|
+
}));
|
|
475
526
|
server.registerTool("atoms_record_test_result", {
|
|
476
527
|
title: "Record Test Result",
|
|
477
528
|
description: `Record a pass/fail/blocked result for a test case.
|
|
@@ -508,4 +559,79 @@ Side effects:
|
|
|
508
559
|
const { recordTestResultHandler } = await import("./tools/record-test-result.js");
|
|
509
560
|
return recordTestResultHandler(params);
|
|
510
561
|
}));
|
|
562
|
+
// ---------------------------------------------------------------------------
|
|
563
|
+
// Tool Registration — Phase 4 (Advanced Tools)
|
|
564
|
+
// ---------------------------------------------------------------------------
|
|
565
|
+
server.registerTool("atoms_trace", {
|
|
566
|
+
title: "Trace Item Relationships",
|
|
567
|
+
description: `Walk the traceability graph from a starting item.
|
|
568
|
+
|
|
569
|
+
Answers questions like "which requirements does TC-00003 verify?" or
|
|
570
|
+
"if I change REQ-00001, what's affected downstream?"
|
|
571
|
+
|
|
572
|
+
Args:
|
|
573
|
+
- project_id (string, UUID): Project containing the item
|
|
574
|
+
- item_id (string): Starting item ID
|
|
575
|
+
- direction (string): upstream|downstream|both
|
|
576
|
+
- upstream: follow parent/verifies links (dependencies)
|
|
577
|
+
- downstream: follow child/verified_by links (dependents)
|
|
578
|
+
- both: trace in both directions
|
|
579
|
+
- depth (number, optional): Max traversal depth (default 5, max 10)
|
|
580
|
+
- relationship_types (string[], optional): Filter to specific types (parent, child, related, verifies, verified_by)
|
|
581
|
+
|
|
582
|
+
Returns:
|
|
583
|
+
{ root, direction, items: [{ id, title, type, relationship, depth }], total_count }
|
|
584
|
+
|
|
585
|
+
Examples:
|
|
586
|
+
- "What does TC-00003 verify?" → atoms_trace(project_id, "TC-00003", "upstream")
|
|
587
|
+
- "What's affected by REQ-00001?" → atoms_trace(project_id, "REQ-00001", "downstream")`,
|
|
588
|
+
inputSchema: {
|
|
589
|
+
project_id: z.string().uuid().describe("UUID of the project"),
|
|
590
|
+
item_id: z.string().min(1).max(20).describe("Starting item ID"),
|
|
591
|
+
direction: z.enum(["upstream", "downstream", "both"])
|
|
592
|
+
.describe("Traversal direction"),
|
|
593
|
+
depth: z.number().int().min(1).max(10).default(5)
|
|
594
|
+
.describe("Max traversal depth (default 5)"),
|
|
595
|
+
relationship_types: z.array(z.enum(["parent", "child", "related", "verifies", "verified_by"])).optional()
|
|
596
|
+
.describe("Filter to specific relationship types"),
|
|
597
|
+
},
|
|
598
|
+
annotations: {
|
|
599
|
+
readOnlyHint: true,
|
|
600
|
+
destructiveHint: false,
|
|
601
|
+
idempotentHint: true,
|
|
602
|
+
openWorldHint: false,
|
|
603
|
+
},
|
|
604
|
+
}, withMiddleware("atoms_trace", async (params) => {
|
|
605
|
+
const { traceHandler } = await import("./tools/trace.js");
|
|
606
|
+
return traceHandler(params);
|
|
607
|
+
}));
|
|
608
|
+
server.registerTool("atoms_project_summary", {
|
|
609
|
+
title: "Project Compliance Summary",
|
|
610
|
+
description: `One-call project health and compliance dashboard.
|
|
611
|
+
|
|
612
|
+
Returns item counts by type, test execution status, requirement coverage
|
|
613
|
+
(overall and by domain), and recent change activity.
|
|
614
|
+
|
|
615
|
+
Args:
|
|
616
|
+
- project_id (string, UUID): Project to summarize
|
|
617
|
+
|
|
618
|
+
Returns:
|
|
619
|
+
{ project_name, counts, test_status, coverage, coverage_by_domain, recent_changes, last_updated }
|
|
620
|
+
|
|
621
|
+
Examples:
|
|
622
|
+
- "Give me a compliance snapshot" → atoms_project_summary(project_id)
|
|
623
|
+
- "How's our test coverage?" → atoms_project_summary(project_id)`,
|
|
624
|
+
inputSchema: {
|
|
625
|
+
project_id: z.string().uuid().describe("UUID of the project"),
|
|
626
|
+
},
|
|
627
|
+
annotations: {
|
|
628
|
+
readOnlyHint: true,
|
|
629
|
+
destructiveHint: false,
|
|
630
|
+
idempotentHint: true,
|
|
631
|
+
openWorldHint: false,
|
|
632
|
+
},
|
|
633
|
+
}, withMiddleware("atoms_project_summary", async (params) => {
|
|
634
|
+
const { projectSummaryHandler } = await import("./tools/project-summary.js");
|
|
635
|
+
return projectSummaryHandler(params);
|
|
636
|
+
}));
|
|
511
637
|
//# sourceMappingURL=server.js.map
|