@hustle-together/api-dev-tools 1.0.0 → 1.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.
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)
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 `.claude/mcp-servers.json` and will be picked up by Claude Code on restart.
436
+
408
437
  ## šŸ“– Documentation
409
438
 
410
439
  After installation, see:
package/bin/cli.js CHANGED
@@ -233,6 +233,39 @@ function main() {
233
233
  }
234
234
  }
235
235
 
236
+ // ========================================
237
+ // 5. Install/Merge MCP Servers (Context7)
238
+ // ========================================
239
+ const mcpSource = path.join(sourceTemplatesDir, 'mcp-servers.json');
240
+ const mcpDest = path.join(claudeDir, 'mcp-servers.json');
241
+
242
+ if (fs.existsSync(mcpSource)) {
243
+ log('\nšŸ”Œ Configuring MCP servers:', 'cyan');
244
+
245
+ try {
246
+ const newMcp = JSON.parse(fs.readFileSync(mcpSource, 'utf8'));
247
+
248
+ if (fs.existsSync(mcpDest)) {
249
+ // Merge with existing MCP config
250
+ const existingMcp = JSON.parse(fs.readFileSync(mcpDest, 'utf8'));
251
+ const mergedMcp = mergeMcpServers(existingMcp, newMcp);
252
+ fs.writeFileSync(mcpDest, JSON.stringify(mergedMcp, null, 2));
253
+ log(' āœ… Merged Context7 into existing mcp-servers.json', 'green');
254
+ } else {
255
+ // Create new MCP config file
256
+ fs.writeFileSync(mcpDest, JSON.stringify(newMcp, null, 2));
257
+ log(' āœ… Created mcp-servers.json with Context7', 'green');
258
+ }
259
+
260
+ log('\n MCP servers configured:', 'blue');
261
+ log(' • context7 - Live documentation from library source code', 'blue');
262
+ log(' • github - GitHub issues, PRs, and repository access', 'blue');
263
+ log('\n āš ļø GitHub MCP requires GITHUB_PERSONAL_ACCESS_TOKEN in env', 'yellow');
264
+ } catch (error) {
265
+ log(` āŒ Failed to configure MCP servers: ${error.message}`, 'red');
266
+ }
267
+ }
268
+
236
269
  // ========================================
237
270
  // Success Summary
238
271
  // ========================================
@@ -245,6 +278,7 @@ function main() {
245
278
  log(' Hooks: .claude/hooks/*.py', 'blue');
246
279
  log(' Settings: .claude/settings.json', 'blue');
247
280
  log(' State: .claude/api-dev-state.json', 'blue');
281
+ log(' MCP: .claude/mcp-servers.json (Context7, GitHub)', 'blue');
248
282
 
249
283
  log('\nšŸ”’ Enforcement Features:', 'bright');
250
284
  log(' • Research MUST happen before code writing', 'cyan');
@@ -279,6 +313,25 @@ function main() {
279
313
  }
280
314
  }
281
315
 
316
+ /**
317
+ * Merge MCP server configurations
318
+ */
319
+ function mergeMcpServers(existing, newMcp) {
320
+ const merged = { ...existing };
321
+ merged.mcpServers = merged.mcpServers || {};
322
+
323
+ // Add new MCP servers that don't already exist
324
+ if (newMcp.mcpServers) {
325
+ for (const [name, config] of Object.entries(newMcp.mcpServers)) {
326
+ if (!merged.mcpServers[name]) {
327
+ merged.mcpServers[name] = config;
328
+ }
329
+ }
330
+ }
331
+
332
+ return merged;
333
+ }
334
+
282
335
  /**
283
336
  * Merge two settings objects, combining hooks arrays
284
337
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hustle-together/api-dev-tools",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "Interview-driven API development workflow for Claude Code - Automates research, testing, and documentation",
5
5
  "main": "bin/cli.js",
6
6
  "bin": {
@@ -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
+ }