Skip to content

Commit 3a297d8

Browse files
committed
Revert "1) Update README to contain basic build/run instructions. Remove legacy test advice."
(wrong branch push) This reverts commit b43ecf8.
1 parent b43ecf8 commit 3a297d8

2 files changed

Lines changed: 34 additions & 27 deletions

File tree

src/git/README.md

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -285,29 +285,13 @@ help you debug any issues.
285285

286286
## Development
287287

288-
### Building
288+
If you are doing local development, there are two ways to test your changes:
289289

290-
[`uv`](https://docs.astral.sh/uv/) is used for development.
290+
1. Run the MCP inspector to test your changes. See [Debugging](#debugging) for run instructions.
291291

292-
Start by creating a fresh virtual environment:
292+
2. Test using the Claude desktop app. Add the following to your `claude_desktop_config.json`:
293293

294-
```bash
295-
uv venv
296-
source .venv/bin/activate
297-
```
298-
To run the tests, type `uv run pytest`, to run the server from source use `uv run src/mcp_server_git/`.
299-
300-
To build, type `uv build`. You can then now run `mcp-server-git` command directly. Open with the inspector using `npx @modelcontextprotocol/inspector@latest mcp-server-git`.
301-
302-
To specify the Python version type `uv python pin <version>` (useful if you want to use a more recent version than the default).
303-
304-
To create the Docker container use
305-
306-
```bash
307-
docker build -t mcp/git .
308-
```
309-
310-
An example showing how to run via the Docker container is below:
294+
### Docker
311295

312296
```json
313297
{
@@ -328,6 +312,32 @@ An example showing how to run via the Docker container is below:
328312
}
329313
```
330314

315+
### UVX
316+
```json
317+
{
318+
"mcpServers": {
319+
"git": {
320+
"command": "uv",
321+
"args": [
322+
"--directory",
323+
"/<path to mcp-servers>/mcp-servers/src/git",
324+
"run",
325+
"mcp-server-git"
326+
]
327+
}
328+
}
329+
}
330+
```
331+
332+
## Build
333+
334+
Docker build:
335+
336+
```bash
337+
cd src/git
338+
docker build -t mcp/git .
339+
```
340+
331341
## License
332342

333343
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.

src/git/tests/test_server.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ def test_repository(tmp_path: Path):
1212
Path(repo_path / "test.txt").write_text("test")
1313
test_repo.index.add(["test.txt"])
1414
test_repo.index.commit("initial commit")
15-
16-
# Store the default branch name on the repo object for tests to use
17-
test_repo.default_branch = test_repo.active_branch.name
1815

1916
yield test_repo
2017

@@ -54,20 +51,20 @@ def test_git_branch_contains(test_repository):
5451
Path(test_repository.working_dir / Path("feature.txt")).write_text("feature content")
5552
test_repository.index.add(["feature.txt"])
5653
commit = test_repository.index.commit("feature commit")
57-
test_repository.git.checkout(test_repository.default_branch)
54+
test_repository.git.checkout("master")
5855

5956
result = git_branch(test_repository, "local", contains=commit.hexsha)
6057
assert "feature-branch" in result
61-
assert test_repository.default_branch not in result
58+
assert "master" not in result
6259

6360
def test_git_branch_not_contains(test_repository):
6461
# Create a new branch and commit to it
6562
test_repository.git.checkout("-b", "another-feature-branch")
6663
Path(test_repository.working_dir / Path("another_feature.txt")).write_text("another feature content")
6764
test_repository.index.add(["another_feature.txt"])
6865
commit = test_repository.index.commit("another feature commit")
69-
test_repository.git.checkout(test_repository.default_branch)
66+
test_repository.git.checkout("master")
7067

7168
result = git_branch(test_repository, "local", not_contains=commit.hexsha)
7269
assert "another-feature-branch" not in result
73-
assert test_repository.default_branch in result
70+
assert "master" in result

0 commit comments

Comments
 (0)