fenix-mcp 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fenix_mcp/__init__.py +17 -0
- fenix_mcp/application/presenters.py +24 -0
- fenix_mcp/application/tool_base.py +46 -0
- fenix_mcp/application/tool_registry.py +37 -0
- fenix_mcp/application/tools/__init__.py +29 -0
- fenix_mcp/application/tools/health.py +30 -0
- fenix_mcp/application/tools/initialize.py +125 -0
- fenix_mcp/application/tools/intelligence.py +253 -0
- fenix_mcp/application/tools/knowledge.py +905 -0
- fenix_mcp/application/tools/productivity.py +220 -0
- fenix_mcp/application/tools/user_config.py +158 -0
- fenix_mcp/domain/initialization.py +180 -0
- fenix_mcp/domain/intelligence.py +133 -0
- fenix_mcp/domain/knowledge.py +437 -0
- fenix_mcp/domain/productivity.py +184 -0
- fenix_mcp/domain/user_config.py +42 -0
- fenix_mcp/infrastructure/config.py +56 -0
- fenix_mcp/infrastructure/context.py +20 -0
- fenix_mcp/infrastructure/fenix_api/client.py +623 -0
- fenix_mcp/infrastructure/http_client.py +84 -0
- fenix_mcp/infrastructure/logging.py +43 -0
- fenix_mcp/interface/mcp_server.py +78 -0
- fenix_mcp/interface/transports.py +227 -0
- fenix_mcp/main.py +90 -0
- fenix_mcp-0.1.0.dist-info/METADATA +208 -0
- fenix_mcp-0.1.0.dist-info/RECORD +29 -0
- fenix_mcp-0.1.0.dist-info/WHEEL +5 -0
- fenix_mcp-0.1.0.dist-info/entry_points.txt +2 -0
- fenix_mcp-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
"""Configuration helpers for the Fênix MCP server."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from functools import lru_cache
|
|
7
|
+
from typing import Literal
|
|
8
|
+
|
|
9
|
+
from pydantic import Field, HttpUrl, field_validator
|
|
10
|
+
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Settings(BaseSettings):
|
|
14
|
+
"""All configuration knobs consumed by the server."""
|
|
15
|
+
|
|
16
|
+
api_url: str = Field(
|
|
17
|
+
default="https://fenix-api-production-7619.up.railway.app",
|
|
18
|
+
description="Base URL for the Fênix Cloud API.",
|
|
19
|
+
)
|
|
20
|
+
http_timeout: float = Field(default=30.0, description="Default HTTP timeout in seconds.")
|
|
21
|
+
log_level: str = Field(default="INFO", description="Root log level.")
|
|
22
|
+
transport_mode: Literal["stdio", "http", "both"] = Field(
|
|
23
|
+
default="stdio",
|
|
24
|
+
description="Active transport mode: stdio, http or both.",
|
|
25
|
+
)
|
|
26
|
+
http_host: str = Field(default="127.0.0.1", description="HTTP bind host.")
|
|
27
|
+
http_port: int = Field(default=3000, description="HTTP port when running with network transport.")
|
|
28
|
+
|
|
29
|
+
model_config = SettingsConfigDict(
|
|
30
|
+
populate_by_name=True,
|
|
31
|
+
env_prefix="FENIX_",
|
|
32
|
+
env_file=".env",
|
|
33
|
+
env_file_encoding="utf-8",
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
@field_validator("log_level")
|
|
37
|
+
@classmethod
|
|
38
|
+
def _validate_level(cls, value: str) -> str:
|
|
39
|
+
upper = value.upper()
|
|
40
|
+
allowed = {"CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG"}
|
|
41
|
+
if upper not in allowed:
|
|
42
|
+
raise ValueError(f"Invalid log level '{value}'. Allowed: {sorted(allowed)}")
|
|
43
|
+
return upper
|
|
44
|
+
|
|
45
|
+
@field_validator("api_url")
|
|
46
|
+
@classmethod
|
|
47
|
+
def _validate_api_url(cls, value: str) -> str:
|
|
48
|
+
HttpUrl(value)
|
|
49
|
+
return value
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@lru_cache(maxsize=1)
|
|
53
|
+
def load_settings() -> Settings:
|
|
54
|
+
"""Load settings from environment / .env file (cached)."""
|
|
55
|
+
|
|
56
|
+
return Settings() # type: ignore[call-arg]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
"""Shared context dependency injected into tools."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from logging import Logger
|
|
8
|
+
|
|
9
|
+
from fenix_mcp.infrastructure.config import Settings
|
|
10
|
+
from fenix_mcp.infrastructure.fenix_api.client import FenixApiClient
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass(slots=True)
|
|
14
|
+
class AppContext:
|
|
15
|
+
"""Runtime dependencies shared by tools."""
|
|
16
|
+
|
|
17
|
+
settings: Settings
|
|
18
|
+
logger: Logger
|
|
19
|
+
api_client: FenixApiClient
|
|
20
|
+
|