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
feat: add _meta support to Tool struct and JSON encoder (#108)
## Problem
I have an Elixir app that provides an MCP server and I wanted to utilize
the new MCP Apps extension
(https://modelcontextprotocol.io/extensions/apps/overview). To do this,
I needed support for adding the _meta field to tool declarations so
clients know which visual resource to render alongside a tool's output.
## Solution
I added a meta field to the Tool struct and wired it through the JSON
encoder so _meta appears in the serialized MCP tool object. Tools can
now declare `meta: %{"ui" => %{"resourceUri" =>
"ui://my-app/dashboard"}}` via `use Anubis.Server.Component`.
## Rationale
This is the minimal change needed to support the MCP spec's _meta field
— I only touched the Tool struct and its serialization path.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
* **New Features**
* Tool components now support optional metadata that can be provided
during tool definition and is automatically included in exported tool
information and JSON responses.
* **Tests**
* Added comprehensive tests validating metadata functionality, including
JSON encoding and callback optionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments