@triedotdev/mcp 1.0.4 → 1.0.6

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 CHANGED
@@ -1,51 +1,28 @@
1
- # Quick Start Guide
1
+ # Trie
2
2
 
3
- Get Trie Agent up and running in minutes to start scanning and fixing AI-generated code.
3
+ **Customizable Agent Parallelization for AI Code Review**
4
4
 
5
- ## Prerequisites
5
+ 13 specialized agents scan your code for security, privacy, compliance, and bugs—all running in parallel. Create custom agents from any document.
6
6
 
7
- - **Node.js 18+** installed ([download](https://nodejs.org/))
8
- - **AI coding tool** (Cursor, Claude Code, or VS Code with MCP support)
7
+ ## Features
9
8
 
10
- ## Installation
9
+ - **13 Built-in Agents** - Security, Privacy, SOC 2, Legal, Architecture, DevOps, and more
10
+ - **Parallel Execution** - All agents run simultaneously for fast scans
11
+ - **🔥 YOLO Mode** - Autonomous auto-fixing as you code
12
+ - **Custom Agents** - Create agents from PDFs, docs, or style guides
13
+ - **No API Key Required** - Works with any MCP-compatible AI tool (Cursor, Claude Code, VS Code)
14
+ - **Smart Triaging** - Only activates relevant agents based on code context
15
+ - **Docker Support** - Run in containers for CI/CD or isolated environments
11
16
 
12
- ### Step 1: Install Trie Agent
17
+ ## Quick Start
13
18
 
14
19
  ```bash
15
20
  npm install -g @triedotdev/mcp
16
21
  ```
17
22
 
18
- ### Step 2: Configure Your AI Tool
23
+ ### Configure Cursor
19
24
 
20
- No API key required! Trie uses your AI tool's built-in Claude to do the analysis.
21
-
22
- ## Configuration
23
-
24
- ### For Claude Code
25
-
26
- Use the `claude` CLI to add the MCP server:
27
-
28
- ```bash
29
- claude mcp add Trie -- npx @triedotdev/mcp
30
- ```
31
-
32
- Or add to `~/.claude/settings.json`:
33
-
34
- ```json
35
- {
36
- "mcpServers": {
37
- "Trie": {
38
- "command": "npx",
39
- "args": ["@triedotdev/mcp"]
40
- }
41
- }
42
- }
43
- ```
44
-
45
- ### For Cursor
46
-
47
- 1. Open Cursor Settings → MCP Servers
48
- 2. Add this configuration:
25
+ Settings MCP Servers Add:
49
26
 
50
27
  ```json
51
28
  {
@@ -58,231 +35,159 @@ Or add to `~/.claude/settings.json`:
58
35
  }
59
36
  ```
60
37
 
61
- ### For VS Code
62
-
63
- Add to your VS Code settings (`.vscode/settings.json` or user settings):
38
+ ### Configure Claude Code
64
39
 
65
- ```json
66
- {
67
- "mcp.servers": {
68
- "Trie": {
69
- "command": "npx",
70
- "args": ["@triedotdev/mcp"]
71
- }
72
- }
73
- }
40
+ ```bash
41
+ claude mcp add Trie -- npx @triedotdev/mcp
74
42
  ```
75
43
 
76
44
  ## Usage
77
45
 
78
- ### Scan Your Code
46
+ Once configured, just ask your AI assistant:
79
47
 
80
- Once configured, use Trie Agent in your AI coding tool:
81
-
82
- **In Cursor/Claude Code:**
83
48
  ```
84
- Scan this code with Trie Agent
49
+ Scan this code with Trie
85
50
  ```
86
51
 
87
- **Or use the MCP tool directly:**
52
+ Or use specific agents:
53
+
88
54
  ```
89
- Use trie_scan to analyze the current file
55
+ Run trie_security on this file
56
+ Run trie_soc2 to check compliance
90
57
  ```
91
58
 
92
- ### Example Workflow
93
-
94
- 1. **Generate code** with your AI assistant
95
- 2. **Scan for issues:**
96
- ```
97
- Scan this with Trie Agent
98
- ```
99
- 3. **Review results** - Trie will show:
100
- - Risk level and activated agents
101
- - Critical issues requiring review
102
- - Auto-fixable issues
103
- - Plain-language explanations
104
- 4. **Apply fixes:**
105
- ```
106
- Auto-fix the high-confidence issues
107
- ```
108
- 5. **Generate tests:**
109
- ```
110
- Generate tests for this code
111
- ```
59
+ ## YOLO Mode 🔥
112
60
 
113
- ## Available Tools
114
-
115
- - **`trie_scan`** - Scan code with intelligent agent selection
116
- - **`trie_fix`** - Apply high-confidence fixes automatically
117
- - **`trie_explain`** - Get plain-language explanations of code/issues
118
- - **`trie_test`** - Generate tests or check coverage
119
- - **`trie_watch`** - Watch mode for continuous scanning
120
- - **`trie_security`**, **`trie_privacy`**, **`trie_bugs`**, etc. - Run specific agents
121
-
122
- ### Custom Agent Tools
61
+ **Autonomous auto-fixing** - Trie watches your code and automatically fixes high-confidence issues as you code.
123
62
 
124
- - **`trie_create_agent`** - Create a custom agent from a document (PDF, TXT, MD)
125
- - **`trie_save_agent`** - Save agent config after extraction
126
- - **`trie_list_agents`** - List all registered agents (built-in and custom)
127
-
128
- ## Custom Agents
129
-
130
- Create specialized code review agents from any document—style guides, compliance docs, framework best practices, etc.
131
-
132
- ### Creating a Custom Agent
63
+ ### Via MCP
133
64
 
134
65
  ```
135
- Use trie_create_agent with filePath:"./react-handbook.pdf" agentName:"react-handbook"
66
+ Use trie_watch with action:"start" yolo:true
136
67
  ```
137
68
 
138
- Or paste content directly:
139
- ```
140
- Use trie_create_agent with agentName:"my-style-guide" documentContent:"[paste your style guide here]"
69
+ ### Via CLI
70
+
71
+ ```bash
72
+ trie-yolo
141
73
  ```
142
74
 
143
- The tool will parse the document and prompt you to extract knowledge. Then use `trie_save_agent` to save it.
75
+ YOLO mode will:
76
+ - Watch for file changes
77
+ - Scan changed files automatically
78
+ - Auto-fix high-confidence issues (>95% confidence)
79
+ - Log all actions for review
144
80
 
145
- ### Listing Custom Agents
81
+ ## Docker
146
82
 
147
- ```
148
- Use trie_list_agents
149
- ```
83
+ Run Trie in a container for CI/CD or isolated environments.
150
84
 
151
- This shows all built-in and custom agents with their pattern counts and categories.
85
+ ```bash
86
+ # Build
87
+ docker build -t trie-agent .
152
88
 
153
- ### Using a Custom Agent
89
+ # YOLO mode (auto-fix)
90
+ docker run -v $(pwd):/app trie-agent --yolo
154
91
 
155
- Custom agents automatically activate during `trie_scan` based on their activation rules. To force a specific custom agent:
92
+ # Watch mode (scan only)
93
+ docker run -v $(pwd):/app trie-agent
156
94
 
95
+ # CI mode (one-shot scan)
96
+ docker run -v $(pwd):/app trie-agent --once
157
97
  ```
158
- Use trie_scan with forceAgents:["react-handbook"]
159
- ```
160
-
161
- ### Removing a Custom Agent
162
98
 
163
- Custom agents are stored as JSON files in your project's `.trie/agents/` directory. To remove one:
99
+ Or use Docker Compose:
164
100
 
165
101
  ```bash
166
- # List custom agents
167
- ls .trie/agents/
102
+ docker-compose up
103
+ ```
104
+
105
+ | Mode | Command | Description |
106
+ |------|---------|-------------|
107
+ | YOLO | `--yolo` | Auto-fix high-confidence issues |
108
+ | Watch | (default) | Scan on file changes, no auto-fix |
109
+ | CI | `--once` | One-shot scan, exit with error code if issues found |
110
+
111
+ ## Built-in Agents
112
+
113
+ | Agent | Description |
114
+ |-------|-------------|
115
+ | `security` | Vulnerabilities, injection risks, hardcoded secrets |
116
+ | `privacy` | GDPR, CCPA, PII handling, data protection |
117
+ | `soc2` | SOC 2 Type II compliance: access controls, encryption, logging |
118
+ | `legal` | Consent patterns, data retention, compliance |
119
+ | `architecture` | SOLID principles, code organization, scalability |
120
+ | `bugs` | Null safety, edge cases, async issues |
121
+ | `types` | Type errors, missing annotations |
122
+ | `devops` | Config issues, logging, environment variables |
123
+ | `accessibility` | WCAG 2.1, keyboard nav, screen readers |
124
+ | `ux` | User flow testing, error states |
125
+ | `clean` | AI-generated code cleanup |
126
+ | `test` | Test generation and coverage |
127
+ | `comprehension` | Plain-language explanations |
168
128
 
169
- # Remove a specific agent
170
- rm .trie/agents/react-handbook.json
171
- ```
129
+ ## Custom Agents
130
+
131
+ Create specialized agents from any document:
172
132
 
173
- The agent will no longer be loaded on subsequent scans.
133
+ ```
134
+ Use trie_create_agent with filePath:"./style-guide.pdf" agentName:"my-style"
135
+ ```
174
136
 
175
- ## MCP Resources
137
+ Custom agents automatically activate during scans based on their rules.
176
138
 
177
- Trie also exposes read-only MCP resources for querying agent info, cache stats, and scan reports:
139
+ ## Available Tools
178
140
 
179
- | Resource | Description |
180
- |----------|-------------|
181
- | `trie://agents` | List all available agents |
182
- | `trie://config` | Current configuration |
183
- | `trie://cache/stats` | Cache performance metrics |
184
- | `trie://signatures` | Vulnerability signature counts |
185
- | `trie://reports/{file}` | Access scan reports |
141
+ | Tool | Description |
142
+ |------|-------------|
143
+ | `trie_scan` | Intelligent scan with automatic agent selection |
144
+ | `trie_fix` | Apply high-confidence fixes |
145
+ | `trie_explain` | Plain-language explanations |
146
+ | `trie_watch` | Continuous scanning mode |
147
+ | `trie_create_agent` | Create custom agent from document |
148
+ | `trie_list_agents` | List all available agents |
186
149
 
187
- See [MCP_USAGE.md](MCP_USAGE.md) for detailed resource documentation.
150
+ Plus individual agent tools: `trie_security`, `trie_privacy`, `trie_soc2`, `trie_bugs`, etc.
188
151
 
189
152
  ## Example Output
190
153
 
191
154
  ```
192
- 🔍 TRIE AGENT SCAN
155
+ TRIE AGENT SCAN
193
156
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
194
157
 
195
158
  Smart Triaging:
196
159
  ✓ Risk Level: high
197
- Reason: High-risk authentication feature
198
- Agents activated: security, privacy, legal, architecture, typecheck
199
- ✓ Execution time: 8.2s
200
-
201
- Results:
202
- Score: 72/100 (needs work)
203
-
204
- 🔴 2 Critical Issues (require your review)
205
- 🟡 3 Serious Issues (can auto-fix)
206
- 🔵 2 Moderate Issues (can auto-fix)
207
-
208
- Critical Issues Preview:
209
- 1. Password stored without hashing (auth/signup.ts:23)
210
- Agent: Security | Confidence: 100%
211
- 2. PII stored in plain text (models/user.ts:15)
212
- Agent: Privacy | Confidence: 95%
160
+ Agents activated: security, soc2, privacy, architecture
161
+ Execution time: 3.2s
162
+
163
+ Results: 72/100
164
+
165
+ 🔴 2 Critical Issues
166
+ • Hardcoded API key (CC6.1) - src/api.ts:15
167
+ SQL injection risk - src/db.ts:42
168
+
169
+ 🟡 3 Serious Issues (auto-fixable)
170
+ 🔵 2 Moderate Issues
213
171
  ```
214
172
 
215
- ## Configuration (Optional)
173
+ ## Configuration
216
174
 
217
- Create `.trie/config.json` in your project root to customize behavior:
175
+ Create `.trie/config.json` to customize:
218
176
 
219
177
  ```json
220
178
  {
221
- "version": "1.0",
222
- "triaging": {
223
- "enabled": true,
224
- "riskThresholds": {
225
- "critical": 70,
226
- "high": 40,
227
- "medium": 20
228
- },
229
- "autoFixConfidence": 0.95
230
- },
231
179
  "agents": {
232
180
  "builtin": {
233
181
  "security": { "enabled": true },
234
- "privacy": { "enabled": true },
235
- "legal": { "enabled": true },
236
- "design-engineer": { "enabled": true }
182
+ "soc2": { "enabled": true },
183
+ "privacy": { "enabled": true }
237
184
  }
185
+ },
186
+ "compliance": {
187
+ "standards": ["GDPR", "CCPA", "SOC2"]
238
188
  }
239
189
  }
240
190
  ```
191
+ ## License
241
192
 
242
- ## Troubleshooting
243
-
244
- ### Agent not found
245
-
246
- **Problem:** Can't find the Trie Agent executable
247
-
248
- **Solution:** Make sure you have Node.js 18+ installed and try:
249
- ```bash
250
- npx @triedotdev/mcp --help
251
- ```
252
-
253
- ### No agents activating
254
-
255
- **Problem:** Scan runs but no agents are triggered
256
-
257
- **Solution:**
258
- - Check that your code matches patterns (auth, payments, UI, etc.)
259
- - Review the triaging logic in `.trie/config.json`
260
- - Try scanning a file with known issues (auth, payments, etc.)
261
-
262
- ### MCP connection fails
263
-
264
- **Problem:** Can't connect to Trie Agent server
265
-
266
- **Solution:**
267
- 1. Verify Node.js is installed: `node --version` (should be 18+)
268
- 2. Check the path in MCP config is correct
269
- 3. Restart your AI coding tool
270
- 4. Check console/logs for error messages
271
-
272
- ## Next Steps
273
-
274
- - **Try different code patterns** - Test with auth, payments, UI components
275
- - **Explore agents** - See which agents activate for different code types
276
- - **Use auto-fix** - Let Trie fix high-confidence issues automatically
277
- - **Generate tests** - Create comprehensive test suites
278
- - **Add custom agents** - Extend Trie with your own review logic
279
-
280
- ## Support
281
-
282
- - 📚 **Documentation**: [trie.dev/docs](https://trie.dev/docs)
283
- - 🐛 **Issues**: [GitHub Issues](https://github.com/Trie-OS/mcp-agent/issues)
284
- - 💬 **Community**: [Discord](https://discord.gg/trie-ai)
285
-
286
- ---
287
-
288
- **Ready to ship safer code?** Start scanning your AI-generated code now! 🚀
193
+ MIT