@trikhub/mcp 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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +144 -0
  3. package/package.json +63 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Trikhub.com
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,144 @@
1
+ # @trikhub/mcp
2
+
3
+ An MCP (Model Context Protocol) server for AI-assisted trik authoring. Use your IDE's AI assistant (Claude Code, VS Code Copilot, etc.) to create, validate, and manage TrikHub triks.
4
+
5
+ ## Features
6
+
7
+ - **Guided trik creation** - Describe what you want, get a complete trik scaffold
8
+ - **Manifest validation** - Real-time feedback on security rules and schema correctness
9
+ - **Action design** - Interactive schema design with security warnings
10
+ - **Error diagnosis** - Understand and fix validation/publish errors
11
+ - **Documentation access** - Schema references and examples at your fingertips
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ # Via npm
17
+ npm install -g @trikhub/mcp
18
+
19
+ # Or via trik CLI
20
+ trik mcp
21
+ ```
22
+
23
+ ## Usage with Claude Code
24
+
25
+ Add to your Claude Code MCP settings (`~/.claude/settings.json`):
26
+
27
+ ```json
28
+ {
29
+ "mcpServers": {
30
+ "trikhub": {
31
+ "command": "npx",
32
+ "args": ["-y", "@trikhub/mcp"]
33
+ }
34
+ }
35
+ }
36
+ ```
37
+
38
+ Or if you have `@trikhub/mcp` installed globally:
39
+
40
+ ```json
41
+ {
42
+ "mcpServers": {
43
+ "trikhub": {
44
+ "command": "trikhub-mcp"
45
+ }
46
+ }
47
+ }
48
+ ```
49
+
50
+ Then restart Claude Code. You can now ask:
51
+ - "Create a trik that searches HackerNews"
52
+ - "Validate my manifest.json"
53
+ - "Why is my trik failing to publish?"
54
+
55
+ ## Usage with VS Code
56
+
57
+ Add to your VS Code MCP extension settings:
58
+
59
+ ```json
60
+ {
61
+ "mcp.servers": {
62
+ "trikhub": {
63
+ "command": "npx",
64
+ "args": ["-y", "@trikhub/mcp"]
65
+ }
66
+ }
67
+ }
68
+ ```
69
+
70
+ ## Quick Start via CLI
71
+
72
+ Run `trik mcp` to see configuration instructions and available tools:
73
+
74
+ ```bash
75
+ trik mcp # Show setup instructions
76
+ trik mcp --stdio # Start server in stdio mode
77
+ ```
78
+
79
+ ## Available Tools
80
+
81
+ | Tool | Description |
82
+ |------|-------------|
83
+ | `analyze_trik_requirements` | Analyze description and suggest architecture |
84
+ | `design_action` | Design action with proper schemas |
85
+ | `design_schema` | Create agentData/userContent schemas |
86
+ | `scaffold_trik` | Generate complete trik structure |
87
+ | `validate_manifest` | Validate manifest against rules |
88
+ | `diagnose_error` | Explain and fix errors |
89
+
90
+ ## Available Resources
91
+
92
+ | Resource | Description |
93
+ |----------|-------------|
94
+ | `trikhub://docs/manifest-schema` | Manifest JSON Schema reference |
95
+ | `trikhub://docs/security-model` | Type-Directed Privilege Separation guide |
96
+ | `trikhub://docs/response-modes` | Template vs passthrough explanation |
97
+ | `trikhub://examples/all` | Example trik patterns for common use cases |
98
+
99
+ ## Available Prompts
100
+
101
+ | Prompt | Description |
102
+ |--------|-------------|
103
+ | `create-trik` | Guided trik creation conversation |
104
+ | `debug-manifest` | Debug invalid manifests |
105
+ | `add-api-integration` | Add external API action |
106
+
107
+ ## Development
108
+
109
+ ```bash
110
+ # Clone the repo
111
+ git clone https://github.com/Molefas/trikhub.git
112
+ cd trikhub/packages/js/mcp
113
+
114
+ # Install dependencies
115
+ pnpm install
116
+
117
+ # Build
118
+ pnpm build
119
+
120
+ # Run in development mode
121
+ pnpm dev
122
+ ```
123
+
124
+ ## How It Works
125
+
126
+ The MCP server provides structured tools that guide you through trik creation:
127
+
128
+ 1. **Exploration** - `analyze_trik_requirements` understands your intent
129
+ 2. **Design** - `design_action` creates valid action schemas
130
+ 3. **Scaffold** - `scaffold_trik` generates the complete project
131
+ 4. **Validate** - `validate_manifest` ensures security compliance
132
+
133
+ The LLM orchestrates these tools through natural conversation, asking clarifying questions and iterating on designs.
134
+
135
+ ## Related Packages
136
+
137
+ - [@trikhub/cli](../cli) - Command-line tool for trik management
138
+ - [@trikhub/gateway](../gateway) - Secure trik execution gateway
139
+ - [@trikhub/manifest](../manifest) - Manifest types and validation
140
+ - [@trikhub/linter](../linter) - Static analysis for trik security
141
+
142
+ ## License
143
+
144
+ MIT
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@trikhub/mcp",
3
+ "version": "0.2.0",
4
+ "description": "MCP server for AI-assisted trik authoring",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "bin": {
9
+ "trikhub-mcp": "./dist/index.js"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "types": "./dist/index.d.ts"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "keywords": [
23
+ "ai",
24
+ "mcp",
25
+ "model-context-protocol",
26
+ "trik",
27
+ "trikhub",
28
+ "agent",
29
+ "authoring",
30
+ "typescript"
31
+ ],
32
+ "author": "Molefas",
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/Molefas/trikhub.git",
37
+ "directory": "packages/js/mcp"
38
+ },
39
+ "bugs": {
40
+ "url": "https://github.com/Molefas/trikhub/issues"
41
+ },
42
+ "homepage": "https://github.com/Molefas/trikhub/tree/main/packages/js/mcp#readme",
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "engines": {
47
+ "node": ">=18.0.0"
48
+ },
49
+ "dependencies": {
50
+ "@modelcontextprotocol/sdk": "^1.26.0",
51
+ "zod": "^3.25.0",
52
+ "@trikhub/manifest": "0.11.0",
53
+ "@trikhub/linter": "0.11.0"
54
+ },
55
+ "devDependencies": {
56
+ "tsx": "^4.19.0"
57
+ },
58
+ "scripts": {
59
+ "build": "tsc",
60
+ "dev": "node --import tsx src/index.ts",
61
+ "clean": "rm -rf dist *.tsbuildinfo"
62
+ }
63
+ }