@slbdn/mcp-tester 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +106 -0
- package/LICENSE +21 -0
- package/README.md +1567 -0
- package/dist/client/MCPClient.d.ts +68 -0
- package/dist/client/MCPClient.d.ts.map +1 -0
- package/dist/client/MCPClient.js +329 -0
- package/dist/client/MCPClient.js.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +2 -0
- package/dist/client/index.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/env.d.ts +4 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/env.js +15 -0
- package/dist/utils/env.js.map +1 -0
- package/dist/utils/errors.d.ts +21 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +47 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/logger.d.ts +29 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +49 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +86 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Critical**: Removed duplicate process spawn in `MCPClient.start()` that spawned the server twice (once manually, once via StdioClientTransport). The transport now solely manages the server process lifecycle.
|
|
12
|
+
- **Critical**: Fixed broken example files (`basic-test.ts`, `full-test.ts`) that called `client.start()` without specifying a server path
|
|
13
|
+
- Fixed `MCPClient.stop()` to properly close client before transport, avoiding potential hanging connections
|
|
14
|
+
- Fixed `@ts-ignore` usage in test files — replaced with `@ts-expect-error` per project conventions
|
|
15
|
+
- Fixed `any` types in `resources-prompts.test.ts` — replaced with proper `MCPClient` type and removed duplicate dynamic imports
|
|
16
|
+
- Fixed `setElicitationHandler()` to use proper TypeScript types instead of `any`
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- `MCPClient.stop()` now calls `client.close()` + `transport.close()` instead of manual SIGTERM/SIGKILL
|
|
20
|
+
- Updated `@modelcontextprotocol/sdk` from `^1.25.2` to `^1.29.0`
|
|
21
|
+
- Improved `src/index.ts` exports to include error classes, logger types, and `RetryOptions`
|
|
22
|
+
- Updated `package.json` `files` field to exclude test files from npm package (40 → 28 files)
|
|
23
|
+
- `resources-prompts.test.ts` now registers custom matchers via `expect.extend()`
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
- Pre-commit hooks via Husky + lint-staged (runs `eslint --fix` and `prettier --write` on staged `.ts` files)
|
|
27
|
+
- `RetryOptions` type exported from client index
|
|
28
|
+
- Code review findings added to TODO.md as items 40-48
|
|
29
|
+
- Configurable logging system with multiple log levels (debug, info, warn, error, none)
|
|
30
|
+
- Custom error classes (MCPClientError, MCPTimeoutError, MCPConnectionError, MCPNotStartedError, MCPAlreadyStartedError, MCPServerError)
|
|
31
|
+
- Retry logic with exponential backoff for failed requests
|
|
32
|
+
- Protocol logging option for debugging MCP communication
|
|
33
|
+
- `setLogLevel()` method to dynamically change log level at runtime
|
|
34
|
+
- `logLevel`, `enableProtocolLogging`, `retries`, `retryDelay`, and `startupDelay` configuration options
|
|
35
|
+
- Comprehensive JSDoc comments for all public APIs
|
|
36
|
+
- Utility functions for environment variable filtering and merging
|
|
37
|
+
- Better process cleanup with SIGTERM and SIGKILL
|
|
38
|
+
- Comprehensive AGENTS.md documentation (557 lines) for AI agents working with the codebase
|
|
39
|
+
- Detailed TODO.md roadmap (719 lines) with 38 improvement tasks organized by priority
|
|
40
|
+
- Progress tracking system in TODO.md with status indicators ([ ] not started, [/] in progress, [x] completed)
|
|
41
|
+
- Package metadata for npm publishing: repository, bugs, homepage fields added to package.json
|
|
42
|
+
- .npmignore file created to control what files are published to npm
|
|
43
|
+
- Roadmap section in AGENTS.md linking to TODO.md for planned improvements
|
|
44
|
+
- "For AI Agents" section added to README.md with comprehensive description and link to AGENTS.md
|
|
45
|
+
- AGENTS.md link added to README.md Table of Contents and Additional Resources section
|
|
46
|
+
- Dependabot configuration (.github/dependabot.yml) for automated npm dependency updates
|
|
47
|
+
- Weekly dependency update schedule with Monday 05:00 UTC check
|
|
48
|
+
- Automatic PRs for dependency updates with "dependencies", "npm", and "dependabot" labels
|
|
49
|
+
- Additional npm badges added to README.md:
|
|
50
|
+
- npm downloads badge (monthly download count)
|
|
51
|
+
- npm license badge
|
|
52
|
+
- Updated GitHub Actions test status badge to use correct repository URL
|
|
53
|
+
- Test helpers and custom matchers for Jest:
|
|
54
|
+
- `src/__tests__/matchers.ts` with custom Jest matchers:
|
|
55
|
+
- `toHaveTool(toolName)` - Check if tool exists
|
|
56
|
+
- `toHaveResource(uri)` - Check if resource exists
|
|
57
|
+
- `toHavePrompt(promptName)` - Check if prompt exists
|
|
58
|
+
- `toHaveToolWithSchema(toolName)` - Check if tool has schema
|
|
59
|
+
- `src/__tests__/helpers.ts` with test utilities:
|
|
60
|
+
- `createTestClient(options?)` - Create client with defaults
|
|
61
|
+
- `createTestSuite(config, options?)` - Auto setup/teardown
|
|
62
|
+
- `setupTestServer(config, options?)` - Manual server setup
|
|
63
|
+
- `teardownTestServer(client)` - Manual server cleanup
|
|
64
|
+
- `waitForClientState(client, isConnected, timeout?)` - Wait for state
|
|
65
|
+
- `createMockServerConfig(args?)` - Create server config
|
|
66
|
+
- `runWithTimeout(fn, timeout?)` - Run with timeout
|
|
67
|
+
- `retryUntil(fn, attempts?, delay?)` - Retry until success
|
|
68
|
+
- `callTool(client, toolName, args?)` - Tool call helper
|
|
69
|
+
- `validateToolResult(result)` - Validate result
|
|
70
|
+
- `src/__tests__/helpers-example.test.ts` - Usage examples
|
|
71
|
+
- Updated `src/__tests__/client.test.ts` to use helpers
|
|
72
|
+
- Documentation in README.md for helpers and matchers with usage examples
|
|
73
|
+
|
|
74
|
+
### Changed
|
|
75
|
+
- Replaced all `any` types with proper TypeScript interfaces
|
|
76
|
+
- Improved error messages with error codes
|
|
77
|
+
- Enhanced timeout handling with customizable delays
|
|
78
|
+
- Better TypeScript type safety throughout the codebase
|
|
79
|
+
- Improved server process management and cleanup
|
|
80
|
+
- Environment variable handling now uses utility functions
|
|
81
|
+
- Updated package.json with repository, bugs, and homepage fields for npm registry
|
|
82
|
+
|
|
83
|
+
### Fixed
|
|
84
|
+
- Type safety issues with environment variable merging
|
|
85
|
+
- Process cleanup now properly handles both SIGTERM and SIGKILL
|
|
86
|
+
- Typo in AGENTS.md: "Security Considerations" fixed (was "Security Considerations")
|
|
87
|
+
|
|
88
|
+
### Deprecated
|
|
89
|
+
- None
|
|
90
|
+
|
|
91
|
+
### Removed
|
|
92
|
+
- None
|
|
93
|
+
|
|
94
|
+
### Security
|
|
95
|
+
- None
|
|
96
|
+
|
|
97
|
+
## [1.0.0] - 2026-01-19
|
|
98
|
+
|
|
99
|
+
### Added
|
|
100
|
+
- Initial release of MCP Tester
|
|
101
|
+
- Full MCP protocol support (Tools, Resources, Prompts, Sampling, Elicitation, Notifications)
|
|
102
|
+
- Jest integration with 26 tests
|
|
103
|
+
- Mock MCP server for unit testing
|
|
104
|
+
- TypeScript support with full type definitions
|
|
105
|
+
- CI/CD pipeline with GitHub Actions
|
|
106
|
+
- Comprehensive documentation and examples
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MCP Tester
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|