This commit implements the main HTTP server that wraps the Gitea MCP server with HTTP transport.
Architecture:
- GiteaMCPWrapper class manages subprocess communication with Gitea MCP
- Starlette ASGI application for HTTP endpoints
- JSON-RPC protocol bridge between HTTP and stdio transport
Features:
- Subprocess management: Starts/stops Gitea MCP server with proper env vars
- HTTP endpoints:
- POST /tools/list - List available tools (with filtering)
- POST /tools/call - Execute a tool
- GET /health, /healthz, /ping - Health checks
- JSON-RPC communication via stdin/stdout pipes
- Tool filtering integration (blocks filtered tools at call time)
- Comprehensive error handling and logging
- Graceful startup/shutdown lifecycle
Integration:
- Uses GiteaSettings from config module (#11)
- Uses ToolFilter from filtering module (#12)
- Uses BearerAuthMiddleware and HealthCheckBypassMiddleware (#13)
- Passes Gitea config to wrapped MCP server via environment
Entry points:
- main() function for CLI execution
- create_app() factory for testing and custom configurations
- gitea-http-wrapper console script (defined in pyproject.toml)
This server can now be deployed in Docker (#15) and tested (#17).
Closes#14
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit establishes the proper architecture for an HTTP transport wrapper around the official Gitea MCP server, replacing the incorrect standalone implementation.
New structure:
- src/gitea_http_wrapper/ (main package)
- config/ (configuration loader)
- middleware/ (HTTP auth middleware)
- filtering/ (tool filtering for Claude Desktop)
- tests/ (wrapper test suite)
Updated dependencies:
- mcp>=0.9.0 (MCP SDK for HTTP transport)
- uvicorn>=0.27.0 (ASGI server)
- pydantic>=2.0.0 (config validation)
- pydantic-settings>=2.0.0 (settings management)
- gitea-mcp-server>=0.1.0 (official Gitea MCP to wrap)
Created requirements.txt for Docker deployment convenience.
This architecture correctly separates concerns:
1. Official Gitea MCP server handles Gitea API operations
2. HTTP wrapper provides transport, auth, and filtering
Closes#10
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>