Skip to main content
Glama
ConnorBoetig-dev

Unrestricted Development MCP Server

git_rebase

Reapply commits from your current branch onto another branch to maintain a linear project history and integrate changes without merge commits.

Instructions

Reapply commits on top of another branch

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchNoBranch to rebase onto
cwdNoRepository directory
interactiveNoInteractive rebase (not supported)
abortNoAbort current rebase
continueNoContinue rebase after resolving conflicts

Implementation Reference

  • The main handler function that executes the git rebase command based on provided arguments, handling special cases like abort, continue, and interactive.
    export async function gitRebase(args: z.infer<typeof gitRebaseSchema>): Promise<ToolResponse> { if (args.abort) { return executeGitCommand('git rebase --abort', args.cwd); } if (args.continue) { return executeGitCommand('git rebase --continue', args.cwd); } if (args.interactive) { return { content: [{ type: "text", text: JSON.stringify({ success: false, error: 'Interactive rebase not supported in non-interactive environment' }, null, 2) }], isError: true }; } if (!args.branch) { return { content: [{ type: "text", text: JSON.stringify({ success: false, error: 'Branch required for rebase' }, null, 2) }], isError: true }; } return executeGitCommand(`git rebase ${args.branch}`, args.cwd); }
  • Zod schema for input validation of the git_rebase tool parameters.
    export const gitRebaseSchema = z.object({ branch: z.string().optional().describe('Branch to rebase onto'), cwd: z.string().optional().describe('Repository directory'), interactive: z.boolean().optional().default(false).describe('Interactive rebase'), abort: z.boolean().optional().default(false).describe('Abort current rebase'), continue: z.boolean().optional().default(false).describe('Continue rebase after resolving conflicts') });
  • src/index.ts:405-408 (registration)
    Dispatch/registration in the main MCP server handler that routes 'git_rebase' calls to the gitRebase function after validation.
    if (name === 'git_rebase') { const validated = gitRebaseSchema.parse(args); return await gitRebase(validated); }
  • MCP tool definition schema for 'git_rebase' used in tool listing.
    { name: 'git_rebase', description: 'Reapply commits on top of another branch', inputSchema: { type: 'object', properties: { branch: { type: 'string', description: 'Branch to rebase onto' }, cwd: { type: 'string', description: 'Repository directory' }, interactive: { type: 'boolean', default: false, description: 'Interactive rebase (not supported)' }, abort: { type: 'boolean', default: false, description: 'Abort current rebase' }, continue: { type: 'boolean', default: false, description: 'Continue rebase after resolving conflicts' } } } },
  • src/index.ts:284-296 (registration)
    Registration of gitTools (including git_rebase) in the MCP list tools handler.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ ...filesystemTools, ...shellTools, ...dockerTools, ...mongodbTools, ...redisTools, ...gitTools, ...processTools, ...networkTools ] };

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