suprema-biostar-mcp 1.0.1__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.
- biostar_x_mcp_server/__init__.py +25 -0
- biostar_x_mcp_server/__main__.py +15 -0
- biostar_x_mcp_server/config.py +87 -0
- biostar_x_mcp_server/handlers/__init__.py +35 -0
- biostar_x_mcp_server/handlers/access_handler.py +2162 -0
- biostar_x_mcp_server/handlers/audit_handler.py +489 -0
- biostar_x_mcp_server/handlers/auth_handler.py +216 -0
- biostar_x_mcp_server/handlers/base_handler.py +228 -0
- biostar_x_mcp_server/handlers/card_handler.py +746 -0
- biostar_x_mcp_server/handlers/device_handler.py +4344 -0
- biostar_x_mcp_server/handlers/door_handler.py +3969 -0
- biostar_x_mcp_server/handlers/event_handler.py +1331 -0
- biostar_x_mcp_server/handlers/file_handler.py +212 -0
- biostar_x_mcp_server/handlers/help_web_handler.py +379 -0
- biostar_x_mcp_server/handlers/log_handler.py +1051 -0
- biostar_x_mcp_server/handlers/navigation_handler.py +109 -0
- biostar_x_mcp_server/handlers/occupancy_handler.py +541 -0
- biostar_x_mcp_server/handlers/user_handler.py +3568 -0
- biostar_x_mcp_server/schemas/__init__.py +21 -0
- biostar_x_mcp_server/schemas/access.py +158 -0
- biostar_x_mcp_server/schemas/audit.py +73 -0
- biostar_x_mcp_server/schemas/auth.py +24 -0
- biostar_x_mcp_server/schemas/cards.py +128 -0
- biostar_x_mcp_server/schemas/devices.py +496 -0
- biostar_x_mcp_server/schemas/doors.py +306 -0
- biostar_x_mcp_server/schemas/events.py +104 -0
- biostar_x_mcp_server/schemas/files.py +7 -0
- biostar_x_mcp_server/schemas/help.py +29 -0
- biostar_x_mcp_server/schemas/logs.py +33 -0
- biostar_x_mcp_server/schemas/occupancy.py +19 -0
- biostar_x_mcp_server/schemas/tool_response.py +29 -0
- biostar_x_mcp_server/schemas/users.py +166 -0
- biostar_x_mcp_server/server.py +335 -0
- biostar_x_mcp_server/session.py +221 -0
- biostar_x_mcp_server/tool_manager.py +172 -0
- biostar_x_mcp_server/tools/__init__.py +45 -0
- biostar_x_mcp_server/tools/access.py +510 -0
- biostar_x_mcp_server/tools/audit.py +227 -0
- biostar_x_mcp_server/tools/auth.py +59 -0
- biostar_x_mcp_server/tools/cards.py +269 -0
- biostar_x_mcp_server/tools/categories.py +197 -0
- biostar_x_mcp_server/tools/devices.py +1552 -0
- biostar_x_mcp_server/tools/doors.py +865 -0
- biostar_x_mcp_server/tools/events.py +305 -0
- biostar_x_mcp_server/tools/files.py +28 -0
- biostar_x_mcp_server/tools/help.py +80 -0
- biostar_x_mcp_server/tools/logs.py +123 -0
- biostar_x_mcp_server/tools/navigation.py +89 -0
- biostar_x_mcp_server/tools/occupancy.py +91 -0
- biostar_x_mcp_server/tools/users.py +1113 -0
- biostar_x_mcp_server/utils/__init__.py +31 -0
- biostar_x_mcp_server/utils/category_mapper.py +206 -0
- biostar_x_mcp_server/utils/decorators.py +101 -0
- biostar_x_mcp_server/utils/language_detector.py +51 -0
- biostar_x_mcp_server/utils/search.py +42 -0
- biostar_x_mcp_server/utils/timezone.py +122 -0
- suprema_biostar_mcp-1.0.1.dist-info/METADATA +163 -0
- suprema_biostar_mcp-1.0.1.dist-info/RECORD +61 -0
- suprema_biostar_mcp-1.0.1.dist-info/WHEEL +4 -0
- suprema_biostar_mcp-1.0.1.dist-info/entry_points.txt +2 -0
- suprema_biostar_mcp-1.0.1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""
|
|
2
|
+
BioStar X MCP Server
|
|
3
|
+
Lightweight MCP server for BioStar X integration
|
|
4
|
+
|
|
5
|
+
Features:
|
|
6
|
+
- Full BioStar X API integration (138+ tools)
|
|
7
|
+
- Web-based documentation (no vector DB required)
|
|
8
|
+
- Dynamic tool category loading
|
|
9
|
+
- Session management with auto-refresh
|
|
10
|
+
- Multi-language support (Korean/English)
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
__version__ = "1.0.0"
|
|
14
|
+
__author__ = "Suprema Inc."
|
|
15
|
+
|
|
16
|
+
from .config import Config
|
|
17
|
+
from .session import BioStarSession
|
|
18
|
+
from .tool_manager import ToolManager
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"Config",
|
|
22
|
+
"BioStarSession",
|
|
23
|
+
"ToolManager",
|
|
24
|
+
"__version__"
|
|
25
|
+
]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""
|
|
2
|
+
BioStar X MCP Server - Main Entry Point
|
|
3
|
+
Run with: python -m biostar_x_mcp_server
|
|
4
|
+
"""
|
|
5
|
+
import asyncio
|
|
6
|
+
import sys
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
# Ensure the parent directory is in the path
|
|
10
|
+
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
11
|
+
|
|
12
|
+
from .server import main
|
|
13
|
+
|
|
14
|
+
if __name__ == "__main__":
|
|
15
|
+
asyncio.run(main())
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"""
|
|
2
|
+
BioStar X MCP Server Configuration
|
|
3
|
+
Lightweight configuration without vector DB dependencies
|
|
4
|
+
"""
|
|
5
|
+
import os
|
|
6
|
+
from typing import Optional
|
|
7
|
+
from pydantic import BaseModel, Field
|
|
8
|
+
from dotenv import load_dotenv
|
|
9
|
+
|
|
10
|
+
load_dotenv()
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Config(BaseModel):
|
|
14
|
+
"""Configuration for BioStar X MCP Server (Lightweight)."""
|
|
15
|
+
|
|
16
|
+
# BioStar X API settings
|
|
17
|
+
biostar_url: str = Field(
|
|
18
|
+
default_factory=lambda: os.getenv("BIOSTAR_URL", "https://localhost"),
|
|
19
|
+
description="BioStar X server URL"
|
|
20
|
+
)
|
|
21
|
+
biostar_username: str = Field(
|
|
22
|
+
default_factory=lambda: os.getenv("BIOSTAR_USERNAME", ""),
|
|
23
|
+
description="BioStar X username"
|
|
24
|
+
)
|
|
25
|
+
biostar_password: str = Field(
|
|
26
|
+
default_factory=lambda: os.getenv("BIOSTAR_PASSWORD", ""),
|
|
27
|
+
description="BioStar X password"
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
# API settings
|
|
31
|
+
api_timeout: int = Field(
|
|
32
|
+
default_factory=lambda: int(os.getenv("API_TIMEOUT", "30")),
|
|
33
|
+
description="API request timeout in seconds"
|
|
34
|
+
)
|
|
35
|
+
verify_ssl: bool = Field(
|
|
36
|
+
default_factory=lambda: os.getenv("VERIFY_SSL", "true").lower() == "true",
|
|
37
|
+
description="Verify SSL certificates"
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
# Session settings
|
|
41
|
+
session_refresh_interval: int = Field(
|
|
42
|
+
default_factory=lambda: int(os.getenv("SESSION_REFRESH_INTERVAL", "3600")),
|
|
43
|
+
description="Session refresh interval in seconds"
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
# Server settings
|
|
47
|
+
debug: bool = Field(
|
|
48
|
+
default_factory=lambda: os.getenv("DEBUG", "false").lower() == "true",
|
|
49
|
+
description="Enable debug mode"
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
# Tool loading settings
|
|
53
|
+
default_categories: list[str] = Field(
|
|
54
|
+
default=["auth"],
|
|
55
|
+
description="Categories to load by default"
|
|
56
|
+
)
|
|
57
|
+
max_active_categories: int = Field(
|
|
58
|
+
default=15,
|
|
59
|
+
description="Maximum number of active tool categories"
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
# Documentation settings (Web-based help)
|
|
63
|
+
docs_base_url: str = Field(
|
|
64
|
+
default_factory=lambda: os.getenv("DOCS_BASE_URL", "https://docs.supremainc.com"),
|
|
65
|
+
description="Base URL for BioStar X documentation"
|
|
66
|
+
)
|
|
67
|
+
docs_cache_ttl: int = Field(
|
|
68
|
+
default_factory=lambda: int(os.getenv("DOCS_CACHE_TTL", "3600")),
|
|
69
|
+
description="Documentation cache TTL in seconds"
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
class Config:
|
|
73
|
+
env_file = ".env"
|
|
74
|
+
env_file_encoding = "utf-8"
|
|
75
|
+
|
|
76
|
+
def validate_required(self) -> list[str]:
|
|
77
|
+
"""Validate required configuration and return list of errors."""
|
|
78
|
+
errors = []
|
|
79
|
+
|
|
80
|
+
if not self.biostar_url:
|
|
81
|
+
errors.append("BIOSTAR_URL is required")
|
|
82
|
+
if not self.biostar_username:
|
|
83
|
+
errors.append("BIOSTAR_USERNAME is required")
|
|
84
|
+
if not self.biostar_password:
|
|
85
|
+
errors.append("BIOSTAR_PASSWORD is required")
|
|
86
|
+
|
|
87
|
+
return errors
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""
|
|
2
|
+
BioStar X MCP Server Handlers
|
|
3
|
+
All API handlers for BioStar X integration
|
|
4
|
+
"""
|
|
5
|
+
from .base_handler import BaseHandler
|
|
6
|
+
from .auth_handler import AuthHandler
|
|
7
|
+
from .user_handler import UserHandler
|
|
8
|
+
from .door_handler import DoorHandler
|
|
9
|
+
from .access_handler import AccessHandler
|
|
10
|
+
from .device_handler import DeviceHandler
|
|
11
|
+
from .event_handler import EventHandler
|
|
12
|
+
from .audit_handler import AuditHandler
|
|
13
|
+
from .card_handler import CardsHandler
|
|
14
|
+
from .navigation_handler import NavigationHandler
|
|
15
|
+
from .file_handler import FileHandler
|
|
16
|
+
from .log_handler import LogHandler
|
|
17
|
+
from .occupancy_handler import OccupancyHandler
|
|
18
|
+
from .help_web_handler import HelpWebHandler
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"BaseHandler",
|
|
22
|
+
"AuthHandler",
|
|
23
|
+
"UserHandler",
|
|
24
|
+
"DoorHandler",
|
|
25
|
+
"AccessHandler",
|
|
26
|
+
"DeviceHandler",
|
|
27
|
+
"EventHandler",
|
|
28
|
+
"AuditHandler",
|
|
29
|
+
"CardsHandler",
|
|
30
|
+
"NavigationHandler",
|
|
31
|
+
"FileHandler",
|
|
32
|
+
"LogHandler",
|
|
33
|
+
"OccupancyHandler",
|
|
34
|
+
"HelpWebHandler"
|
|
35
|
+
]
|