@redaksjon/brennpunkt 0.0.2 → 0.1.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.
@@ -121,6 +121,48 @@ All tools read EXISTING coverage data (lcov.info) — they do NOT run tests.
121
121
  | `brennpunkt_get_file_coverage` | Detailed coverage for a specific file |
122
122
  | `brennpunkt_estimate_impact` | "If I test these files, will I hit 90%?" |
123
123
 
124
+ ### Available MCP Resources (NEW in v0.1.0)
125
+
126
+ Resources provide direct access to coverage data without tool calls, enabling AI assistants to read and analyze data more efficiently.
127
+
128
+ | Resource URI | Purpose |
129
+ |--------------|---------|
130
+ | `brennpunkt://coverage/{projectPath}` | Full coverage data as JSON for complex analysis |
131
+ | `brennpunkt://file/{projectPath}/{filePath}` | Detailed single-file coverage |
132
+ | `brennpunkt://priorities?project={path}&top={n}` | Pre-ranked priority list with filtering |
133
+ | `brennpunkt://config/{projectPath}` | Project configuration (yaml or defaults) |
134
+ | `brennpunkt://quick-wins?project={path}` | Small files with high impact potential |
135
+
136
+ **Why Resources?** Resources allow AI to:
137
+ - Read coverage data once and reason about it multiple times
138
+ - Perform complex analysis like "Compare branch coverage across all auth files"
139
+ - Access cacheable datasets that change infrequently
140
+ - Fetch multiple resources in parallel
141
+
142
+ ### Available MCP Prompts (NEW in v0.1.0)
143
+
144
+ Prompts are workflow templates that guide coverage improvement, transforming brennpunkt from a data provider to a coverage improvement partner.
145
+
146
+ | Prompt | Purpose | Key Arguments |
147
+ |--------|---------|---------------|
148
+ | `improve_coverage` | Complete workflow to reach target percentage | projectPath, targetPercentage, focusMetric |
149
+ | `analyze_gaps` | Understand patterns in coverage gaps | projectPath, targetPercentage |
150
+ | `quick_wins_workflow` | Find fast paths to improvement | projectPath, timeConstraint |
151
+ | `coverage_review` | Detailed review with test suggestions | projectPath, filePattern |
152
+
153
+ **Example Prompt Usage:**
154
+
155
+ ```
156
+ Human: I need to get to 90% coverage
157
+
158
+ AI: [invokes improve_coverage prompt with projectPath and targetPercentage=90]
159
+ AI: I'll help you reach 90% coverage. Let me check your current state...
160
+ AI: [calls brennpunkt_coverage_summary]
161
+ AI: You're at 82%, need 8% improvement...
162
+ AI: [calls brennpunkt_get_priorities]
163
+ AI: Here are the top 3 files to test: ...
164
+ ```
165
+
124
166
  ### Setting Up MCP
125
167
 
126
168
  #### 1. Install Brennpunkt
@@ -131,26 +173,26 @@ npm install -g @redaksjon/brennpunkt
131
173
 
132
174
  #### 2. Configure MCP Client (One-Time Setup)
133
175
 
134
- For **Cursor**, add to your MCP configuration:
176
+ Add to your MCP configuration (**Cursor** or **Claude Desktop**):
135
177
 
136
178
  ```json
137
179
  {
138
180
  "mcpServers": {
139
181
  "brennpunkt": {
140
- "command": "brennpunkt-mcp"
182
+ "command": "npx",
183
+ "args": ["-y", "-p", "@redaksjon/brennpunkt", "brennpunkt-mcp"]
141
184
  }
142
185
  }
143
186
  }
144
187
  ```
145
188
 
146
- For **Claude Desktop**, add to `claude_desktop_config.json`:
189
+ Or if installed globally (`npm install -g @redaksjon/brennpunkt`):
147
190
 
148
191
  ```json
149
192
  {
150
193
  "mcpServers": {
151
194
  "brennpunkt": {
152
- "command": "npx",
153
- "args": ["@redaksjon/brennpunkt-mcp"]
195
+ "command": "brennpunkt-mcp"
154
196
  }
155
197
  }
156
198
  }
package/guide/index.md CHANGED
@@ -100,7 +100,7 @@ If you're an AI helping someone improve test coverage:
100
100
  4. **Use JSON output**: Parse the structured data for precise guidance
101
101
  5. **Respect project config**: Projects may have custom `brennpunkt.yaml` with different weights
102
102
 
103
- > **MCP Server**: Run `brennpunkt-mcp` to start an MCP server that allows AI tools to query coverage data directly without running tests. See [AI Integration](./ai-integration.md) for details.
103
+ > **MCP Server**: Use `npx -p @redaksjon/brennpunkt brennpunkt-mcp` to start an MCP server that allows AI tools to query coverage data directly without running tests. See [AI Integration](./ai-integration.md) for details.
104
104
 
105
105
  ### Cursor Rule (Recommended)
106
106
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redaksjon/brennpunkt",
3
- "version": "0.0.2",
3
+ "version": "0.1.0",
4
4
  "description": "Coverage priority analyzer - identify where to focus testing efforts",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -31,8 +31,13 @@
31
31
  "lint": "eslint . --ext .ts",
32
32
  "lint:fix": "eslint . --ext .ts --fix",
33
33
  "clean": "rm -rf dist",
34
- "precommit": "npm run lint && npm run test",
35
- "prepublishOnly": "npm run clean && npm run build"
34
+ "precommit": "npm run lint && npm run test && npm run mcp:test",
35
+ "prepublishOnly": "npm run clean && npm run build",
36
+ "mcp:build": "npm run build && echo 'MCP server built'",
37
+ "mcp:inspect": "npm run build && npx @modelcontextprotocol/inspector dist/mcp/server.js",
38
+ "mcp:inspect:dev": "nodemon --watch src --ext ts --exec 'npm run mcp:inspect'",
39
+ "mcp:test": "node scripts/test-mcp-compliance.js",
40
+ "mcp:start": "node dist/mcp/server.js"
36
41
  },
37
42
  "keywords": [
38
43
  "coverage",
@@ -59,9 +64,10 @@
59
64
  "devDependencies": {
60
65
  "@eslint/eslintrc": "^3.3.1",
61
66
  "@eslint/js": "^9.39.1",
67
+ "@modelcontextprotocol/inspector": "^0.18.0",
62
68
  "@rollup/plugin-replace": "^6.0.3",
63
69
  "@swc/core": "^1.15.1",
64
- "@types/node": "^24.10.1",
70
+ "@types/node": "^25.0.9",
65
71
  "@typescript-eslint/eslint-plugin": "^8.46.4",
66
72
  "@typescript-eslint/parser": "^8.46.4",
67
73
  "@vitest/coverage-v8": "^4.0.8",