- Implemented server and client script management tools in `frappe_mcp/tools/scripts.py` - Added translation and user permission management tools in `frappe_mcp/tools/translations.py` - Created user and role management tools in `frappe_mcp/tools/users.py` - Developed webhook and API key management tools in `frappe_mcp/tools/webhooks.py` - Introduced workflow management tools in `frappe_mcp/tools/workflow_tools.py` - Added `pyproject.toml` for project metadata and dependencies
32 lines
905 B
Python
32 lines
905 B
Python
from pydantic_settings import BaseSettings
|
|
from pydantic import field_validator
|
|
from functools import lru_cache
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
frappe_url: str = "http://localhost:8000"
|
|
frappe_api_key: str = ""
|
|
frappe_api_secret: str = ""
|
|
frappe_site_name: str = "" # optional: for multi-site Docker setups
|
|
|
|
# Safety: set to True to block destructive operations
|
|
read_only_mode: bool = False
|
|
|
|
# Timeout for REST calls in seconds
|
|
request_timeout: int = 30
|
|
|
|
@field_validator("frappe_url")
|
|
@classmethod
|
|
def strip_trailing_slash(cls, v: str) -> str:
|
|
return v.rstrip("/")
|
|
|
|
# Module activation — handled by module_registry, stored here so pydantic doesn't reject it
|
|
enabled_modules: str = ""
|
|
|
|
model_config = {"env_file": ".env", "env_file_encoding": "utf-8", "extra": "ignore"}
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|