Skip to main content
Glama

MCP Ethers Wallet

DEVELOPMENT.md5.59 kB
# MCP Client Test Framework Development ## Task Description Build a comprehensive MCP (Model Context Protocol) client testing framework that can systematically test all 45 MCP server tools. This framework must be robust, extensible, and provide clear validation of MCP tool behavior. ## Success Criteria 1. [ ] Working MCP test client that can communicate with the server using JSON-RPC 2.0 2. [ ] Test execution framework that can run systematic tests 3. [ ] Response validation system with comprehensive checks 4. [ ] Test reporting system with clear results 5. [ ] Documentation and examples for test case creation 6. [ ] Support for all 45 MCP tools testing 7. [ ] Support for parameterized testing (multiple parameter combinations) 8. [ ] Handle both success and error scenarios 9. [ ] Support test configuration and customization 10. [ ] Enable easy addition of new test cases ## Implementation Plan ### Phase 1: Core MCP Test Client - [ ] Create MCPTestClient.ts with JSON-RPC 2.0 communication - [ ] Implement server initialization and capability discovery - [ ] Support all MCP message types (tool calls, prompts, resources) - [ ] Provide clean error handling and timeout management - [ ] Support concurrent tool testing ### Phase 2: Test Framework Components - [ ] Create TestRunner.ts for systematic test execution - [ ] Implement TestCase.ts with test case definitions - [ ] Create TestReporter.ts for results reporting - [ ] Support parallel test execution where safe - [ ] Provide progress reporting and logging ### Phase 3: Validation System - [ ] Create ResponseValidator.ts for MCP response validation - [ ] Implement ParameterValidator.ts for parameter validation - [ ] Create ErrorValidator.ts for error response validation - [ ] Implement TypeValidators.ts for type checking utilities - [ ] Support custom assertion types for different tool categories ### Phase 4: Test Data Management - [ ] Create TestDataManager.ts for test data loading - [ ] Implement ExpectedResponses.ts for expected response definitions - [ ] Create TestScenarios.ts for test scenario definitions - [ ] Support test filtering and selection - [ ] Generate comprehensive test reports ### Phase 5: Integration & Testing - [ ] Write meta-tests for the test framework - [ ] Verify MCP protocol communication - [ ] Test response validation logic - [ ] Validate test execution engine - [ ] Ensure proper error handling and reporting ## Architecture Decisions ### Test Framework Structure ``` tests/ ├── framework/ │ ├── MCPTestClient.ts # Core MCP protocol client │ ├── TestRunner.ts # Test execution engine │ ├── TestCase.ts # Test case definition types │ └── TestReporter.ts # Results reporting ├── validation/ │ ├── ResponseValidator.ts # MCP response validation │ ├── ParameterValidator.ts # Parameter validation │ ├── ErrorValidator.ts # Error response validation │ └── TypeValidators.ts # Type checking utilities └── data/ ├── TestDataManager.ts # Test data loading/management ├── ExpectedResponses.ts # Expected response definitions └── TestScenarios.ts # Test scenario definitions ``` ### Test Case Structure ```typescript interface TestCase { toolName: string; description: string; parameters: Record<string, any>; expectedResponse?: any; expectedError?: string; validationRules: ValidationRule[]; timeout?: number; } ``` ### Key Test Scenarios 1. Tool Discovery Testing - Verify all 45 tools are discoverable 2. Parameter Validation Testing - Test parameter enforcement and validation 3. Response Validation Testing - Verify response format and content 4. Error Scenario Testing - Test error handling and recovery ## Progress Log ### 2025-08-27 - Created worktree for MCP test framework development - Researched MCP protocol using Context7 documentation - Retrieved MCP TypeScript SDK documentation and specification - Analyzed existing project structure and test files - Created comprehensive development plan - ✅ Implemented MCPTestClient.ts with full JSON-RPC 2.0 support - ✅ Created comprehensive test cases for MCPTestClient - ✅ Implemented TestCase.ts with flexible test definitions - ✅ Created TestRunner.ts for systematic test execution - ✅ Implemented TestReporter.ts with multiple output formats - ✅ Created ResponseValidator.ts for MCP response validation - Framework supports all required features: - Tool, resource, and prompt testing - Parameterized testing - Concurrent execution - Multiple validation strategies - Comprehensive reporting (console, JSON, HTML, JUnit, Markdown) ## Review Feedback ### Pre-Implementation Review - [ ] Submit to o3 model for review - [ ] Update based on feedback ### Code Review Points - [ ] After Phase 1 completion - [ ] After Phase 3 completion - [ ] Final review before completion ## Notes - Using existing MCP TypeScript SDK from @modelcontextprotocol/sdk - Building on top of existing test infrastructure - Must integrate with Stream 1's blockchain infrastructure - Must support Stream 3's test case definitions ## Edge Cases - Concurrent tool execution conflicts - Large response handling - Timeout and network failures - Invalid parameter combinations - Server capability mismatches ## Testing Strategy - Meta-testing: Tests for the test framework itself - Unit tests for each component - Integration tests for full test runs - Performance tests for concurrent execution - Error scenario coverage

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/crazyrabbitLTC/mcp-ethers-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server