Skip to main content
Glama
common.test.js1.53 kB
/* vim: set expandtab tabstop=2 shiftwidth=2 foldmethod=marker: */ "use strict"; var fs = require('fs'); var http = require('http'); var net = require('net'); var should = require('should'); var common = require('../lib/common.js'); var cleanSocketFiles = function (path, callback) { fs.readdir(path, function (err, res) { (res || []).forEach(function (fn) { if (String(fn).match(/\.socket$/)) { fs.unlinkSync(path + '/' + fn); } }); callback(err); }); }; beforeEach(function (done) { cleanSocketFiles(__dirname, done); }); afterEach(function (done) { cleanSocketFiles(__dirname, done); }); describe('common functions', function () { it('handle_close_after_bind_failed', function () { should.ok(!common.getHandle('/i/am/denied.socket')); }); var sock = __dirname + '/' + process.version + '.a.socket'; [33046, '33046', sock].forEach(function (idx) { it('listen at: ' + idx, function (done) { var _me = http.createServer(function (req, res) { res.end(req.url); }); var s = common.listen2(common.getHandle(idx), function (socket) { _me.emit('connection', socket); }); var options = { 'path' : '/' + idx, }; if ('number' === (typeof idx) || idx.match(/^\d+$/)) { options.host = 'localhost'; options.port = Number(idx); } else { options.socketPath = idx; } http.get(options, function (res) { s.close(); done(); }); }); }); });

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/Sunil-paudel/mcpserverasof2025updated'

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