Skip to main content
Glama

MCP Ethers Wallet

test-client.js1.65 kB
import { McpStandardClient } from './build/src/tests/client/mcpStandardClient.js'; import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'; async function testProvider() { console.log('Starting MCP client test'); // Create client const client = new McpStandardClient({ clientName: "provider-debug-client", clientVersion: "1.0.0" }); // Connect to the MCP server const transport = new StdioClientTransport('node', ['build/src/mcpServer.js']); await client.connect(transport); console.log('Connected to MCP server'); try { // First try with network name console.log('Testing with provider name "MEGA Testnet"'); const result1 = await client.callTool('getBlockNumber', { provider: 'MEGA Testnet' }); console.log('Result:', result1); } catch (error) { console.error('Error with provider name:', error); } try { // Try with the network alias console.log('\nTesting with provider alias "mega"'); const result2 = await client.callTool('getBlockNumber', { provider: 'mega' }); console.log('Result:', result2); } catch (error) { console.error('Error with provider alias:', error); } try { // Try with direct RPC URL console.log('\nTesting with direct RPC URL'); const result3 = await client.callTool('getBlockNumber', { provider: 'https://carrot.megaeth.com/rpc' }); console.log('Result:', result3); } catch (error) { console.error('Error with RPC URL:', error); } // Disconnect await client.disconnect(); console.log('Test complete'); } testProvider().catch(console.error);

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