Skip to main content
Glama

Yes or No MCP

by a-polishchuk
stdio-example.ts658 B
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { z } from "zod"; const server = new McpServer({ name: "Yes or No Service", version: "1.0.0", }); server.tool( "getYesOrNo", { question: z.string(), }, async ({ question }) => { return { content: [ { type: "text", text: Math.random() > 0.5 ? "YES" : "NO", }, ], }; }, ); const transport = new StdioServerTransport(); await server.connect(transport);

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/a-polishchuk/mcp-example-stdio'

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