@hustle-together/api-dev-tools 1.0.0 ā 1.2.1
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 +29 -0
- package/bin/cli.js +55 -0
- package/package.json +1 -1
- package/templates/mcp-servers.json +15 -0
package/README.md
CHANGED
|
@@ -35,6 +35,10 @@ Three Python hooks that provide **real programmatic guarantees**:
|
|
|
35
35
|
### State Tracking
|
|
36
36
|
- **`.claude/api-dev-state.json`** - Persistent state file tracking all workflow progress
|
|
37
37
|
|
|
38
|
+
### MCP Servers (Auto-configured in `.mcp.json`)
|
|
39
|
+
- **Context7** - Fetches LIVE documentation from library source code (not training data)
|
|
40
|
+
- **GitHub** - Read/create issues, pull requests, and access repository data (requires `GITHUB_PERSONAL_ACCESS_TOKEN`)
|
|
41
|
+
|
|
38
42
|
## šÆ Why Use This?
|
|
39
43
|
|
|
40
44
|
### Problems This Solves
|
|
@@ -405,6 +409,31 @@ The `.claude/api-dev-state.json` file tracks:
|
|
|
405
409
|
- **Claude Code** (CLI tool for Claude)
|
|
406
410
|
- **Project structure** with `.claude/commands/` support
|
|
407
411
|
|
|
412
|
+
## š MCP Servers
|
|
413
|
+
|
|
414
|
+
This package auto-configures two MCP servers:
|
|
415
|
+
|
|
416
|
+
### Context7
|
|
417
|
+
- **Live documentation lookup** from library source code
|
|
418
|
+
- **Current API parameters** (not outdated training data)
|
|
419
|
+
- **TypeScript type definitions** directly from packages
|
|
420
|
+
|
|
421
|
+
When you research a library like `@ai-sdk/core`, Context7 fetches the actual current documentation rather than relying on Claude's training data which may be outdated.
|
|
422
|
+
|
|
423
|
+
### GitHub
|
|
424
|
+
- **Issue management** - Read and create GitHub issues
|
|
425
|
+
- **Pull requests** - Create PRs with proper formatting
|
|
426
|
+
- **Repository access** - Browse repo contents and metadata
|
|
427
|
+
|
|
428
|
+
Required for `/pr` and `/issue` commands to work with GitHub MCP tools.
|
|
429
|
+
|
|
430
|
+
**Setup:** Set `GITHUB_PERSONAL_ACCESS_TOKEN` in your environment:
|
|
431
|
+
```bash
|
|
432
|
+
export GITHUB_PERSONAL_ACCESS_TOKEN=ghp_your_token_here
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
The MCP configuration is written to `.mcp.json` in your project root and will be picked up by Claude Code on restart. First use will prompt for security approval.
|
|
436
|
+
|
|
408
437
|
## š Documentation
|
|
409
438
|
|
|
410
439
|
After installation, see:
|
package/bin/cli.js
CHANGED
|
@@ -233,6 +233,41 @@ function main() {
|
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
+
// ========================================
|
|
237
|
+
// 5. Install/Merge MCP Servers (Context7, GitHub)
|
|
238
|
+
// ========================================
|
|
239
|
+
// NOTE: Claude Code uses .mcp.json in project root, NOT .claude/mcp-servers.json
|
|
240
|
+
const mcpSource = path.join(sourceTemplatesDir, 'mcp-servers.json');
|
|
241
|
+
const mcpDest = path.join(targetDir, '.mcp.json');
|
|
242
|
+
|
|
243
|
+
if (fs.existsSync(mcpSource)) {
|
|
244
|
+
log('\nš Configuring MCP servers:', 'cyan');
|
|
245
|
+
|
|
246
|
+
try {
|
|
247
|
+
const newMcp = JSON.parse(fs.readFileSync(mcpSource, 'utf8'));
|
|
248
|
+
|
|
249
|
+
if (fs.existsSync(mcpDest)) {
|
|
250
|
+
// Merge with existing MCP config
|
|
251
|
+
const existingMcp = JSON.parse(fs.readFileSync(mcpDest, 'utf8'));
|
|
252
|
+
const mergedMcp = mergeMcpServers(existingMcp, newMcp);
|
|
253
|
+
fs.writeFileSync(mcpDest, JSON.stringify(mergedMcp, null, 2));
|
|
254
|
+
log(' ā
Merged into existing .mcp.json', 'green');
|
|
255
|
+
} else {
|
|
256
|
+
// Create new MCP config file
|
|
257
|
+
fs.writeFileSync(mcpDest, JSON.stringify(newMcp, null, 2));
|
|
258
|
+
log(' ā
Created .mcp.json in project root', 'green');
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
log('\n MCP servers configured:', 'blue');
|
|
262
|
+
log(' ⢠context7 - Live documentation from library source code', 'blue');
|
|
263
|
+
log(' ⢠github - GitHub issues, PRs, and repository access', 'blue');
|
|
264
|
+
log('\n ā ļø GitHub MCP requires GITHUB_PERSONAL_ACCESS_TOKEN in env', 'yellow');
|
|
265
|
+
log(' ā ļø First use will prompt for security approval', 'yellow');
|
|
266
|
+
} catch (error) {
|
|
267
|
+
log(` ā Failed to configure MCP servers: ${error.message}`, 'red');
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
236
271
|
// ========================================
|
|
237
272
|
// Success Summary
|
|
238
273
|
// ========================================
|
|
@@ -245,6 +280,7 @@ function main() {
|
|
|
245
280
|
log(' Hooks: .claude/hooks/*.py', 'blue');
|
|
246
281
|
log(' Settings: .claude/settings.json', 'blue');
|
|
247
282
|
log(' State: .claude/api-dev-state.json', 'blue');
|
|
283
|
+
log(' MCP: .mcp.json (Context7, GitHub)', 'blue');
|
|
248
284
|
|
|
249
285
|
log('\nš Enforcement Features:', 'bright');
|
|
250
286
|
log(' ⢠Research MUST happen before code writing', 'cyan');
|
|
@@ -279,6 +315,25 @@ function main() {
|
|
|
279
315
|
}
|
|
280
316
|
}
|
|
281
317
|
|
|
318
|
+
/**
|
|
319
|
+
* Merge MCP server configurations
|
|
320
|
+
*/
|
|
321
|
+
function mergeMcpServers(existing, newMcp) {
|
|
322
|
+
const merged = { ...existing };
|
|
323
|
+
merged.mcpServers = merged.mcpServers || {};
|
|
324
|
+
|
|
325
|
+
// Add new MCP servers that don't already exist
|
|
326
|
+
if (newMcp.mcpServers) {
|
|
327
|
+
for (const [name, config] of Object.entries(newMcp.mcpServers)) {
|
|
328
|
+
if (!merged.mcpServers[name]) {
|
|
329
|
+
merged.mcpServers[name] = config;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
return merged;
|
|
335
|
+
}
|
|
336
|
+
|
|
282
337
|
/**
|
|
283
338
|
* Merge two settings objects, combining hooks arrays
|
|
284
339
|
*/
|
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"context7": {
|
|
4
|
+
"command": "npx",
|
|
5
|
+
"args": ["-y", "@upstash/context7-mcp"]
|
|
6
|
+
},
|
|
7
|
+
"github": {
|
|
8
|
+
"command": "npx",
|
|
9
|
+
"args": ["-y", "@modelcontextprotocol/server-github"],
|
|
10
|
+
"env": {
|
|
11
|
+
"GITHUB_PERSONAL_ACCESS_TOKEN": ""
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|