Skip to content

Commit b9eac6c

Browse files
iburelclaude
authored andcommitted
test: add comprehensive MCP server testing and documentation
- Add complete test suite for MCP server functionality - Test MCP tool registration, execution, and error handling - Add async testing for stdio transport communication - Update CHANGELOG.md with all feature additions - Update README.md with MCP server installation and usage - Document GitPython migration and MCP integration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 75059b8 commit b9eac6c

File tree

5 files changed

+528
-0
lines changed

5 files changed

+528
-0
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## [Unreleased]
4+
5+
### Features
6+
7+
* **mcp:** Add Model Context Protocol (MCP) server support
8+
- New `--mcp-server` CLI option to start MCP server
9+
- `ingest_repository` tool for LLM integration
10+
- Full MCP protocol compliance with stdio transport
11+
- Enhanced MCP client examples for stdio transport
12+
313
## [0.3.1](https://github.com/coderamp-labs/gitingest/compare/v0.3.0...v0.3.1) (2025-07-31)
414

515

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ You can also replace `hub` with `ingest` in any GitHub URL to access the corresp
5151
- Token count
5252
- **CLI tool**: Run it as a shell command
5353
- **Python package**: Import it in your code
54+
- **MCP Server**: Model Context Protocol server for LLM integration
5455

5556
## 📚 Requirements
5657

@@ -74,6 +75,12 @@ pip install gitingest[server]
7475

7576
to include server dependencies for self-hosting.
7677

78+
For MCP (Model Context Protocol) support:
79+
80+
```bash
81+
pip install gitingest[mcp]
82+
```
83+
7784
However, it might be a good idea to use `pipx` to install it.
7885
You can install `pipx` using your preferred package manager.
7986

@@ -150,6 +157,49 @@ See more options and usage details with:
150157
gitingest --help
151158
```
152159

160+
## 🤖 MCP (Model Context Protocol) Server
161+
162+
Gitingest includes an MCP server that allows LLMs to directly access repository analysis capabilities through the Model Context Protocol.
163+
164+
### Starting the MCP Server
165+
166+
```bash
167+
# Start the MCP server with stdio transport
168+
gitingest --mcp-server
169+
```
170+
171+
### Available Tools
172+
173+
The MCP server provides the following tools:
174+
175+
- **`ingest_repository`**: Ingest a Git repository or local directory and return a structured digest
176+
177+
### Example MCP Client
178+
179+
See `examples/mcp_client_example.py` for a complete example of how to use the MCP server.
180+
181+
### Configuration
182+
183+
Use the provided `examples/mcp-config.json` to configure the MCP server in your MCP client:
184+
185+
#### Stdio Transport (Default)
186+
187+
```json
188+
{
189+
"mcpServers": {
190+
"gitingest": {
191+
"command": "gitingest",
192+
"args": ["--mcp-server"],
193+
"env": {
194+
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
195+
}
196+
}
197+
}
198+
}
199+
```
200+
201+
202+
153203
## 🐍 Python package usage
154204

155205
```python

tests/server/test_flow_integration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ async def test_large_repository(request: pytest.FixtureRequest) -> None:
115115
assert "error" in response_data
116116

117117

118+
@pytest.mark.slow
118119
@pytest.mark.asyncio
119120
async def test_concurrent_requests(request: pytest.FixtureRequest) -> None:
120121
"""Test handling of multiple concurrent requests."""

0 commit comments

Comments
 (0)