Skip to main content
Glama
gemini2026

Documentation Search MCP Server

by gemini2026

manage_dev_environment

Set up local development environments using Docker Compose for services like databases and caches within project directories.

Instructions

Manages local development environments using Docker Compose.

Args:
    service: The service to set up (e.g., 'postgres', 'redis').
    project_path: The path to the project directory.

Returns:
    A confirmation message with the next steps.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serviceYes
project_pathNo.

Implementation Reference

  • The handler function decorated with @mcp.tool(), which registers the 'manage_dev_environment' tool and implements its core logic by generating Docker Compose files for development services.
    async def manage_dev_environment(service: str, project_path: str = "."):
        """
        Manages local development environments using Docker Compose.
    
        Args:
            service: The service to set up (e.g., 'postgres', 'redis').
            project_path: The path to the project directory.
    
        Returns:
            A confirmation message with the next steps.
        """
        from .docker_manager import create_docker_compose, TEMPLATES
    
        try:
            if service not in TEMPLATES:
                return {
                    "error": f"Service '{service}' not supported.",
                    "available_services": list(TEMPLATES.keys()),
                }
    
            compose_file = create_docker_compose(service, project_path)
    
            return {
                "status": "success",
                "message": f"✅ Successfully created 'docker-compose.yml' for '{service}' in '{project_path}'.",
                "next_steps": [
                    f"1. Review the generated file: {compose_file}",
                    "2. Run the service: docker-compose up -d",
                    "3. To stop the service: docker-compose down",
                ],
                "service_details": TEMPLATES[service]["services"],
            }
    
        except (ValueError, FileExistsError) as e:
            return {"error": str(e)}
        except Exception as e:
            return {"error": f"An unexpected error occurred: {str(e)}"}
  • The helper function 'create_docker_compose' that generates the docker-compose.yml file using predefined service templates (TEMPLATES dict). This is the core utility called by the tool handler.
    def create_docker_compose(service: str, path: str = ".") -> str:
        """
        Creates a docker-compose.yml file for a given service in the specified path.
    
        Args:
            service: The name of the service (e.g., 'postgres').
            path: The directory where the file will be created.
    
        Returns:
            The full path to the created docker-compose.yml file.
        """
        if service not in TEMPLATES:
            raise ValueError(
                f"Service '{service}' not supported. Available services: {list(TEMPLATES.keys())}"
            )
    
        compose_path = os.path.join(path, "docker-compose.yml")
    
        if os.path.exists(compose_path):
            # We can decide whether to overwrite, merge, or fail.
            # For now, we'll fail to avoid accidental data loss.
            raise FileExistsError(
                f"A 'docker-compose.yml' already exists at {path}. Please remove it first."
            )
    
        with open(compose_path, "w") as f:
            yaml.dump(TEMPLATES[service], f, default_flow_style=False, sort_keys=False)
    
        return compose_path
  • Predefined Docker Compose templates for services like postgres, redis, rabbitmq, used by create_docker_compose to generate environment-specific docker-compose.yml files.
    TEMPLATES: Dict[str, Dict] = {
        "postgres": {
            "version": "3.8",
            "services": {
                "db": {
                    "image": "postgres:15-alpine",
                    "restart": "always",
                    "environment": {
                        "POSTGRES_USER": "myuser",
                        "POSTGRES_PASSWORD": "mypassword",
                        "POSTGRES_DB": "mydatabase",
                    },
                    "ports": ["5432:5432"],
                    "volumes": ["postgres_data:/var/lib/postgresql/data/"],
                }
            },
            "volumes": {"postgres_data": {}},
        },
        "redis": {
            "version": "3.8",
            "services": {
                "redis": {
                    "image": "redis:7-alpine",
                    "restart": "always",
                    "ports": ["6379:6379"],
                    "volumes": ["redis_data:/data"],
                }
            },
            "volumes": {"redis_data": {}},
        },
        "rabbitmq": {
            "version": "3.8",
            "services": {
                "rabbitmq": {
                    "image": "rabbitmq:3-management-alpine",
                    "restart": "always",
                    "ports": ["5672:5672", "15672:15672"],
                    "environment": {
                        "RABBITMQ_DEFAULT_USER": "myuser",
                        "RABBITA_DEFAULT_PASS": "mypassword",
                    },
                    "volumes": ["rabbitmq_data:/var/lib/rabbitmq/"],
                }
            },
            "volumes": {"rabbitmq_data": {}},
        },
    }
  • The @mcp.tool() decorator registers the manage_dev_environment function as an MCP tool.
    async def manage_dev_environment(service: str, project_path: str = "."):
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions 'manages' with Docker Compose, implying it might start, stop, or configure services, but doesn't specify what actions are performed (e.g., setup, teardown, status checks). It lacks details on permissions needed, side effects, or error handling, leaving behavioral traits unclear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: the first sentence states the purpose, followed by structured sections for Args and Returns. Each sentence adds value, with no redundant information. However, it could be slightly more concise by integrating the example into the main text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (managing environments with Docker Compose), lack of annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't explain what 'manages' means operationally, what the return 'confirmation message' contains, or potential errors. For a tool with 2 parameters and no structured support, more detail is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds some meaning beyond the input schema: it explains 'service' with an example ('e.g., 'postgres', 'redis'') and 'project_path' as 'the path to the project directory.' However, with 0% schema description coverage, it doesn't fully compensate—e.g., it doesn't clarify if 'service' is a Docker service name or a type, or what 'manages' entails for these parameters. The baseline is 3 due to partial compensation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Manages local development environments using Docker Compose.' It specifies the verb ('manages') and resource ('local development environments'), and mentions the technology used ('Docker Compose'). However, it doesn't explicitly differentiate from sibling tools like 'get_environment_config' or 'generate_project_starter', which could also relate to development environments.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., Docker Compose installation), scenarios for use, or exclusions. Given sibling tools like 'get_environment_config' that might retrieve environment details, there's no indication of when to choose one over the other.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/gemini2026/documentation-search-mcp'

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