Repository navigation
Releases
Releases · aviveldan/mcp-apps-testing
Release v0.2.1
Release version 0.2.1. See RELEASE_NOTES.md for details.
Release v0.2.0
Release version 0.2.0. See RELEASE_NOTES.md for details.
v0.1.5
Full Changelog: v0.1.4...v0.1.5
v0.1.1
Full Changelog: 0.1.1...v0.1.1
0.1.1
What's Changed
- Migrate npm publishing to OIDC Trusted Publishing by @Copilot in #11
- Add npm package badges and table of contents to README by @Copilot in #13
- Update README opening paragraph for clarity by @Copilot in #15
- Replace SVG architecture diagram with Mermaid.js by @Copilot in #17
- Fix event listener memory leak in waitForMessage timeout handler by @Copilot in #23
- Sanitize CSS theme variables to prevent injection attacks by @Copilot in #22
- Refactor testing framework by @aviveldan in #20
New Contributors
- @aviveldan made their first contribution in #20
Full Changelog: v0.1.0...0.1.1
v0.1.0 - Initial Release
mcp-apps-testing v0.1.0 - Initial Release
The first UI testing framework built specifically for Model Context Protocol applications.
Test your MCP apps exactly how users experience them - with real browser rendering, simulated IDE environments, and complete JSON-RPC message control.
Highlights
- MockMCPHost - Simulates IDE hosting environments (Claude, VS Code) with auto-response to common protocol messages
- TransportInterceptor - Mock, record, and assert on every JSON-RPC request and response
- Host Profiles - Pre-configured environments (
Claude,VSCode,Generic) with distinct capabilities and themes - Fluent API - Human-readable test code with
createMCPTestContext()for quick setup - UI + Protocol Testing - Validate both visual rendering and protocol interactions in a single framework
Installation
npm install mcp-apps-testing @playwright/test --save-dev
npx playwright install chromiumQuick Example
import { test, expect } from '@playwright/test';
import { MockMCPHost } from 'mcp-apps-testing';
test('MCP app responds to tool calls', async () => {
const host = new MockMCPHost({ hostProfile: 'Claude' });
host.getInterceptor().mockResponse('tools/call', (req) => ({
jsonrpc: '2.0',
id: req.id,
result: { content: [{ type: 'text', text: 'Hello, World!' }] }
}));
const response = await host.callTool('greet', { name: 'World' });
expect(response.result.content[0].text).toBe('Hello, World!');
await host.cleanup();
});Exported API
| Export | Type | Description |
|---|---|---|
MockMCPHost |
Class | Simulates an MCP host environment |
TransportInterceptor |
Class | Intercepts and mocks JSON-RPC messages |
HostProfiles |
Object | Pre-built host profile configurations |
ClaudeProfile / VSCodeProfile / GenericProfile |
Object | Individual host profiles |
applyTheme |
Function | Applies a host profile's theme |
createMCPTestContext |
Function | Factory for quick test setup |
Requirements
- Node.js >= 18.0.0
@playwright/test^1.40.0 (peer dependency)
Links
Note: This is a pre-1.0 release (
0.1.0). The API may evolve based on community feedback. Please report any issues or feature requests!