Skip to content

Expose MCP tool icons, server titles, and cache hints - #10444

Open
nmnmcc wants to merge 3 commits into
Effect-TS:mainfrom
nmnmcc:codex/mcp-core-metadata
Open

nmnmcc wants to merge 3 commits into
Effect-TS:mainfrom
nmnmcc:codex/mcp-core-metadata

Conversation

@nmnmcc

@nmnmcc nmnmcc commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

MCP clients missed Toolkit icons and legacy server titles, while resource reads discarded application cache hints. This adds McpServer.ToolIcons, an optional constructor title, public list cache scopes, and per-resource ttlMs/cacheScope hints. Modern titles were already representable at runtime; their constructor type now exposes the option.

Resources without hints keep the 0/private default. Completed retries carrying inputResponses or requestState also use those defaults, and intermediate input_required results carry no hints, following the caching requirements. Invalid hints become sanitized internal errors. Legacy adapters omit fields their revisions cannot represent; icons follow the tool metadata schema.

A modern-only server receiving legacy initialization now includes supported and requested revisions in its unsupported-version error. A missing or non-string version returns InvalidParams. Documentation also clarifies existing registration order and visibility without adding a sorting policy.

Constructor calls and cache defaults remain compatible. .changeset/mcp-core-metadata.md declares an effect patch. Sealed tokens and their combined cache tests belong to the state protection PR.

Regression coverage: tests reproduced missing icons/titles, rejected public scopes, ignored resource hints, and incomplete version errors. They now cover both HTTP constructors, legacy projection, malformed initialization, defaults, and continuation cache suppression.

Dependencies: #10441. The upstream diff includes these prerequisites; Focused comparison.

Verification

Target: Effect-TS/effect:main. Validated head: dd7883a500c6ed9c57810ac92aca2851e8a04324.

  • Passed: pnpm check, pnpm check-tsc, lint, JSDoc checks, full Tstyche/doctest suites, circular checks, AI-doc generation, package build with stripInternal: true, and distribution-type checks.
  • Full configured Node suite: Test Files 613 passed | 1 skipped (614); Tests 17407 passed | 15 expected fail | 108 skipped (17530).
  • Node 26.12.1 / pnpm 11.20.0; four Node workers and two doctest workers. Database integration tests enabled; MSSQL disabled as in CI; opt-in cluster suite excluded. Hosted CI results are separate.
  • Tests/doctests used --run with explicit files. Generated docs were unchanged; temporary build configuration was restored.

@changeset-bot

changeset-bot Bot commented Nov 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: dd7883a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 33 packages
Name Type
effect Patch
@effect/opentelemetry Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-cloudflare Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/ai-typesafe Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-deno Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/docgen Patch
@effect/doctest Patch
@effect/graphql-generator Patch
@effect/openapi-generator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@effect-janitor effect-janitor Bot added the 4.0 label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 39.55 KB 39.55 KB 0.00 KB (0.00%)
basic.ts 7.31 KB 7.31 KB 0.00 KB (0.00%)
batching.ts 11.13 KB 11.13 KB 0.00 KB (0.00%)
brand.ts 6.97 KB 6.97 KB 0.00 KB (0.00%)
cache.ts 11.61 KB 11.61 KB 0.00 KB (0.00%)
config.ts 22.98 KB 22.98 KB 0.00 KB (0.00%)
differ.ts 22.13 KB 22.13 KB 0.00 KB (0.00%)
http-client.ts 27.14 KB 27.14 KB 0.00 KB (0.00%)
http-router.ts 37.05 KB 37.05 KB 0.00 KB (0.00%)
logger.ts 12.07 KB 12.07 KB 0.00 KB (0.00%)
metric.ts 9.54 KB 9.54 KB 0.00 KB (0.00%)
optic.ts 7.17 KB 7.17 KB 0.00 KB (0.00%)
pubsub.ts 16.08 KB 16.08 KB 0.00 KB (0.00%)
queue.ts 12.96 KB 12.96 KB 0.00 KB (0.00%)
schedule.ts 11.86 KB 11.86 KB 0.00 KB (0.00%)
schema-bigdecimal.ts 14.23 KB 14.23 KB 0.00 KB (0.00%)
schema-binary.ts 42.17 KB 42.17 KB 0.00 KB (0.00%)
schema-class.ts 21.87 KB 21.87 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 29.83 KB 29.83 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 28.14 KB 28.14 KB 0.00 KB (0.00%)
schema-string-transformation.ts 15.44 KB 15.44 KB 0.00 KB (0.00%)
schema-string.ts 12.43 KB 12.43 KB 0.00 KB (0.00%)
schema-template-literal.ts 16.35 KB 16.35 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 39.09 KB 39.09 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 26.28 KB 26.28 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 21.05 KB 21.05 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 21.20 KB 21.20 KB 0.00 KB (0.00%)
schema-toFormatter.ts 21.30 KB 21.30 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 26.31 KB 26.31 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 21.37 KB 21.37 KB 0.00 KB (0.00%)
schema.ts 20.97 KB 20.97 KB 0.00 KB (0.00%)
stm.ts 14.27 KB 14.27 KB 0.00 KB (0.00%)
stream.ts 10.44 KB 10.44 KB 0.00 KB (0.00%)

@nmnmcc nmnmcc changed the title Expose MCP tool metadata and resource cache hints Expose MCP tool icons, server titles, and cache hints Nov 7, 2026
@RhysSullivan

Copy link
Copy Markdown
Contributor

Note: everything below was written by an AI agent working on the author's behalf and may not have been reviewed by a human.

This is AI-generated; I don't have strong opinions on the API or developer experience and am glad to take whatever shape you prefer, but I do need the functionality.

I need one part of this PR: a server title on the options of McpServer.layer, layerStdio, layerHttp and layerHttpRequestScoped, passed into the initialize result's serverInfo on the 2025 revisions (2026-07-28's server/discover already carries it). I carry that as a small patch today.

This PR has been conflicting with main for a while. If it would help to land the title on its own first, I can open a small PR with just that part (the option on each layer, initialize's serverInfo, and a test on each revision), and rebase nothing else of yours. @nmnmcc, would that be useful, or would you rather keep it here?

Sent from my Claude

This branch is waiting to be deployed

1 waiting deployment
fork — dd7883a5 Waiting Nov 7, 2026 by nmnmcc via approval-gate #25355
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants