You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PLAN.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,39 @@
4
4
5
5
Prepare StreamNative MCP Server for Claude connector submission and review.
6
6
7
+
## Current review follow-up: annotation helper granularity
8
+
9
+
Reviewer feedback is valid: `toolannotations.ReadOnly` and `toolannotations.Destructive` currently call `mcp.WithToolAnnotation(...)`, replacing the whole annotation struct and dropping mcp-go defaults for `idempotentHint` and `openWorldHint`. The helper also collapses all side effects into `Destructive`, so local session mutations and reversible lifecycle operations look equivalent to delete/apply operations.
10
+
11
+
Implementation status: implemented in current work.
12
+
13
+
1. Replaced whole-annotation assignment helpers with composed field setters so unspecified hints keep mcp-go defaults unless explicitly changed.
3. Kept `Destructive(title)` as compatibility wrapper over `Mutating(title, true, false)` while migrating call sites to precise helpers.
20
+
4. Updated context tools to use `LocalSessionMutation`; updated operation-mode helper to derive destructive/idempotent from `OperationSpec` where available instead of treating all writes as destructive.
21
+
5. Extended annotation tests to assert `idempotentHint` and `openWorldHint` for static/context/builder tools, not only read/destructive.
22
+
23
+
Risks:
24
+
25
+
- Tool annotation surface changes are runtime-visible to MCP clients and Claude review.
26
+
- Incorrect idempotency classification can mislead clients; delete/remove/reset may be idempotent only depending backend behavior.
27
+
- Broad migration across all builders risks noisy diff; recommended first patch helper + high-signal call sites, then operation registry cleanup separately.
28
+
29
+
Recommended validation:
30
+
31
+
```bash
32
+
go test -race ./pkg/mcp/... ./pkg/mcp/builders/... ./pkg/mcp/pftools/...
33
+
go test -race ./...
34
+
go fmt ./...
35
+
go mod tidy
36
+
golangci-lint run --timeout=3m
37
+
make build
38
+
```
39
+
7
40
## Current review follow-up: operation spec registry
8
41
9
42
Reviewer feedback is valid: current branch split read/write tool names, but duplicated `toolMode` helpers and per-builder write-operation maps still create scatter-shot maintenance. Adding one operation can require enum updates, write map updates, handler switch updates, docs, and compliance-test classification. `validateModeOperation` also classifies any operation missing from the write map as read, so an unclassified future write can pass read-mode validation until the handler switch rejects or mishandles it.
0 commit comments