Skip to main content
Glama
jbroll

MCP Build Environment Service

by jbroll

env

Display environment variables and build tool versions for software projects. Optionally isolate configurations by Git branch using worktrees.

Instructions

Show environment information including environment variables and versions of key build tools (gcc, g++, python, make, cmake, etc.). If branch is specified, creates/uses a hidden worktree (.repo@branch) for isolation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoYesRepository name (required)
branchNoGit branch name (optional). If provided, uses isolated worktree.

Implementation Reference

  • The main handler function for the 'env' tool. It retrieves the repo and optional branch from input arguments, checks for the existence of the env_info.sh script, and executes it within the specified repository's worktree using the shared execute_in_worktree method.
    async def handle_env(self, args: Dict[str, Any]) -> List[TextContent]: """Handle env command""" repo = args.get("repo") branch = args.get("branch") # Execute env info script if not ENV_INFO_SCRIPT.exists(): raise FileNotFoundError(f"Environment info script not found: {ENV_INFO_SCRIPT}") # Execute in appropriate worktree with locking result = await self.execute_in_worktree(repo, branch, [str(ENV_INFO_SCRIPT)]) return [TextContent(type="text", text=result)]
  • Pydantic-like JSON schema definition for the 'env' tool's input parameters in the tool registry returned by get_tools_list().
    Tool( name="env", description="Show environment information including environment variables " "and versions of key build tools (gcc, g++, python, make, cmake, etc.). " "If branch is specified, creates/uses a hidden worktree (.repo@branch) for isolation.", inputSchema={ "type": "object", "properties": { "repo": { "type": "string", "description": "Repository name (required)" }, "branch": { "type": "string", "description": "Git branch name (optional). If provided, uses isolated worktree." } }, "required": ["repo"] } ),
  • src/server.py:461-462 (registration)
    Dispatch registration within the central execute_tool handler that routes 'env' tool calls to the specific handle_env function.
    elif name == "env": return await self.handle_env(arguments)
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/jbroll/mcp-build'

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