alignbase/sunpeak/test-mcp-server
Claude Code and agent skill by alignbase/sunpeak
- community
Checking that the SKILL.md file is still in the repository.
Use when testing MCP servers -- e2e tests with the sunpeak inspector, visual regression testing, live testing against real ChatGPT, multi-model evals, Playwright configuration, or scaffolding test infrastructure with "sunpeak test init". Works with any MCP server (Python, Go, TypeScript, etc.), not just sunpeak projects.
Install
npx vskill@latest install alignbase/sunpeak/test-mcp-serverSKILL.md
The same SKILL.md was published earlier as neversight/learn-skills.dev/test-mcp-server.
Test MCP Server
sunpeak includes a testing framework that works with any MCP server, regardless of language or framework. It provides four testing layers: e2e tests (inspector-based), visual regression, live tests (against real ChatGPT), and evals (multi-model tool calling).
For sunpeak app projects, testing integrates automatically. For non-sunpeak MCP servers (Python, Go, Rust, etc.), sunpeak test init scaffolds a self-contained test directory.
Getting Started
sunpeak test init detects three project types:
- sunpeak projects -- Adds
defineConfig()and eval boilerplate - JS/TS projects -- Adds Playwright config, smoke test, and evals at project root
- Non-JS projects -- Creates a self-contained
tests/sunpeak/directory with its ownpackage.json
Getting Reference Code
Clone the sunpeak repo for working test examples:
Test examples live at /tmp/sunpeak/packages/sunpeak/template/tests/. This includes e2e tests, simulations, evals, and live tests.
Commands
Flags are additive: --e2e --live --eval runs all three. --update implies --visual. --eval and --live are never included in the default run (they cost money). --unit is only for sunpeak app framework projects (created with sunpeak new), not standalone testing.
E2E Tests with the mcp and inspector Fixtures
Import test and expect from sunpeak/test. The mcp fixture provides protocol-level methods, and the inspector fixture handles rendering, double-iframe traversal, URL construction, and host selection. Tests run automatically across ChatGPT and Claude hosts via Playwright projects.
When testing named object output schemas with MCP SDK 2.4, assert against the object in structuredContent directly, including on 2025-11-25 connections. Non-object legacy results still use { result: value }. Invalid URI syntax in $id or $ref can prevent a tool schema from compiling; use valid IDs before diagnosing a missing tool as an inspector failure.
mcp Fixture API
Protocol-level methods (raw MCP data, no rendering):
| Method | Description | |
|---|---|---|
listTools() | List all tools from the server. Returns Tool[]. | |
callTool(name, input?) | Call a tool, return the raw MCP result. No rendering. | |
listResources() | List all resources from the server. Returns Resource[]. | |
readResource(uri) | Read a resource by URI. Returns the content string. |
inspector Fixture API
Rendering methods and properties:
| Method | Description | |
|---|---|---|
renderTool(name, input?, options?) | Render a tool result in the inspector, return InspectorResult |
| Property | Description | |
|---|---|---|
page | Raw Playwright Page for chrome-level assertions | |
host | Current host ID ('chatgpt' or 'claude') from Playwright project |
InspectorResult API
| Property/Method | Description | |
|---|---|---|
app() | Get FrameLocator for rendered resource UI (handles double-iframe) | |
content | Raw MCP content items | |
structuredContent | Structured content from tool response | |
isError | Whether the tool returned an error | |
source | Where the data came from: 'fixture' or 'server' | |
screenshot(name?, options?) | Take a screenshot and compare against a baseline (only runs with --visual) |
MCP-Native Matchers
| Matcher | Description | |
|---|---|---|
expect(result).toBeError() | Assert tool result is an error | |
expect(result).toHaveTextContent(str) | Assert any content text contains string | |
expect(result).toHaveStructuredContent(shape) | Assert structuredContent matches shape | |
expect(result).toHaveContentType(type) | Assert content includes item of given type |
renderTool
inspector.renderTool renders the tool result in the inspector and returns an InspectorResult. With input, the tool is called on the real server with those arguments. Without input, simulation fixture data is used when available, or the real server is called with empty args.
| Option | Type | Description | |||
|---|---|---|---|---|---|
theme | `'light' \ | 'dark'` | Color theme (default: inspector default) | ||
displayMode | `'inline' \ | 'pip' \ | 'fullscreen'` | Display mode | |
timeout | number | Iframe render timeout in ms (default: 15s, or mcpTimeout from config) | |||
prodResources | boolean | Use production-built resource bundles |
Configuring Timeouts
Set default timeouts in Playwright config for servers that need more time:
Visual Regression Testing
Use result.screenshot() to capture and compare screenshots against saved baselines. Comparisons only run with sunpeak test --visual. Without it, screenshot() silently skips, so you can include it in regular e2e tests.
By default, result.screenshot() captures the rendered app inside the double-iframe, not the inspector chrome. Keep visual baselines scoped to the app unless the test is explicitly about the inspector UI.
screenshot() options:
| Option | Type | Description | |
|---|---|---|---|
element | Locator | Specific locator to screenshot instead of the default target | |
threshold | number | Pixel comparison threshold (0-1) | |
maxDiffPixelRatio | number | Maximum allowed ratio of differing pixels (0-1) |
All Playwright toHaveScreenshot options are passed through.
Configure project-wide visual defaults:
Playwright Config
For non-sunpeak MCP servers, pass a server option:
Locator Rules
Resource content renders inside a double-iframe (outer sandbox proxy + inner app iframe). In e2e tests:
- Use
result.app().locator(...)(frominspector.renderTool()) for resource content. This handles the double-iframe sandbox architecture. - Use
inspector.page.locator(...)only for inspector chrome elements (header,#root, sidebar controls).
Simulations
E2e tests consume simulation fixtures defined in tests/simulations/*.json. For sunpeak projects, simulations are part of the app project structure (see the create-sunpeak-app skill for the simulation file format). For non-sunpeak servers, renderTool connects to the live server via the configured server option.
Live Testing (against real ChatGPT)
Live tests validate MCP Apps inside real ChatGPT. They use Playwright to open the user's browser, send messages that trigger tool calls, and assert on the rendered app iframe.
Before the first run, make sure Developer mode is enabled. If needed, click the bottom-left user menu and select Settings > Security and login > Developer mode. Then return to the ChatGPT homepage, click Plugins in the sidebar, and open the app if it is already there or select + to create it with the tunneled /mcp URL. Set the app name to the package.json name because live tests use that name when invoking the app.
Live Test Pattern
One spec file per resource. Import test and expect from sunpeak/test/live -- the live fixture handles login, MCP refresh, and host-specific message formatting.
Config is a one-liner:
live Fixture API
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/test-mcp-server/SKILL.md
Popularity
- Repository stars
- 218
- Repository forks
- 12
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/alignbase/sunpeak/test-mcp-server)