Skip to content

v0.20.1

Choose a tag to compare

@abewheel abewheel released this 14 Apr 20:56

⚠️ Breaking Changes ⚠️

This upgrade helps sunpeak testing run embedded in other frameworks.

Test fixture API redesigned

The single mcp fixture has been split into two:

  • mcp — MCP protocol methods only (callToollistToolslistResourcesreadResource)
  • inspector — sunpeak inspector rendering (renderToolhostpage)

Migration

Copy

Before After
{ mcp } (rendering tests) { inspector }
mcp.callTool('tool', {}, { theme }) inspector.renderTool('tool', undefined, { theme })
mcp.callTool('tool') with result.app() inspector.renderTool('tool')
mcp.screenshot('name') result.screenshot('name')
mcp.host inspector.host
mcp.page inspector.page
mcp.openTool(...) Removed
mcp.runTool(...) Removed
mcp.setTheme(...) Removed. Pass { theme } option to renderTool.
mcp.setDisplayMode(...) Removed. Pass { displayMode } option to renderTool.

Quick rule: If your test uses result.app()themedisplayMode, or screenshot, change { mcp } to { inspector } and callTool to renderTool. Protocol-only tests (callTool without .app()) stay on mcp unchanged.

New APIs

  • mcp.listTools()mcp.listResources()mcp.readResource(uri) — protocol-level assertions
  • result.source — 'fixture' or 'server', tells you which path ran
  • result.screenshot() — visual regression on the result object
  • inspector.renderTool() with input calls the real server; without uses simulation fixtures
  • defineConfig({ server: { env, cwd }, timeout }) — env vars, working directory, startup timeout
  • sunpeak inspect --env KEY=VALUE --cwd <path> — CLI equivalents
  • inspectServer() from sunpeak/inspect — programmatic API for embedding

Update the coding agent skill

pnpm dlx skills add Sunpeak-AI/sunpeak@test-mcp-server

The skill includes migration rules so your coding agent can update existing tests automatically.

What's Changed

  • Improve testing framework for Python MCP servers and embedding by @abewheel in #49

Full Changelog: v0.19.15...v0.20.1