From 0e0c34f735b753ce853f0d13649f5ceb19cd121a Mon Sep 17 00:00:00 2001 From: lmiranda Date: Tue, 3 Feb 2026 16:07:06 -0500 Subject: [PATCH] Create correct directory structure and dependencies 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 --- pyproject.toml | 13 ++++++++----- requirements.txt | 9 +++++++++ src/gitea_http_wrapper/__init__.py | 15 +++++++++++++++ src/gitea_http_wrapper/config/__init__.py | 3 +++ src/gitea_http_wrapper/filtering/__init__.py | 3 +++ src/gitea_http_wrapper/middleware/__init__.py | 3 +++ src/gitea_http_wrapper/tests/__init__.py | 3 +++ 7 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 requirements.txt create mode 100644 src/gitea_http_wrapper/__init__.py create mode 100644 src/gitea_http_wrapper/config/__init__.py create mode 100644 src/gitea_http_wrapper/filtering/__init__.py create mode 100644 src/gitea_http_wrapper/middleware/__init__.py create mode 100644 src/gitea_http_wrapper/tests/__init__.py diff --git a/pyproject.toml b/pyproject.toml index 050a1e9..d92efb6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,14 +5,14 @@ build-backend = "setuptools.build_meta" [project] name = "gitea-mcp-remote" version = "0.1.0" -description = "MCP server for Gitea API integration" +description = "HTTP transport wrapper for Gitea MCP server" readme = "README.md" requires-python = ">=3.10" license = { text = "MIT" } authors = [ { name = "Leo Miranda", email = "lmiranda@example.com" } ] -keywords = ["mcp", "gitea", "api", "server"] +keywords = ["mcp", "gitea", "api", "server", "http", "wrapper"] classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", @@ -24,9 +24,12 @@ classifiers = [ ] dependencies = [ - "mcp>=0.1.0", - "httpx>=0.24.0", + "mcp>=0.9.0", + "uvicorn>=0.27.0", + "pydantic>=2.0.0", + "pydantic-settings>=2.0.0", "python-dotenv>=1.0.0", + "gitea-mcp-server>=0.1.0", ] [project.optional-dependencies] @@ -37,7 +40,7 @@ dev = [ ] [project.scripts] -gitea-mcp = "gitea_mcp.server:main" +gitea-http-wrapper = "gitea_http_wrapper.server:main" [project.urls] Homepage = "https://github.com/lmiranda/gitea-mcp-remote" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..75dd4f2 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +# HTTP Transport Wrapper Dependencies +mcp>=0.9.0 +uvicorn>=0.27.0 +pydantic>=2.0.0 +pydantic-settings>=2.0.0 +python-dotenv>=1.0.0 + +# Official Gitea MCP Server (to be wrapped) +gitea-mcp-server>=0.1.0 diff --git a/src/gitea_http_wrapper/__init__.py b/src/gitea_http_wrapper/__init__.py new file mode 100644 index 0000000..d6116ea --- /dev/null +++ b/src/gitea_http_wrapper/__init__.py @@ -0,0 +1,15 @@ +""" +Gitea HTTP MCP Wrapper + +This package provides an HTTP transport wrapper around the official Gitea MCP server. +It handles configuration loading, tool filtering, and HTTP authentication middleware. + +Architecture: +- config/: Configuration loader module +- middleware/: HTTP authentication middleware +- filtering/: Tool filtering for Claude Desktop compatibility +- server.py: Main HTTP MCP server implementation +""" + +__version__ = "0.1.0" +__all__ = ["__version__"] diff --git a/src/gitea_http_wrapper/config/__init__.py b/src/gitea_http_wrapper/config/__init__.py new file mode 100644 index 0000000..42f952f --- /dev/null +++ b/src/gitea_http_wrapper/config/__init__.py @@ -0,0 +1,3 @@ +"""Configuration loader module.""" + +__all__ = [] diff --git a/src/gitea_http_wrapper/filtering/__init__.py b/src/gitea_http_wrapper/filtering/__init__.py new file mode 100644 index 0000000..59bf8df --- /dev/null +++ b/src/gitea_http_wrapper/filtering/__init__.py @@ -0,0 +1,3 @@ +"""Tool filtering module for Claude Desktop compatibility.""" + +__all__ = [] diff --git a/src/gitea_http_wrapper/middleware/__init__.py b/src/gitea_http_wrapper/middleware/__init__.py new file mode 100644 index 0000000..d0230af --- /dev/null +++ b/src/gitea_http_wrapper/middleware/__init__.py @@ -0,0 +1,3 @@ +"""HTTP authentication middleware module.""" + +__all__ = [] diff --git a/src/gitea_http_wrapper/tests/__init__.py b/src/gitea_http_wrapper/tests/__init__.py new file mode 100644 index 0000000..a4cfb82 --- /dev/null +++ b/src/gitea_http_wrapper/tests/__init__.py @@ -0,0 +1,3 @@ +"""Test suite for HTTP wrapper functionality.""" + +__all__ = []