@triedotdev/mcp 1.0.70 → 1.0.71
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 +86 -22
- package/dist/index.js +184 -2
- package/dist/index.js.map +1 -1
- package/dist/ui/memory-viewer.html +773 -0
- package/dist/ui/pr-review.html +742 -0
- package/dist/ui/scan-dashboard.html +741 -0
- package/dist/ui/visual-qa.html +762 -0
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -944,29 +944,92 @@ The guardian reads your project's `.trie/` directory (incidents, patterns, memor
|
|
|
944
944
|
|
|
945
945
|
---
|
|
946
946
|
|
|
947
|
+
## MCP Apps - Interactive UIs
|
|
948
|
+
|
|
949
|
+
**New:** Trie now supports **MCP Apps**—interactive UI components that render directly in Claude, ChatGPT, VS Code, and other MCP clients.
|
|
950
|
+
|
|
951
|
+
Instead of text-only output, Trie tools return rich, interactive interfaces:
|
|
952
|
+
|
|
953
|
+
| Tool | UI App | What You Get |
|
|
954
|
+
|------|--------|--------------|
|
|
955
|
+
| `trie_scan` | **Scan Dashboard** | Filter by severity/agent, expand issues, one-click fix actions, export JSON |
|
|
956
|
+
| `trie_memory` | **Memory Tree** | Hierarchical view with bar charts, cross-project patterns, collapsible sections |
|
|
957
|
+
| `trie_pr_review` | **PR Review** | File tree, side-by-side diffs, inline comments, approve/request changes |
|
|
958
|
+
| `trie_visual_qa_browser` | **Visual QA** | Screenshot gallery, viewport comparison, issue annotations |
|
|
959
|
+
|
|
960
|
+
### Memory Tree Visualization
|
|
961
|
+
|
|
962
|
+
When you use `trie_memory`, you get an interactive tree view:
|
|
963
|
+
|
|
964
|
+
```
|
|
965
|
+
MEMORY TREE [1000 issues]
|
|
966
|
+
├──────────────────────────────────────┤
|
|
967
|
+
▼ By Severity
|
|
968
|
+
│ critical (5) █░░░░░░░░░░░░░░░
|
|
969
|
+
│ high (10) █░░░░░░░░░░░░░░░
|
|
970
|
+
│ medium (75) ███████████░░░░░
|
|
971
|
+
└ low (110) ████████████████
|
|
972
|
+
▼ By File (Hot Spots)
|
|
973
|
+
├─ styles.css (57) ████████████████
|
|
974
|
+
├─ stack-detector.ts (23) ██████░░░░░░░░░░
|
|
975
|
+
└─ attack-surface.ts (10) ███░░░░░░░░░░░░░
|
|
976
|
+
▼ Cross-Project Patterns (88 recurring)
|
|
977
|
+
├─ "Loose equality check..." - seen in 2 projects
|
|
978
|
+
├─ "Missing license header..." - seen in 2 projects
|
|
979
|
+
└─ "Potential N+1 query..." - seen in 2 projects
|
|
980
|
+
```
|
|
981
|
+
|
|
982
|
+
**Key features:**
|
|
983
|
+
- Collapsible sections (severity, files, agents, patterns)
|
|
984
|
+
- Visual bar charts showing issue distribution
|
|
985
|
+
- **Cross-project patterns** - highlights recurring issues across your codebases
|
|
986
|
+
- Click any category to drill down into specific issues
|
|
987
|
+
- Resolve/unresolve actions inline
|
|
988
|
+
|
|
989
|
+
### Client Support
|
|
990
|
+
|
|
991
|
+
MCP Apps work in:
|
|
992
|
+
- **Claude Desktop** ✅
|
|
993
|
+
- **Claude Web** ✅
|
|
994
|
+
- **ChatGPT** ✅
|
|
995
|
+
- **VS Code Insiders** ✅
|
|
996
|
+
- **Goose** ✅
|
|
997
|
+
|
|
998
|
+
### How It Works
|
|
999
|
+
|
|
1000
|
+
1. You call a Trie tool like `trie_scan` or `trie_memory`
|
|
1001
|
+
2. Your AI client detects the UI resource and fetches it
|
|
1002
|
+
3. An interactive dashboard renders in your chat
|
|
1003
|
+
4. You can filter, expand, click actions—all within the conversation
|
|
1004
|
+
5. The model sees your interactions and responds accordingly
|
|
1005
|
+
|
|
1006
|
+
No configuration needed—the UIs work automatically when you use Trie via MCP.
|
|
1007
|
+
|
|
1008
|
+
---
|
|
1009
|
+
|
|
947
1010
|
## MCP Tools
|
|
948
1011
|
|
|
949
1012
|
These tools are available when using Trie via MCP (Cursor, Claude Code, etc.).
|
|
950
1013
|
|
|
951
1014
|
### Scanning & Analysis
|
|
952
1015
|
|
|
953
|
-
| Tool | Description |
|
|
954
|
-
|
|
955
|
-
| `trie_scan` | Full scan with intelligent skill selection |
|
|
956
|
-
| `trie_watch` | Watch mode—proactive nudging as you code |
|
|
957
|
-
| `trie_check` | Quick risk check before push (< 500ms, no LLM) |
|
|
958
|
-
| `trie_fix` | Generate fix recommendations for detected issues |
|
|
959
|
-
| `trie_explain` | Explain code, issues, or changes in plain language |
|
|
1016
|
+
| Tool | Description | UI App |
|
|
1017
|
+
|------|-------------|--------|
|
|
1018
|
+
| `trie_scan` | Full scan with intelligent skill selection | ✅ Interactive dashboard |
|
|
1019
|
+
| `trie_watch` | Watch mode—proactive nudging as you code | — |
|
|
1020
|
+
| `trie_check` | Quick risk check before push (< 500ms, no LLM) | — |
|
|
1021
|
+
| `trie_fix` | Generate fix recommendations for detected issues | — |
|
|
1022
|
+
| `trie_explain` | Explain code, issues, or changes in plain language | — |
|
|
960
1023
|
|
|
961
1024
|
### Memory & Learning
|
|
962
1025
|
|
|
963
|
-
| Tool | Description |
|
|
964
|
-
|
|
965
|
-
| `trie_tell` | Report an incident to build the agent's memory |
|
|
966
|
-
| `trie_feedback` | Give thumbs up/down on warnings (updates confidence) |
|
|
967
|
-
| `trie_memory` | Search and manage issue memory across projects |
|
|
968
|
-
| `trie_context` | Read full context (memory + patterns + history) |
|
|
969
|
-
| `trie_checkpoint` | Quick save context without running a full scan |
|
|
1026
|
+
| Tool | Description | UI App |
|
|
1027
|
+
|------|-------------|--------|
|
|
1028
|
+
| `trie_tell` | Report an incident to build the agent's memory | — |
|
|
1029
|
+
| `trie_feedback` | Give thumbs up/down on warnings (updates confidence) | — |
|
|
1030
|
+
| `trie_memory` | Search and manage issue memory across projects | ✅ Interactive tree |
|
|
1031
|
+
| `trie_context` | Read full context (memory + patterns + history) | — |
|
|
1032
|
+
| `trie_checkpoint` | Quick save context without running a full scan | — |
|
|
970
1033
|
|
|
971
1034
|
### Project & Configuration
|
|
972
1035
|
|
|
@@ -998,14 +1061,15 @@ These tools are available when using Trie via MCP (Cursor, Claude Code, etc.).
|
|
|
998
1061
|
|
|
999
1062
|
### UI/UX Skills
|
|
1000
1063
|
|
|
1001
|
-
| Tool | What It Analyzes |
|
|
1002
|
-
|
|
1003
|
-
| `trie_accessibility` | WCAG 2.1 AA: icon-only buttons, touch targets, heading levels, ARIA validation, 20+ checks. **Guardian auto-suggests visual QA when critical a11y issues found.** |
|
|
1004
|
-
| `trie_design` | AI slop detection, verified token systems, contrast validation, design health scoring |
|
|
1005
|
-
| `trie_ux` | User testing simulations: happy path, security tester, confused user, impatient user |
|
|
1006
|
-
| `trie_visual_qa` | Static CSS/layout analysis: CLS risks, responsive patterns, overflow issues |
|
|
1007
|
-
| `trie_visual_qa_browser` | **Browser screenshots** at mobile/tablet/desktop for Guardian visual analysis (requires dev server) |
|
|
1008
|
-
| `trie_e2e` | End-to-end test coverage, user flow validation |
|
|
1064
|
+
| Tool | What It Analyzes | UI App |
|
|
1065
|
+
|------|------------------|--------|
|
|
1066
|
+
| `trie_accessibility` | WCAG 2.1 AA: icon-only buttons, touch targets, heading levels, ARIA validation, 20+ checks. **Guardian auto-suggests visual QA when critical a11y issues found.** | — |
|
|
1067
|
+
| `trie_design` | AI slop detection, verified token systems, contrast validation, design health scoring | — |
|
|
1068
|
+
| `trie_ux` | User testing simulations: happy path, security tester, confused user, impatient user | — |
|
|
1069
|
+
| `trie_visual_qa` | Static CSS/layout analysis: CLS risks, responsive patterns, overflow issues | — |
|
|
1070
|
+
| `trie_visual_qa_browser` | **Browser screenshots** at mobile/tablet/desktop for Guardian visual analysis (requires dev server) | ✅ Screenshot gallery |
|
|
1071
|
+
| `trie_e2e` | End-to-end test coverage, user flow validation | — |
|
|
1072
|
+
| `trie_pr_review` | **PR reviews**: File-by-file diff viewer with inline actions | ✅ Interactive diff viewer |
|
|
1009
1073
|
|
|
1010
1074
|
### Operations Skills
|
|
1011
1075
|
|
package/dist/index.js
CHANGED
|
@@ -5491,6 +5491,10 @@ var ToolRegistry = class {
|
|
|
5491
5491
|
description: "Use worker threads for parallel execution"
|
|
5492
5492
|
}
|
|
5493
5493
|
}
|
|
5494
|
+
},
|
|
5495
|
+
// MCP Apps: Interactive scan dashboard
|
|
5496
|
+
_meta: {
|
|
5497
|
+
ui: { resourceUri: "ui://trie/scan-dashboard" }
|
|
5494
5498
|
}
|
|
5495
5499
|
},
|
|
5496
5500
|
{
|
|
@@ -5799,6 +5803,10 @@ var ToolRegistry = class {
|
|
|
5799
5803
|
description: "Project directory (defaults to current workspace)"
|
|
5800
5804
|
}
|
|
5801
5805
|
}
|
|
5806
|
+
},
|
|
5807
|
+
// MCP Apps: Interactive memory viewer
|
|
5808
|
+
_meta: {
|
|
5809
|
+
ui: { resourceUri: "ui://trie/memory-viewer" }
|
|
5802
5810
|
}
|
|
5803
5811
|
},
|
|
5804
5812
|
{
|
|
@@ -5942,6 +5950,10 @@ var ToolRegistry = class {
|
|
|
5942
5950
|
waitForSelector: { type: "string", description: "CSS selector to wait for" },
|
|
5943
5951
|
waitMs: { type: "number", description: "Additional wait time" }
|
|
5944
5952
|
}
|
|
5953
|
+
},
|
|
5954
|
+
// MCP Apps: Interactive visual QA gallery
|
|
5955
|
+
_meta: {
|
|
5956
|
+
ui: { resourceUri: "ui://trie/visual-qa" }
|
|
5945
5957
|
}
|
|
5946
5958
|
},
|
|
5947
5959
|
{
|
|
@@ -5963,6 +5975,10 @@ var ToolRegistry = class {
|
|
|
5963
5975
|
description: "Specific files to review"
|
|
5964
5976
|
}
|
|
5965
5977
|
}
|
|
5978
|
+
},
|
|
5979
|
+
// MCP Apps: Interactive PR review UI
|
|
5980
|
+
_meta: {
|
|
5981
|
+
ui: { resourceUri: "ui://trie/pr-review" }
|
|
5966
5982
|
}
|
|
5967
5983
|
},
|
|
5968
5984
|
{
|
|
@@ -6046,7 +6062,26 @@ var ToolRegistry = class {
|
|
|
6046
6062
|
// src/server/resource-manager.ts
|
|
6047
6063
|
import { readdir as readdir2, readFile as readFile6 } from "fs/promises";
|
|
6048
6064
|
import { existsSync as existsSync8 } from "fs";
|
|
6049
|
-
import { join as join6 } from "path";
|
|
6065
|
+
import { join as join6, dirname as dirname2 } from "path";
|
|
6066
|
+
import { fileURLToPath } from "url";
|
|
6067
|
+
var UI_APPS = {
|
|
6068
|
+
"scan-dashboard": {
|
|
6069
|
+
name: "Scan Dashboard",
|
|
6070
|
+
description: "Interactive dashboard for viewing and managing scan results"
|
|
6071
|
+
},
|
|
6072
|
+
"memory-viewer": {
|
|
6073
|
+
name: "Memory Viewer",
|
|
6074
|
+
description: "Search and browse issue history with context preview"
|
|
6075
|
+
},
|
|
6076
|
+
"pr-review": {
|
|
6077
|
+
name: "PR Review",
|
|
6078
|
+
description: "File-by-file diff viewer with inline actions"
|
|
6079
|
+
},
|
|
6080
|
+
"visual-qa": {
|
|
6081
|
+
name: "Visual QA",
|
|
6082
|
+
description: "Screenshot gallery with viewport comparison"
|
|
6083
|
+
}
|
|
6084
|
+
};
|
|
6050
6085
|
var ResourceManager = class {
|
|
6051
6086
|
skillRegistry = getSkillRegistry();
|
|
6052
6087
|
/**
|
|
@@ -6136,6 +6171,7 @@ var ResourceManager = class {
|
|
|
6136
6171
|
);
|
|
6137
6172
|
resources.push(...await this.getScanReportResources());
|
|
6138
6173
|
resources.push(...await this.getCustomSkillResources());
|
|
6174
|
+
resources.push(...this.getUIAppResources());
|
|
6139
6175
|
return resources;
|
|
6140
6176
|
}
|
|
6141
6177
|
async getScanReportResources() {
|
|
@@ -6171,6 +6207,10 @@ var ResourceManager = class {
|
|
|
6171
6207
|
* Read content for a specific resource
|
|
6172
6208
|
*/
|
|
6173
6209
|
async readResourceContent(uri) {
|
|
6210
|
+
if (uri.startsWith("ui://trie/")) {
|
|
6211
|
+
const appId = uri.replace("ui://trie/", "");
|
|
6212
|
+
return await this.getUIAppResource(uri, appId);
|
|
6213
|
+
}
|
|
6174
6214
|
const parsedUri = uri.replace("trie://", "");
|
|
6175
6215
|
if (parsedUri === "context") {
|
|
6176
6216
|
return await this.getContextResource(uri);
|
|
@@ -6219,6 +6259,143 @@ var ResourceManager = class {
|
|
|
6219
6259
|
}
|
|
6220
6260
|
throw new Error(`Unknown resource: ${uri}`);
|
|
6221
6261
|
}
|
|
6262
|
+
/**
|
|
6263
|
+
* Get UI App resources for MCP Apps
|
|
6264
|
+
*/
|
|
6265
|
+
getUIAppResources() {
|
|
6266
|
+
return Object.entries(UI_APPS).map(([id, app]) => ({
|
|
6267
|
+
uri: `ui://trie/${id}`,
|
|
6268
|
+
name: app.name,
|
|
6269
|
+
description: app.description,
|
|
6270
|
+
mimeType: "text/html"
|
|
6271
|
+
}));
|
|
6272
|
+
}
|
|
6273
|
+
/**
|
|
6274
|
+
* Read UI App resource content (bundled HTML)
|
|
6275
|
+
*/
|
|
6276
|
+
async getUIAppResource(uri, appId) {
|
|
6277
|
+
const currentFile = fileURLToPath(import.meta.url);
|
|
6278
|
+
const distDir = dirname2(dirname2(currentFile));
|
|
6279
|
+
const uiDir = join6(distDir, "ui");
|
|
6280
|
+
const htmlPath = join6(uiDir, `${appId}.html`);
|
|
6281
|
+
try {
|
|
6282
|
+
if (!existsSync8(htmlPath)) {
|
|
6283
|
+
return {
|
|
6284
|
+
contents: [{
|
|
6285
|
+
uri,
|
|
6286
|
+
mimeType: "text/html",
|
|
6287
|
+
text: this.getFallbackUIHtml(appId)
|
|
6288
|
+
}]
|
|
6289
|
+
};
|
|
6290
|
+
}
|
|
6291
|
+
const content = await readFile6(htmlPath, "utf-8");
|
|
6292
|
+
return {
|
|
6293
|
+
contents: [{
|
|
6294
|
+
uri,
|
|
6295
|
+
mimeType: "text/html",
|
|
6296
|
+
text: content
|
|
6297
|
+
}]
|
|
6298
|
+
};
|
|
6299
|
+
} catch (error) {
|
|
6300
|
+
return {
|
|
6301
|
+
contents: [{
|
|
6302
|
+
uri,
|
|
6303
|
+
mimeType: "text/html",
|
|
6304
|
+
text: this.getFallbackUIHtml(appId)
|
|
6305
|
+
}]
|
|
6306
|
+
};
|
|
6307
|
+
}
|
|
6308
|
+
}
|
|
6309
|
+
/**
|
|
6310
|
+
* Generate fallback HTML for UI apps that haven't been built yet
|
|
6311
|
+
*/
|
|
6312
|
+
getFallbackUIHtml(appId) {
|
|
6313
|
+
const app = UI_APPS[appId];
|
|
6314
|
+
const title = app?.name || "Trie UI";
|
|
6315
|
+
const description = app?.description || "Loading...";
|
|
6316
|
+
return `<!DOCTYPE html>
|
|
6317
|
+
<html lang="en">
|
|
6318
|
+
<head>
|
|
6319
|
+
<meta charset="UTF-8">
|
|
6320
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6321
|
+
<title>${title} - Trie</title>
|
|
6322
|
+
<style>
|
|
6323
|
+
:root {
|
|
6324
|
+
--bg: #0d1117;
|
|
6325
|
+
--surface: #161b22;
|
|
6326
|
+
--border: #30363d;
|
|
6327
|
+
--text: #e6edf3;
|
|
6328
|
+
--text-muted: #8b949e;
|
|
6329
|
+
--primary: #58a6ff;
|
|
6330
|
+
}
|
|
6331
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
6332
|
+
body {
|
|
6333
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
6334
|
+
background: var(--bg);
|
|
6335
|
+
color: var(--text);
|
|
6336
|
+
display: flex;
|
|
6337
|
+
align-items: center;
|
|
6338
|
+
justify-content: center;
|
|
6339
|
+
min-height: 100vh;
|
|
6340
|
+
padding: 24px;
|
|
6341
|
+
}
|
|
6342
|
+
.container {
|
|
6343
|
+
text-align: center;
|
|
6344
|
+
max-width: 400px;
|
|
6345
|
+
}
|
|
6346
|
+
h1 {
|
|
6347
|
+
font-size: 24px;
|
|
6348
|
+
margin-bottom: 8px;
|
|
6349
|
+
}
|
|
6350
|
+
p {
|
|
6351
|
+
color: var(--text-muted);
|
|
6352
|
+
margin-bottom: 24px;
|
|
6353
|
+
}
|
|
6354
|
+
.status {
|
|
6355
|
+
display: inline-flex;
|
|
6356
|
+
align-items: center;
|
|
6357
|
+
gap: 8px;
|
|
6358
|
+
padding: 8px 16px;
|
|
6359
|
+
background: var(--surface);
|
|
6360
|
+
border: 1px solid var(--border);
|
|
6361
|
+
border-radius: 8px;
|
|
6362
|
+
color: var(--primary);
|
|
6363
|
+
}
|
|
6364
|
+
.spinner {
|
|
6365
|
+
width: 16px;
|
|
6366
|
+
height: 16px;
|
|
6367
|
+
border: 2px solid var(--border);
|
|
6368
|
+
border-top-color: var(--primary);
|
|
6369
|
+
border-radius: 50%;
|
|
6370
|
+
animation: spin 0.8s linear infinite;
|
|
6371
|
+
}
|
|
6372
|
+
@keyframes spin { to { transform: rotate(360deg); } }
|
|
6373
|
+
</style>
|
|
6374
|
+
</head>
|
|
6375
|
+
<body>
|
|
6376
|
+
<div class="container">
|
|
6377
|
+
<h1>${title}</h1>
|
|
6378
|
+
<p>${description}</p>
|
|
6379
|
+
<div class="status">
|
|
6380
|
+
<div class="spinner"></div>
|
|
6381
|
+
<span>Connecting to Trie...</span>
|
|
6382
|
+
</div>
|
|
6383
|
+
</div>
|
|
6384
|
+
<script type="module">
|
|
6385
|
+
// MCP Apps SDK connection
|
|
6386
|
+
import { App } from "@modelcontextprotocol/ext-apps";
|
|
6387
|
+
|
|
6388
|
+
const app = new App();
|
|
6389
|
+
await app.connect();
|
|
6390
|
+
|
|
6391
|
+
app.ontoolresult = (result) => {
|
|
6392
|
+
document.querySelector('.status span').textContent = 'Connected! Waiting for data...';
|
|
6393
|
+
console.log('Received tool result:', result);
|
|
6394
|
+
};
|
|
6395
|
+
</script>
|
|
6396
|
+
</body>
|
|
6397
|
+
</html>`;
|
|
6398
|
+
}
|
|
6222
6399
|
async getContextResource(uri) {
|
|
6223
6400
|
const workDir = getWorkingDirectory(void 0, true);
|
|
6224
6401
|
const state = await loadContextState();
|
|
@@ -7238,7 +7415,12 @@ var MCPServer = class {
|
|
|
7238
7415
|
{
|
|
7239
7416
|
capabilities: {
|
|
7240
7417
|
tools: {},
|
|
7241
|
-
resources: {}
|
|
7418
|
+
resources: {},
|
|
7419
|
+
// Enable MCP Apps - interactive UI components in AI clients
|
|
7420
|
+
// See: https://blog.modelcontextprotocol.io/posts/2026-01-26-mcp-apps/
|
|
7421
|
+
experimental: {
|
|
7422
|
+
ui: {}
|
|
7423
|
+
}
|
|
7242
7424
|
}
|
|
7243
7425
|
}
|
|
7244
7426
|
);
|