Skip to main content
Glama

Chess MCP Server

server.ts850 B
import express from "express"; import { Middleware } from "./lib/mcp"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; function newServer() { const server = new McpServer({ name: "Sample MCP Server", version: "0.0.1", }); server.registerTool( "add_numbers", { description: "A tool to add two numbers", inputSchema: { left: z.number().describe("The left operand"), right: z.number().describe("The right operand") }, }, async ({ left, right }) => { return { content: [{ type: "text", text: `The sum of ${left} and ${right} is ${left + right}`, }] }; }, ); return server; } const app = express(); app.use("/mcp", Middleware(newServer)); console.log("Starting server on http://localhost:3000/mcp"); app.listen(3000);

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/ibuildthecloud/chess-mcp'

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