Skip to main content
Glama
ConnorBoetig-dev

Unrestricted Development MCP Server

git_status

Check Git repository status to view staged, unstaged, and untracked files. Use this tool to monitor file changes and track development progress in your working directory.

Instructions

Get repository status showing staged, unstaged, and untracked files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoRepository directory (defaults to current directory)
shortNoShow short format status

Implementation Reference

  • The main handler function for 'git_status' tool. Executes the git status command with optional short format and cwd, using the executeGitCommand helper.
    export async function gitStatus(args: z.infer<typeof gitStatusSchema>): Promise<ToolResponse> { const shortFlag = args.short ? '--short' : ''; return executeGitCommand(`git status ${shortFlag}`, args.cwd); }
  • Zod schema for input validation of git_status tool parameters.
    export const gitStatusSchema = z.object({ cwd: z.string().optional().describe('Repository directory (defaults to current directory)'), short: z.boolean().optional().default(false).describe('Show short format status') });
  • Tool registration definition in gitTools array, including name, description, and JSON input schema for MCP tool listing.
    { name: 'git_status', description: 'Get repository status showing staged, unstaged, and untracked files', inputSchema: { type: 'object', properties: { cwd: { type: 'string', description: 'Repository directory (defaults to current directory)' }, short: { type: 'boolean', default: false, description: 'Show short format status' } } } },
  • Helper function that executes git commands via child_process.execAsync and formats the response as ToolResponse.
    async function executeGitCommand(command: string, cwd?: string): Promise<ToolResponse> { try { const { stdout, stderr } = await execAsync(command, { cwd: cwd || process.cwd(), shell: '/bin/bash', maxBuffer: 10 * 1024 * 1024 // 10MB buffer }); return { content: [ { type: "text" as const, text: JSON.stringify({ success: true, command: command, stdout: stdout.trim(), stderr: stderr.trim(), cwd: cwd || process.cwd() }, null, 2) } ] }; } catch (error: any) { return { content: [ { type: "text" as const, text: JSON.stringify({ success: false, command: command, stdout: error.stdout?.trim() || '', stderr: error.stderr?.trim() || error.message, exitCode: error.code || 1, cwd: cwd || process.cwd() }, null, 2) } ], isError: true }; }
  • src/index.ts:357-359 (registration)
    Dispatcher in main CallToolRequest handler that validates input with gitStatusSchema and calls the gitStatus handler.
    if (name === 'git_status') { const validated = gitStatusSchema.parse(args); return await gitStatus(validated);

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