diff --git a/CHANGELOG.md b/CHANGELOG.md index b46cbfb2..0c7df3fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,75 @@ All notable changes to this project are documented here. The format follows ## [Unreleased] +### Changed (BREAKING, the host contract): the request's context reaches dispatch under `:mcp` + +- The host's dispatch function receives, in its third argument, its own `dispatch_opts` + followed by one reserved key, `:mcp`: a map of the request's `params._meta` as the client + sent it (string keys, `%{}` when it sent none), the client's capabilities (the request's own + in `_meta`, else what `initialize` declared; `nil` when there are none, or when they are not + an object), and the protocol revision the request is served under (the one its `_meta` names, + else `2025-11-25`). It is the client's word: authorise on the transport's hooks, not on it. Before, the core stripped `params._meta` before + `tools/call` was matched and kept no client capabilities, so a host could not see a trace id + or a capability the client declared. Fields added later join this map at a minor. + `BeamMCP.Server.new/1` refuses `dispatch_opts` carrying `:mcp`, and so does + `BeamMCP.Transport.HTTP` at init. + **How to tell whether you are affected:** your `dispatch_opts` has a key named `:mcp` (rename it); or your dispatch + function checks its third argument as a whole: matches it exactly (`fn _, _, [secret: s] ->`), + compares it (`opts == []`), or validates it against a closed key list (`Keyword.validate!/2`, + `NimbleOptions.validate!/2`, which now raise on `:mcp`): match or fetch the keys you read + (`Keyword.fetch!(opts, :secret)`); or you log or forward the whole of it, which now carries + the client's `_meta`: drop `:mcp` first (`Keyword.delete(opts, :mcp)`). + +### Changed (BREAKING, the exported bytes): `schema_version` 4 and the `resource_template` node kind + +- A resource template is a node of the declared connectome, of the new kind + `:resource_template`, identified by its uri template (`srv/resource_template/