Skip to main content
Glama

local_dev_from_github

Create local development environments from GitHub repositories to run tests and check code coverage in sandboxed setups.

Instructions

Create a new local development environment from a GitHub repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
github_urlYesGitHub repository URL

Implementation Reference

  • Tool handler in call_tool function: checks tool name, calls create_environment_from_github with github_url argument, constructs success response with environment details.
    if name == "local_dev_from_github":
        logger.debug("Creating environment from GitHub")
        env = await create_environment_from_github(arguments["github_url"])
        result = {
            "success": True,
            "data": {
                "id": env.id,
                "working_dir": str(env.sandbox.work_dir),
                "created_at": env.created_at.isoformat(),
                "runtime": env.runtime_config.name.value,
            },
        }
        logger.debug(f"Environment created successfully: {result}")
        return [types.TextContent(type="text", text=json.dumps(result))]
  • Input schema defining the required 'github_url' parameter.
    inputSchema={
        "type": "object",
        "properties": {
            "github_url": {"type": "string", "description": "GitHub repository URL"}
        },
        "required": ["github_url"],
    },
  • Registration of the tool in the global tools list used by list_tools().
    types.Tool(
        name="local_dev_from_github",
        description="Create a new local development environment from a GitHub repository",
        inputSchema={
            "type": "object",
            "properties": {
                "github_url": {"type": "string", "description": "GitHub repository URL"}
            },
            "required": ["github_url"],
        },
    ),
  • Helper function implementing the core logic: clones GitHub repository into a temporary staging sandbox, creates the environment from the cloned path, and cleans up staging.
    async def create_environment_from_github(
        github_url: str, branch: Optional[str] = None
    ) -> Environment:
        """Create new environment from GitHub repository."""
        staging = await create_sandbox("mcp-staging-")
        try:
            repo = await clone_github_repository(staging, github_url, branch)
            env = await create_environment_from_path(repo)
            return env
        finally:
            cleanup_sandbox(staging)

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/txbm/mcp-local-dev'

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