Forgejo Tool #2

Merged
tom merged 13 commits from tom/forgejo-tool into main 2025-07-13 15:54:55 +01:00
Owner
No description provided.
tom self-assigned this 2025-07-13 15:54:41 +01:00
tom added 13 commits 2025-07-13 15:54:41 +01:00
This commit introduces the initial implementation of the Forgejo tool.

- Adds `docs/forgejo.md` for API endpoint documentation.
- Creates the `forgejo` tool directory with `__init__.py` and `routes.py`.
- Implements the `/forgejo/version` endpoint to retrieve Forgejo instance version.
- Implements the `/forgejo/repos/search` endpoint to search for repositories.
- Configures `ForgejoConfig` for base URL.
- Integrates `httpx` for asynchronous HTTP requests.
- Updates `pyproject.toml` and `uv.lock` with new dependencies.
- Refactors `openapi_mcp_server/server.py` to directly expose the FastAPI app instance for easier Uvicorn integration.
- Updates `GEMINI.md` with a tip about using timeouts for CLI commands.
This commit introduces Pydantic models for Forgejo API responses to improve data validation and clarity.

- Adds `openapi_mcp_server/tools/forgejo/models.py` to define data structures.
- Implements `ForgejoVersion` model for the `/version` endpoint response.
- Implements `ForgejoUser` and `ForgejoRepository` models for the `/repos/search` endpoint response.
- Updates `openapi_mcp_server/tools/forgejo/routes.py` to use these new Pydantic models for response validation.
This commit updates the default server port from 8000 to 80 in `openapi_mcp_server/core/config.py`. This change simplifies container networking by allowing other containers to communicate with the server using `http://openapi-mcp-server/` without specifying a port.
This commit introduces the functionality to list branches for a given Forgejo repository.

- Adds `ForgejoCommit` and `ForgejoBranch` Pydantic models in `openapi_mcp_server/tools/forgejo/models.py` to represent commit and branch data.
- Implements the `GET /repos/{owner}/{repo}/branches` endpoint in `openapi_mcp_server/tools/forgejo/routes.py` to fetch and return branch information.
- Updates `openapi_mcp_server/tools/forgejo/routes.py` to use the new `ForgejoBranch` model for response validation.
Correct optional fields
Some checks failed
CI / Build and push Docker image (pull_request) Failing after 11s
CI / Build and push Docker image (push) Successful in 1m38s
35bf0314e9
tom merged commit 35bf0314e9 into main 2025-07-13 15:54:55 +01:00
tom deleted branch tom/forgejo-tool 2025-07-13 15:54:55 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tom/openapi-mcp-server#2
No description provided.