Skip to content

feat: expand MCP tool export (valibot output, env meta, shell exclusion, tool name collisions) - #63

Merged
yuyakinjo merged 1 commit into
mainfrom
feat/mcp-schema-improvements
Sep 9, 2026
Merged

yuyakinjo merged 1 commit into
mainfrom
feat/mcp-schema-improvements

Conversation

@yuyakinjo

Copy link
Copy Markdown
Owner

Summary

  • valibot で書いた output.tsx からも outputSchema を出す (これまでは Type.* のみ)
  • env.tsx の宣言を _meta["decopin-cli/env"] に載せ、呼ぶ前に必要な環境変数を読めるようにする
  • shell.tsx を持つコマンドは tools/list から除外し、名前指定での呼び出しも拒否する(親シェルを変える手段のため、MCP ホスト下では無意味かつ半端に成功して見える)
  • choose() を使うコマンドは一覧に残す(失敗が構造化されて返るため)
  • ルート名の正規化・切り詰め後の衝突をビルド時・実行時双方でガードする
  • README / docs/decisions.md / MCP ガイドに上記を反映

Test plan

  • bun test test/runtime/mcp.test.tsx (28 pass)

…on, tool name collisions)

- export outputSchema for valibot-written output.tsx, not just Type.*
- add _meta decopin-cli/env listing env.tsx requirements per tool
- exclude shell.tsx commands from tools/list and refuse calling them by name
- keep choose()-using commands listed since their failure is structured
- guard against tool name collisions after route normalization, at build and runtime
- document all of the above in README, docs/decisions.md, and the MCP guide
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Startup benchmark

hello world, 50 warm runs. Both builds are measured in the same
job on the same runner, so the machine cancels out of the comparison.

Build Mean Own share
this PR 20.3 ms 16.6 ms
main 20.6 ms 16.8 ms
empty Bun binary (runtime floor) 3.8 ms —

Difference: -0.2 ms (-1.0%) against main.

Own share is the mean minus the runtime floor — the part this project is
responsible for. CI runners are noisy; read anything under a few percent
as noise rather than a regression.

Bundle size

Minimal CLI (test/fixtures/hello-app: one command, <Line> only),
decopin build --minify. Framework code is all of it, so growth here is
framework growth.

Build Size
this PR 82.5 KB
main 78.7 KB

Difference: +3.8 KB (+4.9%) against main.
Bytes are deterministic: any difference is real, not runner noise.

@yuyakinjo
yuyakinjo merged commit 6376d5c into main Sep 9, 2026
5 checks passed
@yuyakinjo
yuyakinjo deleted the feat/mcp-schema-improvements branch September 9, 2026 15:30
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