Skip to main content
Glama

MCP SageMath Server

by GaloisHLee
client.ts1.1 kB
import { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js'; async function main() { const url = new URL(process.env.MCP_URL || 'http://localhost:3000/mcp'); const client = new Client({ name: 'sagemath-test-client', version: '0.0.1' }); const transport = new StreamableHTTPClientTransport(url); await client.connect(transport); // List available tools const tools = await client.listTools(); console.log('Available tools:', tools.tools.map(t => t.name)); // Call version tool const versionResult = await client.callTool({ name: 'sagemath.version', arguments: {} }); console.log('sagemath.version result:', JSON.stringify(versionResult)); // Call evaluate tool const evalResult = await client.callTool({ name: 'sagemath.evaluate', arguments: { code: 'print(2+2)' } }); console.log('sagemath.evaluate result:', JSON.stringify(evalResult)); await client.close(); } main().catch((error) => { console.error('MCP test client error:', error); process.exit(1); });

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/GaloisHLee/mcp-server-sagemath'

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