Skip to content

Add meta field passthrough for MCP Apps support#624

Merged
jairus-m merged 7 commits into
mainfrom
feat/mcp-app-infra
Mar 6, 2026
Merged

Add meta field passthrough for MCP Apps support#624
jairus-m merged 7 commits into
mainfrom
feat/mcp-app-infra

Conversation

@jgiuffrida
Copy link
Copy Markdown
Collaborator

Summary

  • Adds meta: dict[str, Any] | None = None to GenericToolDefinition, the @dbt_mcp_tool decorator, and register_tools() passthrough to FastMCP.add_tool()
  • This is infrastructure-only — no new tools or features. All existing tools are unaffected (meta defaults to None)
  • Enables future MCP App tools to declare associated UIs via meta={"ui": {"resourceUri": "ui://..."}}
  • Adds CLAUDE.md with project architecture overview for AI-assisted development
  • Adds "Adding Tools" and "Adding an MCP App tool" sections to CONTRIBUTING.md
  • Adds 7 new unit tests for meta passthrough through the full pipeline
  • Updates MockFastMCP in test conftest to capture tool_kwargs for future test assertions

Test plan

  • All 386 unit tests pass (uv run pytest tests/ --ignore=tests/integration -x -q)
  • New tests cover: decorator, adapt_context(), to_fastmcp_internal_tool(), and generic_register_tools() for both meta=value and meta=None
  • Verify no behavioral changes to existing tools in a client (e.g., Claude, Cursor)

🤖 Generated with Claude Code

Adds the `meta` parameter to the tool definition pipeline so tools can
declare associated UI resources via `meta={"ui": {"resourceUri": "ui://..."}}`.
This is the plumbing needed to support MCP Apps without adding any features.

Also adds CLAUDE.md, tool authoring docs in CONTRIBUTING.md, and tests
for the meta passthrough.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jgiuffrida jgiuffrida requested a review from a team as a code owner March 4, 2026 21:57
Copy link
Copy Markdown
Collaborator

@DevonFulcher DevonFulcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md Outdated
- Rename "MCP App tool" to "tool with interactive UI"
- Clarify why structured_output=True is needed
- Recommend Pydantic models for return types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@DevonFulcher DevonFulcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment thread CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jairus-m jairus-m merged commit e2166ff into main Mar 6, 2026
11 checks passed
@jairus-m jairus-m deleted the feat/mcp-app-infra branch March 6, 2026 18:24
# We haven't strictly defined our tool contracts yet.
# So we're setting this to False by default for now.
structured_output: bool | None = False
meta: dict[str, Any] | None = None
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a risk to confuse ourselves/people between the MCP tool meta and the concept of meta in dbt that we already rely on in the MCP server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants