Skip to main content
Glama
stdio-manager.test.ts1.05 kB
import { test } from 'node:test' import assert from 'node:assert' import { StdioManager } from '../../../src/modules/stdio-manager.js' import path from 'node:path' test('StdioManager should handle notifications', async () => { const manager = new StdioManager() const serverId = 'test-server' const serverPath = path.resolve(process.cwd(), 'tests/fixtures/stdio-server.js') let notificationReceived = null const notificationPromise = new Promise(resolve => { manager.onNotification(serverId, (message) => { notificationReceived = message resolve(message) }) }) await manager.startServer(serverId, serverPath) // Give the server a moment to start and send a notification await new Promise(resolve => setTimeout(resolve, 500)) // The test server should send a notification on start // Let's wait for it await notificationPromise assert.deepStrictEqual(notificationReceived, { type: 'notification', message: 'server ready' }) const server = manager['processes'].get(serverId) server?.kill() })

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/Jakedismo/master-mcp-server'

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