Skip to main content
Glama

Basic Math MCP Server

by bahfahh
test.js703 B
import { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'; (async () => { const transport = new StdioClientTransport({ command: 'node', args: ['build/index.js'] }); const client = new Client({ name: 'test-client', version: '1.0.0' }); await client.connect(transport); const res1 = await client.callTool({ name: 'sum', arguments: { a: 20.12, b: 123456 } }); console.log(JSON.stringify(res1, null, 2)); const res2 = await client.callTool({ name: 'subtraction', arguments: { a: 12345, b: 2345 } }); console.log(JSON.stringify(res2, null, 2)); process.exit(0); })();

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/bahfahh/mcptest'

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