vantage-peers-mcp 2.0.2 → 2.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 +126 -0
- package/dist/server-http.d.ts +27 -0
- package/dist/server-http.js +515 -0
- package/dist/server.js +59 -5
- package/dist/src/auth.d.ts +73 -0
- package/dist/src/auth.js +271 -0
- package/dist/src/tools.d.ts +49 -0
- package/dist/src/tools.js +3250 -0
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -93,6 +93,104 @@ The server also reads `CONVEX_URL` from `.env.local` in the parent directory if
|
|
|
93
93
|
### Fix Patterns (5)
|
|
94
94
|
`create_fix_pattern`, `list_fix_patterns`, `add_fix_attempt`, `validate_fix`, `link_issue_to_pattern`
|
|
95
95
|
|
|
96
|
+
#### `create_fix_pattern`
|
|
97
|
+
Create a new fix pattern in the knowledge base. Documents a bug symptom, root cause, and optional validated fix. Agents search the KB before fixing to avoid repeating known mistakes.
|
|
98
|
+
|
|
99
|
+
| Arg | Type | Required | Description |
|
|
100
|
+
|-----|------|----------|-------------|
|
|
101
|
+
| `symptom` | string | yes | What the bug looks like — the user-visible problem |
|
|
102
|
+
| `rootCause` | string | yes | Why the bug happens — the underlying technical cause |
|
|
103
|
+
| `tags` | string or string[] | yes | Tags for categorization (e.g. `"react-hydration"`) |
|
|
104
|
+
| `stack` | string or string[] | yes | Tech stack involved (e.g. `"next.js"`, `"convex"`) |
|
|
105
|
+
| `sourceProject` | string | yes | Project where this was discovered |
|
|
106
|
+
| `createdBy` | string | yes | Orchestrator name (e.g. `"sigma"`) |
|
|
107
|
+
| `severity` | string | yes | `"critical"`, `"major"`, or `"minor"` |
|
|
108
|
+
| `validatedFix` | string | no | The fix that worked — set later if not yet known |
|
|
109
|
+
| `files` | string or string[] | no | Files involved in the fix |
|
|
110
|
+
| `linkedIssueIds` | string or string[] | no | VantagePeers issue IDs linked to this pattern |
|
|
111
|
+
|
|
112
|
+
Example:
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"tool": "create_fix_pattern",
|
|
116
|
+
"arguments": {
|
|
117
|
+
"symptom": "Convex subscription silently drops after 60s of inactivity",
|
|
118
|
+
"rootCause": "Missing keepAlive ping in useConvexQuery wrapper",
|
|
119
|
+
"tags": ["convex-subscription", "silent-failure"],
|
|
120
|
+
"stack": ["next.js", "convex"],
|
|
121
|
+
"sourceProject": "myreeldream",
|
|
122
|
+
"createdBy": "sigma",
|
|
123
|
+
"severity": "major",
|
|
124
|
+
"validatedFix": "Add 30s ping interval to the subscription hook"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
#### `add_fix_attempt`
|
|
130
|
+
Log a fix attempt against an existing pattern. Documents what was tried, whether it worked, and why. If `worked: true` and the pattern has no `validatedFix`, auto-sets it.
|
|
131
|
+
|
|
132
|
+
| Arg | Type | Required | Description |
|
|
133
|
+
|-----|------|----------|-------------|
|
|
134
|
+
| `patternId` | string | yes | ID of the fix pattern |
|
|
135
|
+
| `description` | string | yes | What was tried — the fix approach |
|
|
136
|
+
| `worked` | boolean | yes | Whether this fix resolved the issue |
|
|
137
|
+
| `why` | string | yes | Why it worked or did not — the reasoning |
|
|
138
|
+
| `createdBy` | string | yes | Orchestrator name |
|
|
139
|
+
| `commit` | string | no | Git commit hash of this attempt |
|
|
140
|
+
|
|
141
|
+
Example:
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"tool": "add_fix_attempt",
|
|
145
|
+
"arguments": {
|
|
146
|
+
"patternId": "k5708d9xxwj81v92e0x3hwv36985g4d7",
|
|
147
|
+
"description": "Added 30s ping interval to useConvexQuery",
|
|
148
|
+
"worked": true,
|
|
149
|
+
"why": "Keeps the WebSocket connection alive past the server idle timeout",
|
|
150
|
+
"createdBy": "sigma",
|
|
151
|
+
"commit": "e866274"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
#### `validate_fix`
|
|
157
|
+
Promote a candidate fix to validated status on an existing pattern. Use after independently confirming the fix holds in production.
|
|
158
|
+
|
|
159
|
+
| Arg | Type | Required | Description |
|
|
160
|
+
|-----|------|----------|-------------|
|
|
161
|
+
| `patternId` | string | yes | ID of the fix pattern |
|
|
162
|
+
| `validatedFix` | string | yes | Description of the validated fix |
|
|
163
|
+
|
|
164
|
+
Example:
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"tool": "validate_fix",
|
|
168
|
+
"arguments": {
|
|
169
|
+
"patternId": "k5708d9xxwj81v92e0x3hwv36985g4d7",
|
|
170
|
+
"validatedFix": "30s ping interval in subscription hook — verified stable over 48h in production"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
#### `link_issue_to_pattern`
|
|
176
|
+
Link a VantagePeers issue to a fix pattern. Creates a bidirectional reference so the issue and pattern are discoverable from each other.
|
|
177
|
+
|
|
178
|
+
| Arg | Type | Required | Description |
|
|
179
|
+
|-----|------|----------|-------------|
|
|
180
|
+
| `patternId` | string | yes | ID of the fix pattern |
|
|
181
|
+
| `issueId` | string | yes | VantagePeers issue ID to link |
|
|
182
|
+
|
|
183
|
+
Example:
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"tool": "link_issue_to_pattern",
|
|
187
|
+
"arguments": {
|
|
188
|
+
"patternId": "k5708d9xxwj81v92e0x3hwv36985g4d7",
|
|
189
|
+
"issueId": "m97ewrrqczew67kc6at3a59e7985ea7h"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
96
194
|
### Error Monitoring (2)
|
|
97
195
|
`list_errors`, `get_error`
|
|
98
196
|
|
|
@@ -114,6 +212,22 @@ The server also reads `CONVEX_URL` from `.env.local` in the parent directory if
|
|
|
114
212
|
### Session (1)
|
|
115
213
|
`set_summary`
|
|
116
214
|
|
|
215
|
+
## Fix patterns cycle
|
|
216
|
+
|
|
217
|
+
A fix pattern is a validated learning extracted from a resolved bug — symptom, root cause, and the fix that worked — stored in the VantagePeers knowledge base. Patterns accumulate across projects and agents so that the same bug is never debugged twice from scratch.
|
|
218
|
+
|
|
219
|
+
The cycle runs as follows:
|
|
220
|
+
|
|
221
|
+
1. **Agent encounters a bug.** Before touching any code, call `search_fix_patterns` with a plain-language description of the symptom. The KB returns ranked matches using semantic vector search.
|
|
222
|
+
2. **KB hit.** If a validated pattern is returned, apply the known fix directly. Log the reuse via `add_fix_attempt` (`worked: true`) so confidence scores stay current.
|
|
223
|
+
3. **KB miss.** If no pattern matches, the agent fixes the bug manually using standard debugging. Once resolved, the learning is captured immediately via `create_fix_pattern` — symptom, root cause, severity, stack, and the working fix.
|
|
224
|
+
4. **Validation.** After the fix holds in production (or after a second independent confirmation), call `validate_fix` to promote the pattern to validated status. This is the signal that downstream agents can trust the pattern without verification.
|
|
225
|
+
5. **Issue linkage.** Call `link_issue_to_pattern` to attach the VantagePeers issue ID to the pattern. This creates a bidirectional reference: the issue record points to the pattern, and the pattern's `linkedIssueIds` list points back.
|
|
226
|
+
|
|
227
|
+
The four tools that power this cycle are: `create_fix_pattern`, `add_fix_attempt`, `validate_fix`, and `link_issue_to_pattern`. The fifth tool, `search_fix_patterns`, is in the Search / RAG category and is the entry point agents should call first.
|
|
228
|
+
|
|
229
|
+
On the agent side, the `/capitalize-fix` skill and the `inject-fix-patterns` hook automate steps 3-5: the hook fires on task completion events and prompts the orchestrator to capture the learning before closing the task. The cycle is designed to be low-friction — one tool call per step, all via MCP, no `npx convex run` required.
|
|
230
|
+
|
|
117
231
|
## Programmatic API (TypeScript)
|
|
118
232
|
|
|
119
233
|
For external services that need type-safe access to VantagePeers functions:
|
|
@@ -206,6 +320,18 @@ All orchestrator names are open strings — any lowercase name is accepted. The
|
|
|
206
320
|
|
|
207
321
|
## Changelog
|
|
208
322
|
|
|
323
|
+
### 2.2.0 — 2026-05-07
|
|
324
|
+
- 4 new fix-pattern tools: `create_fix_pattern`, `add_fix_attempt`, `validate_fix`, `link_issue_to_pattern`
|
|
325
|
+
- Detailed per-tool docs with arg tables and example calls in README
|
|
326
|
+
- New "Fix patterns cycle" section documenting the KB learning loop
|
|
327
|
+
- 41 new Zod input-validation unit tests for fix-pattern tools
|
|
328
|
+
|
|
329
|
+
### 2.1.1 — 2026-05-04
|
|
330
|
+
- Defense-in-depth `memoryIdSchema` validation for `create_briefing_note` and `update_briefing_note`
|
|
331
|
+
|
|
332
|
+
### 2.1.0 — 2026-04-25
|
|
333
|
+
- `update_briefing_note` MCP tool with RBAC
|
|
334
|
+
|
|
209
335
|
### 2.0.2 — 2026-04-14
|
|
210
336
|
- Added badges (npm version, downloads, license, tool count) to the published README
|
|
211
337
|
- Added Orchestrator Roles reference table including alpha, lambda, victor (Day 39 additions)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* VantagePeers MCP Server — HTTP Transport (Railway deploy)
|
|
4
|
+
*
|
|
5
|
+
* Wraps the same 82 tool definitions as the stdio server (server.ts) but
|
|
6
|
+
* serves them over Streamable HTTP for Claude web clients.
|
|
7
|
+
*
|
|
8
|
+
* Architecture:
|
|
9
|
+
* - One Railway instance, many tenants / OAuth clients
|
|
10
|
+
* - Each /mcp request authenticated via bearer token → either:
|
|
11
|
+
* · master bearer (admin shortcut, scopeProfile=master)
|
|
12
|
+
* · OAuth access_token (scoped, persisted in oauth_access_tokens)
|
|
13
|
+
* · legacy mcpTenants bearer (internal orchestrators on their own deployment)
|
|
14
|
+
* - Per-request ConvexHttpClient pointed at the resolved deployment
|
|
15
|
+
* - Stateless mode: fresh McpServer + transport per request (no session state)
|
|
16
|
+
*
|
|
17
|
+
* OAuth state (clients, codes, access/refresh tokens, scope profiles) is
|
|
18
|
+
* persisted in Convex (see convex/oauth.ts) — no more in-memory Maps.
|
|
19
|
+
*
|
|
20
|
+
* ENV VARS (see README.md "HTTP deploy" section):
|
|
21
|
+
* CONVEX_URL_INTERNAL — internal VantagePeers Convex URL
|
|
22
|
+
* BEARER_SECRET_MASTER — master admin token
|
|
23
|
+
* PUBLIC_BASE_URL — public URL of this server (for OAuth discovery)
|
|
24
|
+
* PORT — HTTP port (default 3000)
|
|
25
|
+
* NODE_ENV — set to "production" on Railway
|
|
26
|
+
*/
|
|
27
|
+
export {};
|