Skip to content

refactor: collapse SDK HTTP templates and deprecate --template - #42

Merged
IBJunior merged 1 commit into
mainfrom
refactor/collapse-http-templates
Oct 4, 2026
Merged

IBJunior merged 1 commit into
mainfrom
refactor/collapse-http-templates

Conversation

@IBJunior

@IBJunior IBJunior commented Oct 4, 2026

Copy link
Copy Markdown
Member

Closes #26.

#26 was written while FastMCP still gave --template a real meaning. With FastMCP removed in 0.10.0, the flag is dead for every project, so this goes further than the issue's SDK-only options.

Changes

1. Collapse the HTTP templates. sdk/stateless/ → sdk/http/; auth.ts + auth.test.ts move in; the OAuth index/readme tests from stateful/templates.test.ts are folded into http/templates.test.ts; the sdk/stateful/ shim is deleted. The stateful "convergence" tests are gone with it — there is nothing left to compare. Generated output is unchanged.

2. Deprecate --template (option b). Still parsed, so existing scripts keep working, but hidden from --help; passing it prints a warning and has no effect. template / TemplateType are removed from CLIOptions. One behaviour change: --stdio --template=stateful used to exit with an error and now only warns, since the flag no longer means anything. Not removed outright because 0.10.0 just told users it was "accepted for compatibility" — removal belongs in a later breaking release.

3. Template deps. The bumps listed in the issue (TypeScript 7 etc.) had already landed. This refreshes what is newer now via npm run update-template-deps: the @modelcontextprotocol/* packages, hono, dotenv, vitest, @types/node. All minor/patch, no [MAJOR] flags.

4. Node engine floor. Kept at >=22.19.0 (inspector). vitest 5 needs ^22.12.0 anyway and Node 20 is EOL, so dropping the inspector would buy nothing. Only the comment and AGENTS.md change.

Also: README.md and AGENTS.md added to .prettierignore (their compact tables and *emphasis* are hand-formatted; CI's format:check only covers src/).

Testing

  • npm run build, npm run lint, npm test (404 passing)
  • Generated HTTP, HTTP + OAuth, and stdio projects with the built CLI: npm install, npm run build, vitest pass in each (9/9)
  • HTTP server started: /health OK, initialize + tools/list over /mcp return the three notes tools
  • stdio: npm run inspect:tools lists the same tools
  • OAuth: fails fast with the discovery error when no provider is reachable (full token flow not exercised)
  • Default scaffold writes git repo, Dockerfile and .agents/skills/tool-design/
  • --stdio --template=stateful prints the deprecation warning and generates

🤖 Generated with Claude Code

SDK v2 made the stateless and stateful HTTP templates generate identical
projects, and with FastMCP gone nothing else gives --template meaning.

- Rename sdk/stateless/ to sdk/http/, move auth.ts and its tests there,
  fold in the OAuth template tests, and delete the sdk/stateful/ shim
- Deprecate --template: hidden from --help, prints a warning, no effect.
  --stdio --template=stateful now warns instead of erroring
- Refresh template dependencies (all minor/patch)
- Keep the >=22.19.0 engine floor and document why
- Exclude README.md and AGENTS.md from Prettier

Closes #26

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@IBJunior
IBJunior merged commit caa33e7 into main Oct 4, 2026
2 checks passed
@IBJunior
IBJunior deleted the refactor/collapse-http-templates branch October 4, 2026 18:35
@IBJunior IBJunior mentioned this pull request Oct 15, 2026
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.

Follow-ups to SDK v2 migration: collapse stateless/stateful, --template semantics, dep bumps

1 participant