Skip to content

Relax path sanitizer, add elicitation support, fix eval compatibility#27

Merged
hifi-phil merged 6 commits intodevfrom
feature/editor-mcp-elicitation
Apr 1, 2026
Merged

Relax path sanitizer, add elicitation support, fix eval compatibility#27
hifi-phil merged 6 commits intodevfrom
feature/editor-mcp-elicitation

Conversation

@hifi-phil
Copy link
Copy Markdown
Contributor

Summary

  • Relax input sanitizer: rejectPathTraversal no longer blocks /-prefixed paths, which Umbraco uses as identifiers for stylesheets, scripts, and partial views. Still blocks ../, ..\, UNC paths, and Windows drive paths.
  • Add elicitation support: onElicitation callback in eval runner, outputSchema on ProxiedTool type
  • Bump @modelcontextprotocol/sdk to ^1.28.0 for structuredContent support
  • Fix eval Jest compatibility: Polyfill Symbol.asyncDispose for Jest VM context (fixes "Object not disposable" error with upgraded Claude Agent SDK)
  • Update template OAuth client ID to umbraco-back-office-hosted-mcp

Test plan

  • SDK unit tests (426 pass)
  • Hosted MCP unit tests (191 pass)
  • CLI unit tests (121 pass)
  • CLI integration tests (21 pass)
  • Template tool handler tests (24 pass)
  • Wrangler integration tests (20 + 18 pass)
  • Playwright E2E tests (15 + 12 pass)
  • CLI evals (20/21 pass, 1 timeout on slow multi-step eval)

🤖 Generated with Claude Code

hifi-phil and others added 6 commits March 31, 2026 21:06
The eval runner now passes an onElicitation callback to the Claude
Agent SDK's query() function. This enables eval testing of tools
that use MCP elicitation (server.elicitInput()).

- Add onElicitation to AgentTestOptions (per-test override)
- Add defaultOnElicitation to EvalConfig (global default)
- Default: auto-accept with { confirm: true } if neither is set
- Bump @anthropic-ai/claude-agent-sdk to ^0.2.39 (adds OnElicitation type)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
ProxiedTool.originalTool now includes outputSchema from the chained
server's listTools response. proxiedToolsToDefinitions passes it
through so consumers can register proxied tools with structured content.

Note: hosted MCP's registerChainedTools cannot pass raw JSON Schema
outputSchema to registerTool (expects Zod). Documented as limitation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…support

MCP SDK <1.28.0 strips structuredContent from tool call responses,
causing chained tools to return text content only. Bumping to 1.28+
ensures structuredContent is preserved on the wire when tools define
outputSchema.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…bility

- Narrow rejectPathTraversal to only block ../ ..\\ and Windows drive paths,
  allowing /-prefixed paths that Umbraco uses as identifiers for stylesheets,
  scripts, and partial views
- Add Symbol.asyncDispose polyfill for Jest VM context (fixes Claude Agent SDK
  "Object not disposable" error in eval tests)
- Add @anthropic-ai/claude-agent-sdk dependency to tests/cli
- Update McpOAuthComposer client ID to umbraco-back-office-hosted-mcp

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The SDK changed registerTool's callback signature — when InputArgs is
undefined, ToolCallback<undefined> expects (extra) => Result (1 arg),
but ToolDefinition.handler has (args, extra) => Result. Cast handler
at the call site since inputSchema is always passed alongside it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hifi-phil hifi-phil merged commit 4ee9656 into dev Apr 1, 2026
4 checks passed
@hifi-phil hifi-phil deleted the feature/editor-mcp-elicitation branch April 27, 2026 09:39
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.

1 participant