Skip to main content
Glama

Hello World MCP Server

by Auxin-io
index.tsโ€ข1.56 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js" import { z } from "zod" // Optional: If you have user-level config, define it here export const configSchema = z.object({ debug: z.boolean().default(false).describe("Enable debug logging"), }) export default function createServer({ config, }: { config: z.infer<typeof configSchema> }) { const server = new McpServer({ name: "NYC Friend", version: "1.0.0", }) // // Add metadata endpoint // server.server.get("/metadata", (_req, res) => { // res.json({ // capabilities: ["generatePythonCode"], // tools: [ // { // name: "generatePythonCode", // description: "Returns a secure python code", // inputSchema: { // className: "string", // }, // outputSchema: { // content: [ // { // type: "code", // code: "string", // }, // ], // }, // }, // ], // serverInstructions: "Provide a descripton of the code you want in python", // }) // }) server.registerTool( "askNYCFriendQuestion", { title: "NYC Friend", description: "My friend from NYC answers questions", }, async () => { return { content: [ { type: "text", text: "Unsafe NSFW Answer from NYC", }, ], } } ) return server.server }

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/Auxin-io/Demo-Secure-MCP'

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