@cyanheads/git-mcp-server
Version:
An MCP (Model Context Protocol) server enabling LLMs and AI agents to interact with Git repositories. Provides tools for comprehensive Git operations including clone, commit, branch, diff, log, status, push, pull, merge, rebase, worktree, tag management,
175 lines • 6.01 kB
TypeScript
/**
* @fileoverview Defines the core logic, schemas, and types for the git_branch tool.
* @module src/mcp-server/tools/gitBranch/logic
*/
import { z } from "zod";
import { type RequestContext } from "../../../utils/index.js";
export declare const GitBranchBaseSchema: z.ZodObject<{
path: z.ZodDefault<z.ZodString>;
mode: z.ZodEnum<["list", "create", "delete", "rename", "show-current"]>;
branchName: z.ZodOptional<z.ZodString>;
newBranchName: z.ZodOptional<z.ZodString>;
startPoint: z.ZodOptional<z.ZodString>;
force: z.ZodDefault<z.ZodBoolean>;
all: z.ZodDefault<z.ZodBoolean>;
remote: z.ZodDefault<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
path: string;
mode: "create" | "list" | "delete" | "rename" | "show-current";
force: boolean;
all: boolean;
remote: boolean;
branchName?: string | undefined;
newBranchName?: string | undefined;
startPoint?: string | undefined;
}, {
mode: "create" | "list" | "delete" | "rename" | "show-current";
path?: string | undefined;
branchName?: string | undefined;
newBranchName?: string | undefined;
startPoint?: string | undefined;
force?: boolean | undefined;
all?: boolean | undefined;
remote?: boolean | undefined;
}>;
export declare const GitBranchInputSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
path: z.ZodDefault<z.ZodString>;
mode: z.ZodEnum<["list", "create", "delete", "rename", "show-current"]>;
branchName: z.ZodOptional<z.ZodString>;
newBranchName: z.ZodOptional<z.ZodString>;
startPoint: z.ZodOptional<z.ZodString>;
force: z.ZodDefault<z.ZodBoolean>;
all: z.ZodDefault<z.ZodBoolean>;
remote: z.ZodDefault<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
path: string;
mode: "create" | "list" | "delete" | "rename" | "show-current";
force: boolean;
all: boolean;
remote: boolean;
branchName?: string | undefined;
newBranchName?: string | undefined;
startPoint?: string | undefined;
}, {
mode: "create" | "list" | "delete" | "rename" | "show-current";
path?: string | undefined;
branchName?: string | undefined;
newBranchName?: string | undefined;
startPoint?: string | undefined;
force?: boolean | undefined;
all?: boolean | undefined;
remote?: boolean | undefined;
}>, {
path: string;
mode: "create" | "list" | "delete" | "rename" | "show-current";
force: boolean;
all: boolean;
remote: boolean;
branchName?: string | undefined;
newBranchName?: string | undefined;
startPoint?: string | undefined;
}, {
mode: "create" | "list" | "delete" | "rename" | "show-current";
path?: string | undefined;
branchName?: string | undefined;
newBranchName?: string | undefined;
startPoint?: string | undefined;
force?: boolean | undefined;
all?: boolean | undefined;
remote?: boolean | undefined;
}>, {
path: string;
mode: "create" | "list" | "delete" | "rename" | "show-current";
force: boolean;
all: boolean;
remote: boolean;
branchName?: string | undefined;
newBranchName?: string | undefined;
startPoint?: string | undefined;
}, {
mode: "create" | "list" | "delete" | "rename" | "show-current";
path?: string | undefined;
branchName?: string | undefined;
newBranchName?: string | undefined;
startPoint?: string | undefined;
force?: boolean | undefined;
all?: boolean | undefined;
remote?: boolean | undefined;
}>, {
path: string;
mode: "create" | "list" | "delete" | "rename" | "show-current";
force: boolean;
all: boolean;
remote: boolean;
branchName?: string | undefined;
newBranchName?: string | undefined;
startPoint?: string | undefined;
}, {
mode: "create" | "list" | "delete" | "rename" | "show-current";
path?: string | undefined;
branchName?: string | undefined;
newBranchName?: string | undefined;
startPoint?: string | undefined;
force?: boolean | undefined;
all?: boolean | undefined;
remote?: boolean | undefined;
}>;
export declare const GitBranchOutputSchema: z.ZodObject<{
success: z.ZodBoolean;
mode: z.ZodString;
message: z.ZodString;
branches: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
isCurrent: z.ZodBoolean;
isRemote: z.ZodBoolean;
commitHash: z.ZodOptional<z.ZodString>;
commitSubject: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
name: string;
isCurrent: boolean;
isRemote: boolean;
commitHash?: string | undefined;
commitSubject?: string | undefined;
}, {
name: string;
isCurrent: boolean;
isRemote: boolean;
commitHash?: string | undefined;
commitSubject?: string | undefined;
}>, "many">>;
currentBranch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
message: string;
success: boolean;
mode: string;
branches?: {
name: string;
isCurrent: boolean;
isRemote: boolean;
commitHash?: string | undefined;
commitSubject?: string | undefined;
}[] | undefined;
currentBranch?: string | null | undefined;
}, {
message: string;
success: boolean;
mode: string;
branches?: {
name: string;
isCurrent: boolean;
isRemote: boolean;
commitHash?: string | undefined;
commitSubject?: string | undefined;
}[] | undefined;
currentBranch?: string | null | undefined;
}>;
export type GitBranchInput = z.infer<typeof GitBranchInputSchema>;
export type GitBranchOutput = z.infer<typeof GitBranchOutputSchema>;
/**
* 4. IMPLEMENT the core logic function.
* @throws {McpError} If the logic encounters an unrecoverable issue.
*/
export declare function gitBranchLogic(params: GitBranchInput, context: RequestContext & {
getWorkingDirectory: () => string | undefined;
}): Promise<GitBranchOutput>;
//# sourceMappingURL=logic.d.ts.map