@goonnguyen/human-mcp 1.3.0 → 2.0.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 (128) hide show
  1. package/README.md +261 -19
  2. package/bin/human-mcp.js +2 -0
  3. package/dist/index.js +65180 -1698
  4. package/package.json +19 -2
  5. package/.claude/agents/code-reviewer.md +0 -140
  6. package/.claude/agents/database-admin.md +0 -86
  7. package/.claude/agents/debugger.md +0 -119
  8. package/.claude/agents/docs-manager.md +0 -113
  9. package/.claude/agents/git-manager.md +0 -59
  10. package/.claude/agents/planner-researcher.md +0 -97
  11. package/.claude/agents/project-manager.md +0 -113
  12. package/.claude/agents/tester.md +0 -95
  13. package/.claude/commands/cook.md +0 -7
  14. package/.claude/commands/debug.md +0 -10
  15. package/.claude/commands/docs/init.md +0 -11
  16. package/.claude/commands/docs/update.md +0 -11
  17. package/.claude/commands/fix/ci.md +0 -8
  18. package/.claude/commands/fix/fast.md +0 -5
  19. package/.claude/commands/fix/hard.md +0 -7
  20. package/.claude/commands/fix/test.md +0 -16
  21. package/.claude/commands/git/cm.md +0 -5
  22. package/.claude/commands/git/cp.md +0 -4
  23. package/.claude/commands/plan/ci.md +0 -12
  24. package/.claude/commands/plan/two.md +0 -13
  25. package/.claude/commands/plan.md +0 -10
  26. package/.claude/commands/test.md +0 -7
  27. package/.claude/commands/watzup.md +0 -8
  28. package/.claude/hooks/telegram_notify.sh +0 -136
  29. package/.claude/send-discord.sh +0 -64
  30. package/.claude/settings.json +0 -7
  31. package/.claude/statusline.sh +0 -143
  32. package/.dockerignore +0 -81
  33. package/.env.example +0 -44
  34. package/.github/workflows/publish.yml +0 -88
  35. package/.opencode/agent/code-reviewer.md +0 -142
  36. package/.opencode/agent/debugger.md +0 -74
  37. package/.opencode/agent/docs-manager.md +0 -119
  38. package/.opencode/agent/git-manager.md +0 -60
  39. package/.opencode/agent/planner-researcher.md +0 -100
  40. package/.opencode/agent/project-manager.md +0 -113
  41. package/.opencode/agent/system-architecture.md +0 -200
  42. package/.opencode/agent/tester.md +0 -96
  43. package/.opencode/agent/ui-ux-developer.md +0 -97
  44. package/.opencode/command/cook.md +0 -7
  45. package/.opencode/command/debug.md +0 -10
  46. package/.opencode/command/fix/ci.md +0 -8
  47. package/.opencode/command/fix/fast.md +0 -5
  48. package/.opencode/command/fix/hard.md +0 -7
  49. package/.opencode/command/fix/test.md +0 -16
  50. package/.opencode/command/git/cm.md +0 -5
  51. package/.opencode/command/git/cp.md +0 -4
  52. package/.opencode/command/plan/ci.md +0 -12
  53. package/.opencode/command/plan/two.md +0 -13
  54. package/.opencode/command/plan.md +0 -10
  55. package/.opencode/command/test.md +0 -7
  56. package/.opencode/command/watzup.md +0 -8
  57. package/.releaserc.json +0 -26
  58. package/.serena/project.yml +0 -68
  59. package/CHANGELOG.md +0 -62
  60. package/CLAUDE.md +0 -141
  61. package/DEPLOYMENT.md +0 -329
  62. package/Dockerfile +0 -52
  63. package/QUICKSTART.md +0 -97
  64. package/bun.lock +0 -1872
  65. package/bunfig.toml +0 -15
  66. package/docker-compose.yaml +0 -128
  67. package/docs/README.md +0 -51
  68. package/docs/codebase-structure-architecture-code-standards.md +0 -428
  69. package/docs/codebase-summary.md +0 -321
  70. package/docs/project-overview-pdr.md +0 -286
  71. package/docs/project-roadmap.md +0 -494
  72. package/examples/debugging-session.ts +0 -96
  73. package/human-mcp.png +0 -0
  74. package/inspector-wrapper.mjs +0 -33
  75. package/plans/001-streamable-http-transport-plan.md +0 -905
  76. package/plans/002-sse-fallback-http-transport-plan.md +0 -161
  77. package/plans/003-fix-test-infrastructure-and-ci-plan.md +0 -699
  78. package/plans/003-http-transport-local-file-access-plan.md +0 -880
  79. package/plans/004-fix-typescript-compilation-errors-plan.md +0 -388
  80. package/plans/005-comprehensive-test-infrastructure-fix-plan.md +0 -854
  81. package/plans/templates/bug-fix-template.md +0 -69
  82. package/plans/templates/feature-implementation-template.md +0 -84
  83. package/plans/templates/refactor-template.md +0 -82
  84. package/plans/templates/template-usage-guide.md +0 -58
  85. package/src/index.ts +0 -49
  86. package/src/prompts/debugging-prompts.ts +0 -149
  87. package/src/prompts/index.ts +0 -55
  88. package/src/resources/documentation.ts +0 -316
  89. package/src/resources/index.ts +0 -49
  90. package/src/server.ts +0 -36
  91. package/src/tools/eyes/index.ts +0 -225
  92. package/src/tools/eyes/processors/gif.ts +0 -137
  93. package/src/tools/eyes/processors/image.ts +0 -213
  94. package/src/tools/eyes/processors/video.ts +0 -135
  95. package/src/tools/eyes/schemas.ts +0 -51
  96. package/src/tools/eyes/utils/formatters.ts +0 -126
  97. package/src/tools/eyes/utils/gemini-client.ts +0 -73
  98. package/src/transports/http/file-interceptor.ts +0 -134
  99. package/src/transports/http/middleware.ts +0 -46
  100. package/src/transports/http/routes.ts +0 -297
  101. package/src/transports/http/server.ts +0 -116
  102. package/src/transports/http/session.ts +0 -93
  103. package/src/transports/http/sse-routes.ts +0 -210
  104. package/src/transports/index.ts +0 -36
  105. package/src/transports/stdio.ts +0 -7
  106. package/src/transports/types.ts +0 -50
  107. package/src/types/index.ts +0 -41
  108. package/src/utils/cloudflare-r2.ts +0 -107
  109. package/src/utils/config.ts +0 -123
  110. package/src/utils/errors.ts +0 -40
  111. package/src/utils/logger.ts +0 -49
  112. package/tests/integration/http-transport-files.test.ts +0 -190
  113. package/tests/integration/server.test.ts +0 -27
  114. package/tests/integration/sse-transport.test.ts +0 -142
  115. package/tests/setup.ts +0 -55
  116. package/tests/types/api-responses.ts +0 -35
  117. package/tests/types/test-types.ts +0 -105
  118. package/tests/unit/cloudflare-r2.test.ts +0 -118
  119. package/tests/unit/config.test.ts +0 -40
  120. package/tests/unit/eyes-analyze.test.ts +0 -150
  121. package/tests/unit/formatters.test.ts +0 -85
  122. package/tests/unit/sse-routes.test.ts +0 -92
  123. package/tests/utils/error-scenarios.ts +0 -198
  124. package/tests/utils/index.ts +0 -3
  125. package/tests/utils/mock-helpers.ts +0 -99
  126. package/tests/utils/test-data-generators.ts +0 -217
  127. package/tests/utils/test-server-manager.ts +0 -172
  128. package/tsconfig.json +0 -26
