mcp-server-git 0.6.1__tar.gz → 0.6.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: mcp-server-git
3
- Version: 0.6.1
3
+ Version: 0.6.2
4
4
  Summary: A Model Context Protocol server providing tools to read, search, and manipulate Git repositories programmatically via LLMs
5
5
  Author: Anthropic, PBC.
6
6
  Maintainer-email: David Soria Parra <davidsp@anthropic.com>
@@ -73,6 +73,13 @@ Please note that mcp-server-git is currently in early development. The functiona
73
73
  - `max_count` (number, optional): Maximum number of commits to show (default: 10)
74
74
  - Returns: Array of commit entries with hash, author, date, and message
75
75
 
76
+ 8. `git_create_branch`
77
+ - Creates a new branch
78
+ - Inputs:
79
+ - `repo_path` (string): Path to Git repository
80
+ - `branch_name` (string): Name of the new branch
81
+ - `start_point` (string, optional): Starting point for the new branch
82
+ - Returns: Confirmation of branch creation
76
83
 
77
84
  ## Installation
78
85
 
@@ -176,6 +183,29 @@ cd path/to/servers/src/git
176
183
  npx @modelcontextprotocol/inspector uv run mcp-server-git
177
184
  ```
178
185
 
186
+ Running `tail -n 20 -f ~/Library/Logs/Claude/mcp*.log` will show the logs from the server and may
187
+ help you debug any issues.
188
+
189
+ ## Development
190
+
191
+ If you are doing local development, there are two ways to test your changes:
192
+
193
+ 1. Run the MCP inspector to test your changes. See [Debugging](#debugging) for run instructions.
194
+
195
+ 2. Test using the Claude desktop app. Add the following to your `claude_desktop_config.json`:
196
+
197
+ ```json
198
+ "git": {
199
+ "command": "uv",
200
+ "args": [
201
+ "--directory",
202
+ "/<path to mcp-servers>/mcp-servers/src/git",
203
+ "run",
204
+ "mcp-server-git"
205
+ ]
206
+ }
207
+ ```
208
+
179
209
  ## License
180
210
 
181
211
  This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
@@ -53,6 +53,13 @@ Please note that mcp-server-git is currently in early development. The functiona
53
53
  - `max_count` (number, optional): Maximum number of commits to show (default: 10)
54
54
  - Returns: Array of commit entries with hash, author, date, and message
55
55
 
56
+ 8. `git_create_branch`
57
+ - Creates a new branch
58
+ - Inputs:
59
+ - `repo_path` (string): Path to Git repository
60
+ - `branch_name` (string): Name of the new branch
61
+ - `start_point` (string, optional): Starting point for the new branch
62
+ - Returns: Confirmation of branch creation
56
63
 
57
64
  ## Installation
58
65
 
@@ -156,6 +163,29 @@ cd path/to/servers/src/git
156
163
  npx @modelcontextprotocol/inspector uv run mcp-server-git
157
164
  ```
158
165
 
166
+ Running `tail -n 20 -f ~/Library/Logs/Claude/mcp*.log` will show the logs from the server and may
167
+ help you debug any issues.
168
+
169
+ ## Development
170
+
171
+ If you are doing local development, there are two ways to test your changes:
172
+
173
+ 1. Run the MCP inspector to test your changes. See [Debugging](#debugging) for run instructions.
174
+
175
+ 2. Test using the Claude desktop app. Add the following to your `claude_desktop_config.json`:
176
+
177
+ ```json
178
+ "git": {
179
+ "command": "uv",
180
+ "args": [
181
+ "--directory",
182
+ "/<path to mcp-servers>/mcp-servers/src/git",
183
+ "run",
184
+ "mcp-server-git"
185
+ ]
186
+ }
187
+ ```
188
+
159
189
  ## License
160
190
 
161
191
  This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mcp-server-git"
3
- version = "0.6.1"
3
+ version = "0.6.2"
4
4
  description = "A Model Context Protocol server providing tools to read, search, and manipulate Git repositories programmatically via LLMs"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -39,6 +39,11 @@ class GitLog(BaseModel):
39
39
  repo_path: str
40
40
  max_count: int = 10
41
41
 
42
+ class GitCreateBranch(BaseModel):
43
+ repo_path: str
44
+ branch_name: str
45
+ base_branch: str | None = None
46
+
42
47
  class GitTools(str, Enum):
43
48
  STATUS = "git_status"
44
49
  DIFF_UNSTAGED = "git_diff_unstaged"
@@ -47,6 +52,7 @@ class GitTools(str, Enum):
47
52
  ADD = "git_add"
48
53
  RESET = "git_reset"
49
54
  LOG = "git_log"
55
+ CREATE_BRANCH = "git_create_branch"
50
56
 
51
57
  def git_status(repo: git.Repo) -> str:
52
58
  return repo.git.status()
@@ -81,6 +87,15 @@ def git_log(repo: git.Repo, max_count: int = 10) -> list[str]:
81
87
  )
