Skip to main content
Glama
ConnorBoetig-dev

Unrestricted Development MCP Server

docker_compose_ps

List running containers in a Docker Compose stack to monitor service status and manage your development environment effectively.

Instructions

List containers in a docker-compose stack

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
servicesNoOnly show specific services
allNoShow all stopped containers
fileNoPath to compose file
cwdNoWorking directory

Implementation Reference

  • The main handler function that executes the docker compose ps command using the shared executeDockerCommand helper. Detects docker-compose vs docker compose V2.
    export async function dockerComposePs(args: z.infer<typeof dockerComposePsSchema>): Promise<ToolResponse> {
      const allFlag = args.all ? '-a' : '';
      const services = args.services ? args.services.join(' ') : '';
      const fileFlag = args.file ? `-f ${args.file}` : '';
      const composeCmd = await getComposeCmd();
    
      return executeDockerCommand(
        `${composeCmd} ${fileFlag} ps ${allFlag} ${services}`.trim(),
        args.cwd
      );
    }
  • Zod schema for input validation of docker_compose_ps tool parameters.
    export const dockerComposePsSchema = z.object({
      services: z.array(z.string()).optional().describe('Only show specific services'),
      all: z.boolean().optional().default(false).describe('Show all stopped containers'),
      file: z.string().optional().describe('Path to compose file'),
      cwd: z.string().optional().describe('Working directory')
    });
  • src/index.ts:491-494 (registration)
    Dispatch handler in main MCP server that routes calls to docker_compose_ps by name, validates args, and invokes the handler.
    if (name === 'docker_compose_ps') {
      const validated = dockerComposePsSchema.parse(args);
      return await dockerComposePs(validated);
    }
  • Tool definition object in dockerTools array used for listing available tools in MCP server.
    {
      name: 'docker_compose_ps',
      description: 'List containers in a docker-compose stack',
      inputSchema: {
        type: 'object',
        properties: {
          services: { type: 'array', items: { type: 'string' }, description: 'Only show specific services' },
          all: { type: 'boolean', default: false, description: 'Show all stopped containers' },
          file: { type: 'string', description: 'Path to compose file' },
          cwd: { type: 'string', description: 'Working directory' }
        }
      }
    },

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/ConnorBoetig-dev/mcp2'

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