package/DEPLOYMENT.md DELETED
@@ -1,329 +0,0 @@
1
- # Human MCP Server - VPS Deployment Guide
2
-
3
- This guide explains how to deploy the Human MCP Server on a VPS using Docker and Docker Compose.
4
-
5
- ## Prerequisites
6
-
7
- - VPS with Docker and Docker Compose installed
8
- - Domain name (optional, for SSL/HTTPS)
9
- - Google Gemini API key
10
-
11
- ## Quick Start
12
-
13
- ### 1. Clone the Repository
14
-
15
- ```bash
16
- git clone <your-repo-url>
17
- cd human-mcp
18
- ```
19
-
20
- ### 2. Configure Environment
21
-
22
- ```bash
23
- # Copy the production environment template
24
- cp .env.production .env
25
-
26
- # Edit the configuration
27
- nano .env
28
- ```
29
-
30
- **Required Configuration:**
31
- - Set your `GOOGLE_GEMINI_API_KEY`
32
- - Update `DOMAIN` if using Traefik with SSL
33
- - Set `ACME_EMAIL` for Let's Encrypt certificates
34
-
35
- ### 3. Deploy with Docker Compose
36
-
37
- #### Basic Deployment (HTTP only)
38
- ```bash
39
- docker-compose up -d human-mcp
40
- ```
41
-
42
- #### Production Deployment (with HTTPS and Traefik)
43
- ```bash
44
- # Create necessary directories
45
- mkdir -p data letsencrypt
46
-
47
- # Deploy with Traefik reverse proxy
48
- docker-compose --profile proxy up -d
49
- ```
50
-
51
- #### With Redis (for session scaling)
52
- ```bash
53
- docker-compose --profile redis --profile proxy up -d
54
- ```
55
-
56
- ## Deployment Options
57
-
58
- ### Option 1: Basic HTTP Deployment
59
-
60
- Suitable for development or internal networks.
61
-
62
- ```bash
63
- # Just the MCP server
64
- docker-compose up -d human-mcp
65
- ```
66
-
67
- Access: `http://your-server-ip:3000`
68
-
69
- ### Option 2: Production HTTPS Deployment
70
-
71
- Includes Traefik reverse proxy with automatic SSL certificates.
72
-
73
- ```bash
74
- # Full production stack
75
- docker-compose --profile proxy up -d
76
- ```
77
-
78
- Access: `https://your-domain.com`
79
-
80
- ### Option 3: Scalable Deployment
81
-
82
- Adds Redis for session storage (enables horizontal scaling).
83
-
84
- ```bash
85
- # Production with Redis
86
- docker-compose --profile redis --profile proxy up -d
87
- ```
88
-
89
- ## Configuration Guide
90
-
91
- ### Environment Variables
92
-
93
- Key environment variables in `.env`:
94
-
95
- ```bash
96
- # Core
97
- GOOGLE_GEMINI_API_KEY=your_api_key_here
98
- DOMAIN=your-domain.com
99
- ACME_EMAIL=admin@your-domain.com
100
-
101
- # Security
102
- HTTP_CORS_ORIGINS=https://your-domain.com
103
- HTTP_ALLOWED_HOSTS=127.0.0.1,localhost,your-domain.com
104
- HTTP_SECRET=your_secret_token_here
105
-
106
- # Performance
107
- HTTP_ENABLE_RATE_LIMITING=true
108
- RATE_LIMIT_REQUESTS=100
109
- LOG_LEVEL=warn
110
- ```
111
-
112
- ### Security Recommendations
113
-
114
- 1. **Set Authentication Secret**
115
- ```bash
116
- HTTP_SECRET=your_strong_secret_here
117
- ```
118
-
119
- 2. **Limit CORS Origins**
120
- ```bash
121
- HTTP_CORS_ORIGINS=https://your-domain.com,https://app.your-domain.com
122
- ```
123
-
124
- 3. **Configure Allowed Hosts**
125
- ```bash
126
- HTTP_ALLOWED_HOSTS=127.0.0.1,localhost,your-domain.com
127
- ```
128
-
129
- 4. **Enable Rate Limiting**
130
- ```bash
131
- HTTP_ENABLE_RATE_LIMITING=true
132
- RATE_LIMIT_REQUESTS=100
133
- RATE_LIMIT_WINDOW=60000
134
- ```
135
-
136
- ## Server Management
137
-
138
- ### Start Services
139
- ```bash
140
- docker-compose up -d
141
- ```
142
-
143
- ### Stop Services
144
- ```bash
145
- docker-compose down
146
- ```
147
-
148
- ### View Logs
149
- ```bash
150
- # All services
151
- docker-compose logs -f
152
-
153
- # Specific service
154
- docker-compose logs -f human-mcp
155
- ```
156
-
157
- ### Update Deployment
158
- ```bash
159
- # Rebuild and restart
160
- docker-compose down
161
- docker-compose build --no-cache
162
- docker-compose up -d
163
- ```
164
-
165
- ### Health Check
166
- ```bash
167
- # Check service health
168
- curl http://localhost:3000/health
169
-
170
- # Or with domain
171
- curl https://your-domain.com/health
172
- ```
173
-
174
- ## API Usage
175
-
176
- ### Initialize Session
177
- ```bash
178
- curl -X POST https://your-domain.com/mcp \
179
- -H "Content-Type: application/json" \
180
- -H "Accept: application/json, text/event-stream" \
181
- -d '{
182
- "jsonrpc": "2.0",
183
- "method": "initialize",
184
- "params": {
185
- "protocolVersion": "2025-03-26",
186
- "capabilities": {},
187
- "clientInfo": {
188
- "name": "your-client",
189
- "version": "1.0.0"
190
- }
191
- },
192
- "id": 1
193
- }'
194
- ```
195
-
196
- ### List Available Tools
197
- ```bash
198
- curl -X POST https://your-domain.com/mcp \
199
- -H "Content-Type: application/json" \
200
- -H "Mcp-Session-Id: YOUR_SESSION_ID" \
201
- -d '{
202
- "jsonrpc": "2.0",
203
- "method": "tools/list",
204
- "params": {},
205
- "id": 2
206
- }'
207
- ```
208
-
209
- ## Monitoring
210
-
211
- ### Resource Usage
212
- ```bash
213
- # Check container stats
214
- docker stats human-mcp-server
215
-
216
- # Check logs for errors
217
- docker-compose logs human-mcp | grep ERROR
218
- ```
219
-
220
- ### Health Monitoring
221
- The service includes health checks accessible at `/health`:
222
-
223
- ```bash
224
- # Check health
225
- curl https://your-domain.com/health
226
-
227
- # Expected response
228
- {
229
- "status": "healthy",
230
- "transport": "streamable-http"
231
- }
232
- ```
233
-
234
- ## Troubleshooting
235
-
236
- ### Common Issues
237
-
238
- 1. **Container won't start**
239
- ```bash
240
- # Check logs
241
- docker-compose logs human-mcp
242
-
243
- # Verify configuration
244
- docker-compose config
245
- ```
246
-
247
- 2. **SSL certificate issues**
248
- ```bash
249
- # Check Traefik logs
250
- docker-compose logs traefik
251
-
252
- # Verify domain DNS points to server
253
- nslookup your-domain.com
254
- ```
255
-
256
- 3. **API requests failing**
257
- ```bash
258
- # Check CORS and allowed hosts
259
- # Verify API key is set correctly
260
- # Check rate limiting settings
261
- ```
262
-
263
- ### Service Restart
264
- ```bash
265
- # Restart specific service
266
- docker-compose restart human-mcp
267
-
268
- # Restart all services
269
- docker-compose restart
270
- ```
271
-
272
- ### Clean Deployment
273
- ```bash
274
- # Stop and remove containers
275
- docker-compose down -v
276
-
277
- # Remove images
278
- docker-compose down --rmi all
279
-
280
- # Fresh deployment
281
- docker-compose up -d --build
282
- ```
283
-
284
- ## Performance Tuning
285
-
286
- ### Resource Limits
287
- Adjust in `docker-compose.yaml`:
288
-
289
- ```yaml
290
- deploy:
291
- resources:
292
- limits:
293
- cpus: '2.0'
294
- memory: 2G
295
- reservations:
296
- cpus: '1.0'
297
- memory: 1G
298
- ```
299
-
300
- ### Scaling
301
- For high traffic, consider:
302
-
303
- 1. Enable Redis for session storage
304
- 2. Use multiple MCP server instances
305
- 3. Configure load balancing in Traefik
306
- 4. Monitor resource usage and scale accordingly
307
-
308
- ## Backup
309
-
310
- ### Important Data
311
- - Environment configuration (`.env`)
312
- - SSL certificates (`letsencrypt/`)
313
- - Application data (`data/`)
314
-
315
- ### Backup Commands
316
- ```bash
317
- # Create backup
318
- tar -czf human-mcp-backup-$(date +%Y%m%d).tar.gz .env letsencrypt/ data/
319
-
320
- # Restore backup
321
- tar -xzf human-mcp-backup-YYYYMMDD.tar.gz
322
- ```
323
-
324
- ## Support
325
-
326
- - Check application logs for errors
327
- - Verify environment configuration
328
- - Ensure all required services are running
329
- - Test health endpoint accessibility
package/Dockerfile DELETED
@@ -1,52 +0,0 @@
1
- # Human MCP Server - Production Dockerfile
2
- FROM oven/bun:1-alpine AS base
3
-
4
- # Install system dependencies needed for video processing
5
- RUN apk add --no-cache \
6
- ffmpeg \
7
- ca-certificates \
8
- dumb-init \
9
- wget
10
-
11
- WORKDIR /app
12
-
13
- # Copy package files
14
- COPY package.json bun.lock ./
15
-
16
- # Install dependencies (production only)
17
- RUN bun install --frozen-lockfile --production
18
-
19
- # Copy source code
20
- COPY . .
21
-
22
- # Build the application
23
- RUN bun run build
24
-
25
- # Create a non-root user for security
26
- RUN addgroup -g 1001 -S nodejs && \
27
- adduser -S mcp -u 1001
28
-
29
- # Change ownership of the app directory
30
- RUN chown -R mcp:nodejs /app
31
- USER mcp
32
-
33
- # Set production environment variables
34
- ENV NODE_ENV=production
35
- ENV TRANSPORT_TYPE=http
36
- ENV HTTP_PORT=3000
37
- ENV HTTP_HOST=0.0.0.0
38
- ENV HTTP_SESSION_MODE=stateful
39
- ENV HTTP_CORS_ENABLED=true
40
-
41
- # Expose the port
42
- EXPOSE 3000
43
-
44
- # Health check using the /health endpoint
45
- HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
46
- CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
47
-
48
- # Use dumb-init to handle signals properly
49
- ENTRYPOINT ["dumb-init", "--"]
50
-
51
- # Start the server
52
- CMD ["bun", "run", "dist/index.js"]
package/QUICKSTART.md DELETED
@@ -1,97 +0,0 @@
1
- # Human MCP Quickstart Guide
2
-
3
- Get up and running with Human MCP in less than 5 minutes!
4
-
5
- ## 🚀 Quick Installation
6
-
7
- ```bash
8
- # 1. Clone and install
9
- git clone https://github.com/human-mcp/human-mcp.git
10
- cd human-mcp
11
- bun install
12
-
13
- # 2. Set up environment
14
- cp .env.example .env
15
- # Edit .env and add your GOOGLE_GEMINI_API_KEY
16
-
17
- # 3. Start the server
18
- bun run dev
19
- ```
20
-
21
- ## 📱 Configuration for Claude Desktop
22
-
23
- Add this to your Claude Desktop config file:
24
-
25
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
26
- **Windows**: `%APPDATA%/Claude/claude_desktop_config.json`
27
-
28
- ```json
29
- {
30
- "mcpServers": {
31
- "human-mcp": {
32
- "command": "bun",
33
- "args": ["run", "/path/to/human-mcp/src/index.ts"],
34
- "env": {
35
- "GOOGLE_GEMINI_API_KEY": "your_actual_api_key_here"
36
- }
37
- }
38
- }
39
- }
40
- ```
41
-
42
- ## 🔧 Get Your Gemini API Key
43
-
44
- 1. Visit [Google AI Studio](https://aistudio.google.com/)
45
- 2. Click "Get API Key"
46
- 3. Create a new project or use existing one
47
- 4. Copy your API key
48
-
49
- ## ✅ Test Your Installation
50
-
51
- Try this in Claude Desktop:
52
-
53
- ```
54
- Can you analyze this screenshot for UI bugs?
55
- [Upload a screenshot]
56
- ```
57
-
58
- Human MCP should analyze the image and provide detailed debugging insights!
59
-
60
- ## 🎯 Common Use Cases
61
-
62
- ### Debug UI Issues
63
- ```
64
- Use the eyes_analyze tool with this screenshot:
65
- - Type: image
66
- - Analysis type: ui_debug
67
- - Detail level: detailed
68
- ```
69
-
70
- ### Analyze Error Recordings
71
- ```
72
- Use the eyes_analyze tool with this screen recording:
73
- - Type: video
74
- - Analysis type: error_detection
75
- - Focus on: the error sequence
76
- ```
77
-
78
- ### Check Accessibility
79
- ```
80
- Use the eyes_analyze tool:
81
- - Analysis type: accessibility
82
- - Check accessibility: true
83
- ```
84
-
85
- ## 🆘 Troubleshooting
86
-
87
- **"Tool not found"** → Restart Claude Desktop after config changes
88
- **"API key error"** → Check your GOOGLE_GEMINI_API_KEY in .env or config
89
- **"Permission denied"** → Make sure bun is installed and executable
90
-
91
- ## 📖 Next Steps
92
-
93
- - Read the full [README.md](README.md) for detailed documentation
94
- - Try the [example debugging session](examples/debugging-session.ts)
95
- - Check out the [API documentation](src/resources/documentation.ts)
96
-
97
- Happy debugging! 🐛✨