@atoms-tech/atoms-mcp 0.2.1 → 0.3.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/LICENSE +9 -0
- package/README.md +30 -18
- package/dist/apps/register.d.ts +36 -0
- package/dist/apps/register.js +65 -0
- package/dist/apps/src/apps/coverage/coverage-app.html +237 -0
- package/dist/apps/src/apps/import/import-app.html +239 -0
- package/dist/apps/src/apps/mermaid/mermaid-app.html +112 -0
- package/dist/apps/src/apps/summary/summary-app.html +279 -0
- package/dist/apps/src/apps/trace/trace-app.html +171 -0
- package/dist/auth/login.d.ts +0 -1
- package/dist/auth/login.js +0 -1
- package/dist/auth/refresh.d.ts +0 -1
- package/dist/auth/refresh.js +0 -1
- package/dist/auth/token-store.d.ts +0 -1
- package/dist/auth/token-store.js +0 -1
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -1
- package/dist/db/client.d.ts +0 -1
- package/dist/db/client.js +0 -1
- package/dist/db/graph.d.ts +0 -1
- package/dist/db/graph.js +0 -1
- package/dist/db/queries.d.ts +0 -1
- package/dist/db/queries.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/middleware/audit.d.ts +0 -1
- package/dist/middleware/audit.js +0 -1
- package/dist/middleware/rate-limiter.d.ts +0 -1
- package/dist/middleware/rate-limiter.js +0 -1
- package/dist/middleware/validator.d.ts +0 -1
- package/dist/middleware/validator.js +0 -1
- package/dist/server.d.ts +3 -3
- package/dist/server.js +70 -28
- package/dist/tools/_base.d.ts +0 -1
- package/dist/tools/_base.js +0 -1
- package/dist/tools/bulk-import.d.ts +0 -1
- package/dist/tools/bulk-import.js +0 -1
- package/dist/tools/create-item.d.ts +0 -1
- package/dist/tools/create-item.js +0 -1
- package/dist/tools/delete-item.d.ts +0 -1
- package/dist/tools/delete-item.js +0 -1
- package/dist/tools/export-mermaid.d.ts +0 -1
- package/dist/tools/export-mermaid.js +0 -1
- package/dist/tools/get-coverage.d.ts +0 -1
- package/dist/tools/get-coverage.js +0 -1
- package/dist/tools/get-history.d.ts +0 -1
- package/dist/tools/get-history.js +0 -1
- package/dist/tools/get-item.d.ts +0 -1
- package/dist/tools/get-item.js +0 -1
- package/dist/tools/link-items.d.ts +1 -2
- package/dist/tools/link-items.js +0 -1
- package/dist/tools/list-items.d.ts +0 -1
- package/dist/tools/list-items.js +0 -1
- package/dist/tools/list-projects.d.ts +0 -1
- package/dist/tools/list-projects.js +0 -1
- package/dist/tools/project-summary.d.ts +0 -1
- package/dist/tools/project-summary.js +0 -1
- package/dist/tools/record-test-result.d.ts +0 -1
- package/dist/tools/record-test-result.js +0 -1
- package/dist/tools/search.d.ts +0 -1
- package/dist/tools/search.js +0 -1
- package/dist/tools/trace.d.ts +0 -1
- package/dist/tools/trace.js +0 -1
- package/dist/tools/update-item.d.ts +0 -1
- package/dist/tools/update-item.js +0 -1
- package/dist/types/responses.d.ts +0 -1
- package/dist/types/responses.js +0 -1
- package/dist/types/work-item.d.ts +0 -1
- package/dist/types/work-item.js +0 -1
- package/package.json +11 -4
- package/dist/auth/login.d.ts.map +0 -1
- package/dist/auth/login.js.map +0 -1
- package/dist/auth/refresh.d.ts.map +0 -1
- package/dist/auth/refresh.js.map +0 -1
- package/dist/auth/token-store.d.ts.map +0 -1
- package/dist/auth/token-store.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/db/client.d.ts.map +0 -1
- package/dist/db/client.js.map +0 -1
- package/dist/db/graph.d.ts.map +0 -1
- package/dist/db/graph.js.map +0 -1
- package/dist/db/queries.d.ts.map +0 -1
- package/dist/db/queries.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/middleware/audit.d.ts.map +0 -1
- package/dist/middleware/audit.js.map +0 -1
- package/dist/middleware/rate-limiter.d.ts.map +0 -1
- package/dist/middleware/rate-limiter.js.map +0 -1
- package/dist/middleware/validator.d.ts.map +0 -1
- package/dist/middleware/validator.js.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/tools/_base.d.ts.map +0 -1
- package/dist/tools/_base.js.map +0 -1
- package/dist/tools/bulk-import.d.ts.map +0 -1
- package/dist/tools/bulk-import.js.map +0 -1
- package/dist/tools/create-item.d.ts.map +0 -1
- package/dist/tools/create-item.js.map +0 -1
- package/dist/tools/delete-item.d.ts.map +0 -1
- package/dist/tools/delete-item.js.map +0 -1
- package/dist/tools/export-mermaid.d.ts.map +0 -1
- package/dist/tools/export-mermaid.js.map +0 -1
- package/dist/tools/get-coverage.d.ts.map +0 -1
- package/dist/tools/get-coverage.js.map +0 -1
- package/dist/tools/get-history.d.ts.map +0 -1
- package/dist/tools/get-history.js.map +0 -1
- package/dist/tools/get-item.d.ts.map +0 -1
- package/dist/tools/get-item.js.map +0 -1
- package/dist/tools/link-items.d.ts.map +0 -1
- package/dist/tools/link-items.js.map +0 -1
- package/dist/tools/list-items.d.ts.map +0 -1
- package/dist/tools/list-items.js.map +0 -1
- package/dist/tools/list-projects.d.ts.map +0 -1
- package/dist/tools/list-projects.js.map +0 -1
- package/dist/tools/project-summary.d.ts.map +0 -1
- package/dist/tools/project-summary.js.map +0 -1
- package/dist/tools/record-test-result.d.ts.map +0 -1
- package/dist/tools/record-test-result.js.map +0 -1
- package/dist/tools/search.d.ts.map +0 -1
- package/dist/tools/search.js.map +0 -1
- package/dist/tools/trace.d.ts.map +0 -1
- package/dist/tools/trace.js.map +0 -1
- package/dist/tools/update-item.d.ts.map +0 -1
- package/dist/tools/update-item.js.map +0 -1
- package/dist/types/responses.d.ts.map +0 -1
- package/dist/types/responses.js.map +0 -1
- package/dist/types/work-item.d.ts.map +0 -1
- package/dist/types/work-item.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Copyright (c) 2024-2026 Atoms.tech. All rights reserved.
|
|
2
|
+
|
|
3
|
+
This software is proprietary and confidential. Unauthorized copying, distribution,
|
|
4
|
+
modification, or use of this software, via any medium, is strictly prohibited.
|
|
5
|
+
|
|
6
|
+
This software is provided to end users solely for use with the Atoms.tech platform
|
|
7
|
+
under the terms of the Atoms.tech Terms of Service.
|
|
8
|
+
|
|
9
|
+
For licensing inquiries, contact: support@atoms.tech
|
package/README.md
CHANGED
|
@@ -32,23 +32,35 @@ Every action is logged with AI actor attribution (`mcp_claude`) and enforces you
|
|
|
32
32
|
|
|
33
33
|
## Available Tools
|
|
34
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
|
|
35
|
+
| Tool | Description | Access | MCP App UI |
|
|
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 | Coverage heatmap |
|
|
42
|
+
| `atoms_get_history` | Audit trail for an item | Read | |
|
|
43
|
+
| `atoms_export_mermaid` | Generate traceability diagram | Read | Interactive diagram |
|
|
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 | Results table |
|
|
49
|
+
| `atoms_record_test_result` | Record pass/fail for a test case | Write | |
|
|
50
|
+
| `atoms_trace` | Walk traceability graph (upstream/downstream) | Read | Force-directed graph |
|
|
51
|
+
| `atoms_project_summary` | Project compliance dashboard | Read | Charts + gauges |
|
|
52
|
+
|
|
53
|
+
## Interactive UIs (MCP Apps)
|
|
54
|
+
|
|
55
|
+
5 tools include interactive UIs powered by [MCP Apps](https://modelcontextprotocol.io/extensions/apps). In supported hosts (Claude, ChatGPT), these tools render rich visualizations inline in the conversation:
|
|
56
|
+
|
|
57
|
+
- **Project Summary** — compliance dashboard with coverage gauge, test status bar, and domain charts
|
|
58
|
+
- **Trace Graph** — interactive force-directed graph showing requirement/test traceability
|
|
59
|
+
- **Mermaid Diagram** — pan/zoom diagram of the requirement hierarchy
|
|
60
|
+
- **Coverage Heatmap** — visual coverage report with uncovered requirements list
|
|
61
|
+
- **Bulk Import Results** — color-coded table showing created items and errors
|
|
62
|
+
|
|
63
|
+
In non-UI clients (Claude Code CLI, Cursor), these tools return standard JSON text — no functionality is lost.
|
|
52
64
|
|
|
53
65
|
## Authentication
|
|
54
66
|
|
|
@@ -69,7 +81,7 @@ npx @atoms-tech/atoms-mcp logout
|
|
|
69
81
|
|
|
70
82
|
1. `login` opens your browser to the ATOMS consent page
|
|
71
83
|
2. You approve the MCP connection with your ATOMS account
|
|
72
|
-
3. Tokens are stored locally at `~/.atoms
|
|
84
|
+
3. Tokens are stored locally at `~/.atoms/credentials.json`
|
|
73
85
|
4. Tokens auto-refresh — you only need to login once
|
|
74
86
|
|
|
75
87
|
You can also set `ATOMS_ACCESS_TOKEN` as an environment variable for CI/headless use.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP App registration helper.
|
|
3
|
+
* Wraps registerAppTool + registerAppResource with ATOMS conventions.
|
|
4
|
+
*/
|
|
5
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
|
+
import type { ToolAnnotations } from "@modelcontextprotocol/sdk/types.js";
|
|
7
|
+
import type { ZodRawShapeCompat } from "@modelcontextprotocol/sdk/server/zod-compat.js";
|
|
8
|
+
interface RegisterAppConfig {
|
|
9
|
+
/** App directory name (e.g., "mermaid") */
|
|
10
|
+
appName: string;
|
|
11
|
+
/** HTML filename (e.g., "mermaid-app.html") */
|
|
12
|
+
htmlFile: string;
|
|
13
|
+
/** Tool name (e.g., "atoms_export_mermaid") */
|
|
14
|
+
toolName: string;
|
|
15
|
+
/** Tool display title */
|
|
16
|
+
title: string;
|
|
17
|
+
/** Tool description */
|
|
18
|
+
description: string;
|
|
19
|
+
/** Zod input schema */
|
|
20
|
+
inputSchema: ZodRawShapeCompat;
|
|
21
|
+
/** Tool annotations */
|
|
22
|
+
annotations?: ToolAnnotations;
|
|
23
|
+
/** Additional CSP resource domains (e.g., CDN for mermaid.js) */
|
|
24
|
+
extraResourceDomains?: string[];
|
|
25
|
+
/** Tool handler — receives validated params, returns MCP tool result */
|
|
26
|
+
handler: (...args: any[]) => any;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Register a tool as an MCP App with UI resource.
|
|
30
|
+
* - Creates ui:// resource URI
|
|
31
|
+
* - Registers tool with _meta.ui pointing to the resource
|
|
32
|
+
* - Registers resource that serves the single-file bundled HTML
|
|
33
|
+
* - Configures CSP for Google Fonts + any extras
|
|
34
|
+
*/
|
|
35
|
+
export declare function registerAtomsApp(server: McpServer, config: RegisterAppConfig): void;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP App registration helper.
|
|
3
|
+
* Wraps registerAppTool + registerAppResource with ATOMS conventions.
|
|
4
|
+
*/
|
|
5
|
+
import { registerAppTool, registerAppResource, RESOURCE_MIME_TYPE, } from "@modelcontextprotocol/ext-apps/server";
|
|
6
|
+
import fs from "node:fs/promises";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
/**
|
|
11
|
+
* Resolve path to a built MCP App HTML file.
|
|
12
|
+
* Build output: dist/apps/src/apps/{name}/{name}-app.html
|
|
13
|
+
* Runtime __dirname: dist/apps/ (since this file is src/apps/register.ts → dist/apps/register.js)
|
|
14
|
+
*/
|
|
15
|
+
function resolveAppHtml(appName, htmlFile) {
|
|
16
|
+
return path.resolve(__dirname, "src", "apps", appName, htmlFile);
|
|
17
|
+
}
|
|
18
|
+
/** CSP domains needed by all ATOMS apps (Google Fonts) */
|
|
19
|
+
const SHARED_CSP = {
|
|
20
|
+
resourceDomains: [
|
|
21
|
+
"fonts.googleapis.com",
|
|
22
|
+
"fonts.gstatic.com",
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Register a tool as an MCP App with UI resource.
|
|
27
|
+
* - Creates ui:// resource URI
|
|
28
|
+
* - Registers tool with _meta.ui pointing to the resource
|
|
29
|
+
* - Registers resource that serves the single-file bundled HTML
|
|
30
|
+
* - Configures CSP for Google Fonts + any extras
|
|
31
|
+
*/
|
|
32
|
+
export function registerAtomsApp(server, config) {
|
|
33
|
+
const resourceUri = `ui://${config.toolName}/${config.htmlFile}`;
|
|
34
|
+
const htmlPath = resolveAppHtml(config.appName, config.htmlFile);
|
|
35
|
+
const resourceDomains = [
|
|
36
|
+
...SHARED_CSP.resourceDomains,
|
|
37
|
+
...(config.extraResourceDomains ?? []),
|
|
38
|
+
];
|
|
39
|
+
// Register the tool with UI metadata
|
|
40
|
+
registerAppTool(server, config.toolName, {
|
|
41
|
+
title: config.title,
|
|
42
|
+
description: config.description,
|
|
43
|
+
inputSchema: config.inputSchema,
|
|
44
|
+
annotations: config.annotations,
|
|
45
|
+
_meta: { ui: { resourceUri } },
|
|
46
|
+
}, config.handler);
|
|
47
|
+
// Register the HTML resource
|
|
48
|
+
registerAppResource(server, `${config.title} UI`, resourceUri, {
|
|
49
|
+
mimeType: RESOURCE_MIME_TYPE,
|
|
50
|
+
}, async () => {
|
|
51
|
+
const html = await fs.readFile(htmlPath, "utf-8");
|
|
52
|
+
return {
|
|
53
|
+
contents: [{
|
|
54
|
+
uri: resourceUri,
|
|
55
|
+
mimeType: RESOURCE_MIME_TYPE,
|
|
56
|
+
text: html,
|
|
57
|
+
_meta: {
|
|
58
|
+
ui: {
|
|
59
|
+
csp: { resourceDomains },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
}],
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
}
|