[Sprint 02] feat: Implement configuration loader module #11

Closed
opened 2026-02-03 21:00:46 +00:00 by lmiranda · 1 comment
Owner

Summary

Create config.py module to load and validate environment variables for the wrapper.

Tasks

  • Create src/gitea_mcp_remote/config.py
  • Implement Config class with Pydantic validation
  • Load from environment variables:
    • GITEA_API_URL (required)
    • GITEA_API_TOKEN (required)
    • ALLOWED_TOOLS (optional, comma-separated allowlist)
    • DENIED_TOOLS (optional, comma-separated denylist)
    • AUTH_TOKEN (optional, for HTTP endpoint authentication)
    • PORT (optional, default 8000)
    • HOST (optional, default 0.0.0.0)
  • Add validation logic (e.g., URL format, token not empty)
  • Export singleton config instance

Acceptance Criteria

  • config.py exists with Config class
  • All environment variables loaded with proper types
  • Validation errors raise clear exceptions
  • Can import from gitea_mcp_remote.config import config
  • Config is immutable after initialization

Dependencies

Blocked by: #10 (structure must exist first)

Context

Configuration is centralized in one module that all other components import.

References:

  • Corrective Rebuild specification
  • Step 4 of 14-step rebuild plan

Size: S (1-2 hours)

## Summary Create `config.py` module to load and validate environment variables for the wrapper. ## Tasks - [ ] Create `src/gitea_mcp_remote/config.py` - [ ] Implement `Config` class with Pydantic validation - [ ] Load from environment variables: - `GITEA_API_URL` (required) - `GITEA_API_TOKEN` (required) - `ALLOWED_TOOLS` (optional, comma-separated allowlist) - `DENIED_TOOLS` (optional, comma-separated denylist) - `AUTH_TOKEN` (optional, for HTTP endpoint authentication) - `PORT` (optional, default 8000) - `HOST` (optional, default 0.0.0.0) - [ ] Add validation logic (e.g., URL format, token not empty) - [ ] Export singleton `config` instance ## Acceptance Criteria - `config.py` exists with `Config` class - All environment variables loaded with proper types - Validation errors raise clear exceptions - Can import `from gitea_mcp_remote.config import config` - Config is immutable after initialization ## Dependencies **Blocked by:** #10 (structure must exist first) ## Context Configuration is centralized in one module that all other components import. **References:** - Corrective Rebuild specification - Step 4 of 14-step rebuild plan **Size:** S (1-2 hours)
lmiranda added this to the Sprint 02: Corrective Rebuild milestone 2026-02-03 21:00:46 +00:00
lmiranda added the Type/FeatureTech/PythonComponent/BackendPriority/HighSize/S labels 2026-02-03 21:00:46 +00:00
Author
Owner

⚠️ Blocked By: #10

⚠️ **Blocked By:** #10
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: personal-projects/gitea-mcp-remote#11