Skip to main content
Glama

Ultimate MCP Coding Platform

docker.js1.31 kB
import { spawnSync } from 'node:child_process'; import { runCommand } from './process.js'; let composeInvocation; export function ensureDocker() { const result = spawnSync('docker', ['--version'], { stdio: 'ignore' }); if (result.error || result.status !== 0) { throw new Error('Docker is required but was not found in PATH. Install Docker Desktop or the Docker Engine.'); } } function detectCompose() { if (composeInvocation) { return composeInvocation; } const dockerCompose = spawnSync('docker', ['compose', 'version'], { stdio: 'ignore' }); if (!dockerCompose.error && dockerCompose.status === 0) { composeInvocation = { command: 'docker', baseArgs: ['compose'] }; return composeInvocation; } const legacyCompose = spawnSync('docker-compose', ['version'], { stdio: 'ignore' }); if (!legacyCompose.error && legacyCompose.status === 0) { composeInvocation = { command: 'docker-compose', baseArgs: [] }; return composeInvocation; } throw new Error('Neither "docker compose" nor "docker-compose" is available. Install the Docker Compose plugin.'); } export async function runCompose(args, options = {}) { const invocation = detectCompose(); const fullArgs = [...invocation.baseArgs, ...args]; await runCommand(invocation.command, fullArgs, options); }

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/Senpai-Sama7/Ultimate_MCP'

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