UNPKG

@chainreactionom/nano-mcp

Version:

NANO cryptocurrency wallet implementation for MCP with comprehensive testing

34 lines (30 loc) 800 B
#!/usr/bin/env node import { NanoMCP } from './mcp.js'; import { MCPRequest } from './mcp-types.js'; const server = new NanoMCP(); // Initialize request handler server.setRequestHandler('initialize', async (request: MCPRequest) => { return { version: '1.0.0', capabilities: { methods: [ 'getBalance', 'getAccountInfo', 'getBlockCount', 'getVersion', 'convertToNano', 'convertFromNano', ], }, }; }); // Method call handler server.setRequestHandler('call', async (request: MCPRequest) => { const { method, params } = request.params; return await server.handleRequest(method, params); }); // Start the server server.start().catch(error => { console.error('Failed to start MCP server:', error); process.exit(1); });