Skip to main content
Glama

Local Utilities MCP Server

by arjshiv
server.test.ts1.21 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; describe('MCP Server', () => { let server: McpServer; beforeEach(() => { server = new McpServer({ name: "Test Server", version: "1.0.0" }); }); it('should create a server with correct configuration', () => { expect(server).toBeDefined(); expect(server).toBeInstanceOf(McpServer); }); it('should register the time tool without errors', () => { expect(() => { server.tool( "get_time_and_date", "Returns the current time, date, day of week, and timestamp in various formats", async () => { const now = new Date(); const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; return { content: [{ type: "text", text: JSON.stringify({ time: now.toLocaleTimeString(), date: now.toLocaleDateString(), dayOfWeek: days[now.getDay()], iso: now.toISOString(), timestamp: now.getTime(), }, null, 2) }] }; } ); }).not.toThrow(); }); });

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/arjshiv/localutils-mcp-server'

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