@printwithsynergy/synergy-mcp 0.1.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/CLAUDE.md +119 -0
- package/LICENSE +661 -0
- package/README.md +160 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +78 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +166 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/blast-radius.d.ts +33 -0
- package/dist/tools/blast-radius.d.ts.map +1 -0
- package/dist/tools/blast-radius.js +205 -0
- package/dist/tools/blast-radius.js.map +1 -0
- package/dist/tools/floor-pin-grid.d.ts +23 -0
- package/dist/tools/floor-pin-grid.d.ts.map +1 -0
- package/dist/tools/floor-pin-grid.js +133 -0
- package/dist/tools/floor-pin-grid.js.map +1 -0
- package/dist/tools/pattern-audit.d.ts +30 -0
- package/dist/tools/pattern-audit.d.ts.map +1 -0
- package/dist/tools/pattern-audit.js +184 -0
- package/dist/tools/pattern-audit.js.map +1 -0
- package/dist/tools/stack-health-grid.d.ts +35 -0
- package/dist/tools/stack-health-grid.d.ts.map +1 -0
- package/dist/tools/stack-health-grid.js +110 -0
- package/dist/tools/stack-health-grid.js.map +1 -0
- package/package.json +53 -0
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# synergy-mcp — agent notes
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
|
|
5
|
+
Cross-stack dev-audit MCP server. Surfaces the patterns the cross-
|
|
6
|
+
stack architecture audit found inconsistently applied across the six
|
|
7
|
+
printwithsynergy repos (codex-pdf, lint-pdf, lens-pdf, compile-pdf,
|
|
8
|
+
synergy, platform) as four MCP tools over stdio.
|
|
9
|
+
|
|
10
|
+
**Non-goals:**
|
|
11
|
+
- Don't replace observability — `stack_health_grid` is a snapshot
|
|
12
|
+
probe, not a tracing stack.
|
|
13
|
+
- Don't replace code review — the engine work happens in CodeRabbit
|
|
14
|
+
+ BugBot + human review.
|
|
15
|
+
- Don't replace JSON Schema / Spectral — `synergy` already enforces
|
|
16
|
+
its OpenAPI contract.
|
|
17
|
+
|
|
18
|
+
## Architecture
|
|
19
|
+
|
|
20
|
+
- **stdio MCP transport.** Runs as a child process spawned by the
|
|
21
|
+
client (Claude Code, Cline, etc.). Speaks the MCP protocol over
|
|
22
|
+
stdin/stdout. No HTTP listener.
|
|
23
|
+
- **Read-only.** Every tool reads working trees and / or HTTP probes
|
|
24
|
+
prod URLs. The server never writes to disk and never mutates a
|
|
25
|
+
repo. If a tool needs persistence, store it in the MCP client's
|
|
26
|
+
state, not here.
|
|
27
|
+
- **Configuration via env vars only.** No config file. The runtime is
|
|
28
|
+
the user's shell; the MCP client passes env through the spawn.
|
|
29
|
+
|
|
30
|
+
## Tool surface
|
|
31
|
+
|
|
32
|
+
Four tools (`src/tools/*.ts`):
|
|
33
|
+
|
|
34
|
+
- `blast_radius` — regex-based call-site discovery. Python `from X
|
|
35
|
+
import Y` + TS `import { Y } from 'X'` + bare-name usage. Pure
|
|
36
|
+
filesystem scan, no AST.
|
|
37
|
+
- `floor_pin_grid` — parse `pyproject.toml#dependencies` and
|
|
38
|
+
`package.json#{dependencies,devDependencies,peerDependencies}` for
|
|
39
|
+
the org-package allowlist (`ORG_PACKAGES` in
|
|
40
|
+
`src/tools/floor-pin-grid.ts`).
|
|
41
|
+
- `pattern_audit` — file-existence + shallow-grep probes. Each probe
|
|
42
|
+
is a one-function file-system call; no AST.
|
|
43
|
+
- `stack_health_grid` — parallel `fetch` to per-repo health endpoints
|
|
44
|
+
(the five different shapes catalogued by audit finding #15).
|
|
45
|
+
|
|
46
|
+
Adding a new tool:
|
|
47
|
+
|
|
48
|
+
1. Create `src/tools/<name>.ts` with `<Name>Input = z.object({...})`
|
|
49
|
+
and `<name>(input)` function.
|
|
50
|
+
2. Add to the `TOOLS` array in `src/index.ts`.
|
|
51
|
+
3. Add to the README's tool table.
|
|
52
|
+
4. Add a test under `src/tools/<name>.test.ts`.
|
|
53
|
+
|
|
54
|
+
## Patterns + invariants
|
|
55
|
+
|
|
56
|
+
- **No exception leaks past the tool boundary.** Every tool catches
|
|
57
|
+
its own errors and returns `{notes: [...]}` entries that explain
|
|
58
|
+
what failed. The MCP server's tool-call handler maps unexpected
|
|
59
|
+
throws into `isError: true` content blocks.
|
|
60
|
+
- **Tools return `{rows: [...], notes: [...]}`** as the response
|
|
61
|
+
shape. Rows are the data; notes are configuration / partial-result
|
|
62
|
+
warnings the caller might want to surface to the user.
|
|
63
|
+
- **Repo-name vocabulary** is fixed at `KNOWN_REPOS` in
|
|
64
|
+
`src/config.ts`. Don't sprinkle string literals — go through the
|
|
65
|
+
type.
|
|
66
|
+
- **No network calls outside `stack_health_grid`.** The other three
|
|
67
|
+
tools must work fully offline. Don't add a "phone home for fresh
|
|
68
|
+
Pantone data" feature; this is a dev tool, not a runtime.
|
|
69
|
+
|
|
70
|
+
## Configuration model
|
|
71
|
+
|
|
72
|
+
The user supplies repo paths via env. `src/config.ts` resolves them
|
|
73
|
+
in priority order:
|
|
74
|
+
|
|
75
|
+
1. `SYNERGY_MCP_PATH_<REPO>` (per-repo).
|
|
76
|
+
2. `SYNERGY_MCP_STACK_ROOT` + repo name (uniform layout).
|
|
77
|
+
|
|
78
|
+
Repos that don't resolve are silently skipped — tools still run on
|
|
79
|
+
the available subset and emit a note. **Never** throw because a repo
|
|
80
|
+
is missing; the OSS dev story is "configure incrementally."
|
|
81
|
+
|
|
82
|
+
For prod URLs (`stack_health_grid`), the defaults are baked in
|
|
83
|
+
(`codex.lintpdf.com`, `lintpdf.com`, `compilepdf.com`); override via
|
|
84
|
+
`SYNERGY_MCP_URL_<REPO>`.
|
|
85
|
+
|
|
86
|
+
## Local dev
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
pnpm install
|
|
90
|
+
pnpm dev # tsx watch src/index.ts
|
|
91
|
+
pnpm typecheck # tsc --noEmit
|
|
92
|
+
pnpm test # vitest run
|
|
93
|
+
pnpm lint # biome check src
|
|
94
|
+
pnpm build # tsc → dist/
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
CI gate: biome + tsc + vitest.
|
|
98
|
+
|
|
99
|
+
## Release flow
|
|
100
|
+
|
|
101
|
+
1. Bump `version` in `package.json`.
|
|
102
|
+
2. Add a `CHANGELOG.md` entry (Keep-a-Changelog format).
|
|
103
|
+
3. Open + merge the bump PR.
|
|
104
|
+
4. Tag `vX.Y.Z` on `main`; the publish workflow takes it from there.
|
|
105
|
+
|
|
106
|
+
The npm package is published to `@printwithsynergy/synergy-mcp` with
|
|
107
|
+
public access.
|
|
108
|
+
|
|
109
|
+
## License
|
|
110
|
+
|
|
111
|
+
AGPL-3.0-or-later, matching the engine stack.
|
|
112
|
+
|
|
113
|
+
## Code review & blast-radius protocol
|
|
114
|
+
|
|
115
|
+
- Run code-review-graph impact tools on changed symbols before edits.
|
|
116
|
+
- Run `pnpm typecheck` + `pnpm test` before commit.
|
|
117
|
+
- CodeRabbit reviews PRs automatically; Cursor BugBot is the second
|
|
118
|
+
opinion.
|
|
119
|
+
- Never disable the code-review-graph Launch Agent.
|