Phase 4: Documentation + runnable decorator example
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2.2k
- Forks
- 300
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 184
Description
Description
Close out the vMCP domain/transport split by making the new API discoverable and
its extension model executable: document New/Serve and the decorator extension
model across the vMCP architecture docs and pkg/vmcp/doc.go, refresh the
pkg/vmcp/server stability table, and add a runnable decorator example embedder
that proves the supported extension mechanism. This story maps to RFC Phase 4
and delivers the documentation + example slice — no production behavior changes,
and server.New stays untouched.
Context
See RFC THV-0076: vMCP Core Interface
for full design details. Part of the vMCP interface refactor (epic #5419).
This is the final story. By the time it lands, #5430 (Phase 1) has
introduced the identity-parameterized VMCP interface and New(cfg) -> VMCP,
#5431 (Phase 2) has added Serve(ctx, VMCP, *ServerConfig) -> *Server, and
#5432 (Phase 3) has reduced server.New to the stable wrapper
Serve(ctx, New(deriveCoreConfig(cfg)), deriveServerConfig(cfg)). This story makes
that now-additive public API legible to downstream embedders (e.g.
stacklok/brood-box) and demonstrates the one supported extension mechanism:
decoration over the VMCP interface.
Per architecture.md ("PR-Sized Decomposition Guidance → Phase 4"), the work is
two PR-sized chores:
- Docs (#5446). Update
docs/arch/vmcp-library.mdto documentNew/Serve
and the decorator extension model and refresh its stability table (the
embedding-pattern section currently describes onlyserver.New; the table marks
pkg/vmcp/serverStable asNew, Start, Stop). Update
docs/arch/10-virtual-mcp-architecture.md(overview) andpkg/vmcp/doc.go
(package docs) to describe the domain/transport split and the decorator seam.
docs/arch/README.mdalready indexesvmcp-library.md(#13) — only the linked
content changes, not the index. - Decorator example (#5447). Add a runnable example embedder implementing a
subtract-only decorator overVMCP— a "subtract-only" decorator that filters
itsListToolsoutput and refuses the correspondingCallToolbefore delegating
toinner. It demonstrates the two invariants fromarchitecture.mdCore
Principle #3: (a) list and call stay consistent (a tool hidden from the list is
also denied on call), and (b) a decorator can only subtract reachability — it
holds onlyinner VMCPand has no path to backends except throughinner, so it
cannot widen access (mirrors thepkg/authz/tool_filter.gofilter/deny logic).
This story changes no production behavior and adds no CLI flags, so
task docs (generated docs/cli/thv_vmcp_*.md) is expected to be a no-op.
RFC Phase(s): Phase 4
Dependencies: #5432 (the server.New wrapper + config split must be merged
so the docs and example describe the final New/Serve shape)
Scope
In scope
- Document
New/Serveand the decorator extension model in
docs/arch/vmcp-library.md; refresh itspkg/vmcp/serverstability table entry
to reflect the additiveNew/ServeAPI (#5446). - Update
docs/arch/10-virtual-mcp-architecture.md(overview) andpkg/vmcp/doc.go
(package docs) to describe the domain/transport split and the decorator seam
(#5446). - Add a runnable decorator example embedder: a subtract-only decorator over
VMCP
proving list/call consistency and that a decorator cannot widen access (#5447).
Out of scope
- Any change to
VMCP,New,Serve,ServerConfig, orserver.New— those
ship in #5430 / #5431 / #5432. This story is docs + example only. - A new transport-layer extension mechanism beyond the existing
ServerConfig
slots and the(*Server).Handleroutermost-wrapping pattern (RFC non-goal). - Regenerating CLI docs for new flags — none are added;
task docsis a guard only. - Changes to
docs/arch/README.md's index (already referencesvmcp-library.md).
Child Tasks
PR-sized tasks under this story (each ≤ 400 LOC, ≤ 10 files changed excluding
tests/docs/generated, one logical change):
- #5446: P4.1 Update vMCP architecture docs +
doc.go - #5447: P4.2 Runnable decorator example embedder
Acceptance Criteria
- All child tasks complete and merged
-
server.Newsignature and observable behavior unchanged -
New/Serveand the decorator extension model are documented in
docs/arch/vmcp-library.md, with the stability table refreshed to reflect the
additiveNew/ServeAPI;docs/arch/10-virtual-mcp-architecture.mdand
pkg/vmcp/doc.godescribe the domain/transport split and the decorator seam - A runnable decorator example embedder compiles and demonstrates a
subtract-only decorator overVMCP, showing list/call consistency and that a
decorator cannot widen access - No production behavior change and no CLI flags added;
task docsis a no-op
(generateddocs/cli/thv_vmcp_*.mdunchanged) - Existing
thv vmcp serveE2E suite passes unchanged
References
- RFC THV-0076 (link above)
- Epic: #5419
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with docs/arch/vmcp-library.md, docs/arch/10-virtual-mcp-architecture.md, and pkg/vmcp/doc.go, then inspect the VMCP API and pkg/authz/tool_filter.go. Add the runnable subtract-only decorator example described in the issue and verify it compiles, preserves list/call consistency, and cannot widen access. Run task docs and the existing thv vmcp serve E2E suite; generated CLI docs should remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100