Files
gitea-mcp-remote/.env.example
lmiranda 42d625c27f Implement configuration loader module
This commit implements a robust configuration loader using Pydantic Settings that handles:

Features:
- Environment variable loading with .env file support
- Type validation and field constraints
- Gitea configuration (URL, token, owner, repo)
- HTTP server configuration (host, port)
- Optional HTTP authentication token
- Optional tool filtering (enabled/disabled tool lists)

Implementation:
- GiteaSettings class with Pydantic validation
- URL validation ensuring http:// or https:// prefix
- Helper properties for parsing comma-separated tool lists
- get_gitea_mcp_env() method to pass config to wrapped MCP server
- load_settings() factory function with optional env_file path

Documentation:
- .env.example template with all configuration options
- Comprehensive docstrings and type hints

This module unblocks both the tool filtering (#12) and HTTP authentication middleware (#13) implementations.

Closes #11

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 16:55:49 -05:00

17 lines
441 B
Plaintext

# Gitea Configuration
GITEA_URL=https://gitea.example.com
GITEA_TOKEN=your_gitea_api_token_here
GITEA_OWNER=your_username_or_org
GITEA_REPO=your_repo_name
# HTTP Server Configuration
HTTP_HOST=127.0.0.1
HTTP_PORT=8000
# Authentication Configuration (Optional)
# AUTH_TOKEN=your_bearer_token_here
# Tool Filtering Configuration (Optional)
# ENABLED_TOOLS=list_issues,create_issue,update_issue
# DISABLED_TOOLS=delete_issue,close_milestone