Skip to content

Commit 9b0134a

Browse files
Add branch handling to Git tools in server.py
Implemented functionality to retrieve branch information based on specified criteria, enhancing the Git tools available in the server. This includes support for local and remote branches, as well as filtering by commit containment.
1 parent 7c8a847 commit 9b0134a

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/git/src/mcp_server_git/server.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,19 @@ async def call_tool(name: str, arguments: dict) -> list[TextContent]:
505505
type="text",
506506
text="Commit history:\n" + "\n".join(log)
507507
)]
508-
508+
509+
case GitTools.BRANCH:
510+
result = git_branch(
511+
repo,
512+
arguments.get("branch_type", 'local'),
513+
arguments.get("contains", None),
514+
arguments.get("not_contains", None),
515+
)
516+
return [TextContent(
517+
type="text",
518+
text=result
519+
)]
520+
509521
case _:
510522
raise ValueError(f"Unknown tool: {name}")
511523

0 commit comments

Comments
 (0)