82
88
  return log
83
89
 
90
+ def git_create_branch(repo: git.Repo, branch_name: str, base_branch: str | None = None) -> str:
91
+ if base_branch:
92
+ base = repo.refs[base_branch]
93
+ else:
94
+ base = repo.active_branch
95
+
96
+ repo.create_head(branch_name, base)
97
+ return f"Created branch '{branch_name}' from '{base.name}'"
98
+
84
99
  async def serve(repository: Path | None) -> None:
85
100
  logger = logging.getLogger(__name__)
86
101
 
@@ -132,6 +147,11 @@ async def serve(repository: Path | None) -> None:
132
147
  description="Shows the commit logs",
133
148
  inputSchema=GitLog.schema(),
134
149
  ),
150
+ Tool(
151
+ name=GitTools.CREATE_BRANCH,
152
+ description="Creates a new branch from an optional base branch",
153
+ inputSchema=GitCreateBranch.schema(),
154
+ ),
135
155
  ]
136
156
 
137
157
  async def list_repos() -> Sequence[str]:
@@ -218,6 +238,17 @@ async def serve(repository: Path | None) -> None:
218
238
  text="Commit history:\n" + "\n".join(log)
219
239
  )]
220
240
 
241
+ case GitTools.CREATE_BRANCH:
242
+ result = git_create_branch(
243
+ repo,
244
+ arguments["branch_name"],
245
+ arguments.get("base_branch")
246
+ )
247
+ return [TextContent(
248
+ type="text",
249
+ text=result
250
+ )]
251
+
221
252
  case _:
222
253
  raise ValueError(f"Unknown tool: {name}")
223
254
 
@@ -146,7 +146,7 @@ wheels = [
146
146
 
147
147
  [[package]]
148
148
  name = "mcp"
149
- version = "0.9.1"
149
+ version = "1.1.0"
150
150
  source = { registry = "https://pypi.org/simple" }
151
151
  dependencies = [
152
152
  { name = "anyio" },
@@ -156,14 +156,14 @@ dependencies = [
156
156
  { name = "sse-starlette" },
157
157
  { name = "starlette" },
158
158
  ]
159
- sdist = { url = "https://files.pythonhosted.org/packages/e7/1c/932818470ffd49c33509110c835101a8dc4c9cdd06028b9f647fb3dde237/mcp-0.9.1.tar.gz", hash = "sha256:e8509a37c2ab546095788ed170e0fb4d7ce0cf5a3ee56b6449c78af27321a425", size = 78218 }
159
+ sdist = { url = "https://files.pythonhosted.org/packages/77/f2/067b1fc114e8d3ae4af02fc4f4ed8971a2c4900362d976fabe0f4e9a3418/mcp-1.1.0.tar.gz", hash = "sha256:e3c8d6df93a4de90230ea944dd667730744a3cd91a4cc0ee66a5acd53419e100", size = 83802 }
160
160
  wheels = [
161
- { url = "https://files.pythonhosted.org/packages/b3/a0/2ee813d456b57a726d583868417d1ad900fbe12ee3c8cd866e3e804ca486/mcp-0.9.1-py3-none-any.whl", hash = "sha256:7f640fcfb0be486aa510594df309920ae1d375cdca1f8aff21db3a96d837f303", size = 31562 },
161
+ { url = "https://files.pythonhosted.org/packages/b9/3e/aef19ac08a6f9a347c086c4e628c2f7329659828cbe92ffd524ec2aac833/mcp-1.1.0-py3-none-any.whl", hash = "sha256:44aa4d2e541f0924d6c344aa7f96b427a6ee1df2fab70b5f9ae2f8777b3f05f2", size = 36576 },
162
162
  ]
163
163
 
164
164
  [[package]]
165
165
  name = "mcp-server-git"
166
- version = "0.4.1"
166
+ version = "0.6.2"
167
167
  source = { editable = "." }
168
168
  dependencies = [
169
169
  { name = "click" },
@@ -182,7 +182,7 @@ dev = [
182
182
  requires-dist = [
183
183
  { name = "click", specifier = ">=8.1.7" },
184
184
  { name = "gitpython", specifier = ">=3.1.43" },
185
- { name = "mcp", specifier = ">=0.6.0" },
185
+ { name = "mcp", specifier = ">=1.0.0" },
186
186
  { name = "pydantic", specifier = ">=2.0.0" },
187
187
  ]
188
188
 
File without changes