Skip to main content
Glama
jbroll

MCP Build Environment Service

by jbroll

env

Display environment variables and build tool versions for software projects. Optionally create isolated worktrees by specifying a Git branch to maintain project separation.

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. Extracts repo and branch arguments, checks for the existence of the env_info.sh script, and executes it within the repository's worktree using execute_in_worktree. Returns the output as TextContent.
    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)]
  • The input schema definition for the 'env' tool, specifying required 'repo' parameter and optional 'branch'. Part of the Tool object returned by list_tools.
    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 point in the execute_tool method where the 'env' tool handler is invoked based on the tool name.
    elif name == "env": return await self.handle_env(arguments)
  • Defines the path to the external shell script (env_info.sh) that provides the actual environment information, executed by the handler.
    ENV_INFO_SCRIPT = Path(__file__).parent / "env_info.sh"

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