Skip to main content
Glama
index.ts791 B
#!/usr/bin/env node import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; import { z } from 'zod'; import tools from './tools/index.js'; // Create an MCP server const server = new McpServer({ name: 'Sui-mcp', version: '1.0.0', }); for (const tool of tools) { const schema = tool.paramsSchema as z.ZodObject<any>; const cb = ((args: any) => tool.cb(args)) as any; server.tool(tool.name, tool.description, schema.shape, cb); } async function main() { const transport = new StdioServerTransport(); await server.connect(transport); console.error('MCP Server running on stdio'); } main().catch(error => { console.error('Fatal error in main():', error); process.exit(1); });

Implementation Reference

Latest Blog Posts

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/0xdwong/sui-mcp'

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