mirror of
https://github.com/zap-proto/zip.git
synced 2026-10-19 15:38:57 +00:00
Decomplected the transport layer and added a free MCP tool surface — both from
the principle 'values, not places; one and only one way'.
TRANSPORT — one verb, transport is a VALUE (the address scheme), not a method:
app.Listen(":9653") // ZAP (bare addr = the primary)
app.Listen(":9653", "http://:8080") // ZAP + HTTP in one call
app.Listen("quic://:443") // any RegisterTransport'd protocol
Mirrors net.Listen(network, addr). Removed ListenHTTP/ListenZAP/Serve — one Listen.
An open transport registry (RegisterTransport) means any future termination/
serialization proto slots in with ZERO API change. ZAP is DefaultScheme.
FREE MCP — every typed handler (Get/Post[In,Out]) auto-projects to a Model
Context Protocol tool at /mcp (JSON-RPC 2.0: initialize/tools/list/tools/call).
The SAME op registry feeds REST routes, the OpenAPI doc, AND the MCP tools — one
value (the op), three projections; tools/call runs the exact same fn as the REST
route (op.invoke, the transport-agnostic handler core). Because /mcp is an
ordinary route, it's served over every transport → ZAP-native MCP for free. On by
default; Config.MCP.Disabled to suppress.
Supersedes the same-session v1.0.0 transitional ListenZAP/HTTP/Serve API — forward
only, no compat shims (per repo policy: break within v1, never lazily bump major).
Verified: build/vet/gofmt clean; TestListen_ZAP + TestListen_DualTransport serve a
real request over ZAP (and both transports from one Listen); TestMCP_FreeToolSurface
drives initialize/tools/list/tools/call end-to-end (schemaOf projection + same-fn
call + validation→isError).