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.
Files changed (61) hide show
  1. biostar_x_mcp_server/__init__.py +25 -0
  2. biostar_x_mcp_server/__main__.py +15 -0
  3. biostar_x_mcp_server/config.py +87 -0
  4. biostar_x_mcp_server/handlers/__init__.py +35 -0
  5. biostar_x_mcp_server/handlers/access_handler.py +2162 -0
  6. biostar_x_mcp_server/handlers/audit_handler.py +489 -0
  7. biostar_x_mcp_server/handlers/auth_handler.py +216 -0
  8. biostar_x_mcp_server/handlers/base_handler.py +228 -0
  9. biostar_x_mcp_server/handlers/card_handler.py +746 -0
  10. biostar_x_mcp_server/handlers/device_handler.py +4344 -0
  11. biostar_x_mcp_server/handlers/door_handler.py +3969 -0
  12. biostar_x_mcp_server/handlers/event_handler.py +1331 -0
  13. biostar_x_mcp_server/handlers/file_handler.py +212 -0
  14. biostar_x_mcp_server/handlers/help_web_handler.py +379 -0
  15. biostar_x_mcp_server/handlers/log_handler.py +1051 -0
  16. biostar_x_mcp_server/handlers/navigation_handler.py +109 -0
  17. biostar_x_mcp_server/handlers/occupancy_handler.py +541 -0
  18. biostar_x_mcp_server/handlers/user_handler.py +3568 -0
  19. biostar_x_mcp_server/schemas/__init__.py +21 -0
  20. biostar_x_mcp_server/schemas/access.py +158 -0
  21. biostar_x_mcp_server/schemas/audit.py +73 -0
  22. biostar_x_mcp_server/schemas/auth.py +24 -0
  23. biostar_x_mcp_server/schemas/cards.py +128 -0
  24. biostar_x_mcp_server/schemas/devices.py +496 -0
  25. biostar_x_mcp_server/schemas/doors.py +306 -0
  26. biostar_x_mcp_server/schemas/events.py +104 -0
  27. biostar_x_mcp_server/schemas/files.py +7 -0
  28. biostar_x_mcp_server/schemas/help.py +29 -0
  29. biostar_x_mcp_server/schemas/logs.py +33 -0
  30. biostar_x_mcp_server/schemas/occupancy.py +19 -0
  31. biostar_x_mcp_server/schemas/tool_response.py +29 -0
  32. biostar_x_mcp_server/schemas/users.py +166 -0
  33. biostar_x_mcp_server/server.py +335 -0
  34. biostar_x_mcp_server/session.py +221 -0
  35. biostar_x_mcp_server/tool_manager.py +172 -0
  36. biostar_x_mcp_server/tools/__init__.py +45 -0
  37. biostar_x_mcp_server/tools/access.py +510 -0
  38. biostar_x_mcp_server/tools/audit.py +227 -0
  39. biostar_x_mcp_server/tools/auth.py +59 -0
  40. biostar_x_mcp_server/tools/cards.py +269 -0
  41. biostar_x_mcp_server/tools/categories.py +197 -0
  42. biostar_x_mcp_server/tools/devices.py +1552 -0
  43. biostar_x_mcp_server/tools/doors.py +865 -0
  44. biostar_x_mcp_server/tools/events.py +305 -0
  45. biostar_x_mcp_server/tools/files.py +28 -0
  46. biostar_x_mcp_server/tools/help.py +80 -0
  47. biostar_x_mcp_server/tools/logs.py +123 -0
  48. biostar_x_mcp_server/tools/navigation.py +89 -0
  49. biostar_x_mcp_server/tools/occupancy.py +91 -0
  50. biostar_x_mcp_server/tools/users.py +1113 -0
  51. biostar_x_mcp_server/utils/__init__.py +31 -0
  52. biostar_x_mcp_server/utils/category_mapper.py +206 -0
  53. biostar_x_mcp_server/utils/decorators.py +101 -0
  54. biostar_x_mcp_server/utils/language_detector.py +51 -0
  55. biostar_x_mcp_server/utils/search.py +42 -0
  56. biostar_x_mcp_server/utils/timezone.py +122 -0
  57. suprema_biostar_mcp-1.0.1.dist-info/METADATA +163 -0
  58. suprema_biostar_mcp-1.0.1.dist-info/RECORD +61 -0
  59. suprema_biostar_mcp-1.0.1.dist-info/WHEEL +4 -0
  60. suprema_biostar_mcp-1.0.1.dist-info/entry_points.txt +2 -0
  61. suprema_biostar_mcp-1.0.1.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,305 @@
1
+ from mcp.types import Tool
2
+
3
+ GET_EVENT_TYPES_TOOL = Tool(
4
+ name="get-event-types",
5
+ description=(
6
+ "List event types from BioStar 2 via /api/event_types with useful filters. "
7
+ "Server flags: is_break_glass, setting_alert, setting_all. "
8
+ "Client-side filters: search, codes, only_alertable, only_enable_alert. "
9
+ "Supports sorting, limit/offset, and grouping."
10
+ ),
11
+ inputSchema={
12
+ "type": "object",
13
+ "properties": {
14
+ "is_break_glass": {
15
+ "type": "boolean",
16
+ "description": "If true, list user-renamed (break-glass) names. When true and others not specified, setting_alert/setting_all default to false.",
17
+ "default": False
18
+ },
19
+ "setting_alert": {
20
+ "type": "boolean",
21
+ "description": "If true, list alertable event types (server-side filter).",
22
+ "default": True
23
+ },
24
+ "setting_all": {
25
+ "type": "boolean",
26
+ "description": "If true, list all event types (server-side filter).",
27
+ "default": True
28
+ },
29
+ "search": {
30
+ "type": "string",
31
+ "description": "Case-insensitive contains across code, name, and description."
32
+ },
33
+ "codes": {
34
+ "type": "array",
35
+ "items": {"type": ["string", "number"]},
36
+ "description": "Restrict to specific event code(s)."
37
+ },
38
+ "only_alertable": {
39
+ "type": "boolean",
40
+ "description": "Keep only items with alertable == true.",
41
+ "default": False
42
+ },
43
+ "only_enable_alert": {
44
+ "type": "boolean",
45
+ "description": "Keep only items with enable_alert == true.",
46
+ "default": False
47
+ },
48
+ "sort_by": {
49
+ "type": "string",
50
+ "enum": ["code", "name"],
51
+ "description": "Sort field (default: code).",
52
+ "default": "code"
53
+ },
54
+ "sort_desc": {
55
+ "type": "boolean",
56
+ "description": "Descending sort if true.",
57
+ "default": False
58
+ },
59
+ "offset": {
60
+ "type": "integer",
61
+ "description": "Start index for slicing.",
62
+ "default": 0
63
+ },
64
+ "limit": {
65
+ "type": "integer",
66
+ "description": "Maximum number of items to return (client-side slicing)."
67
+ },
68
+ "group_by": {
69
+ "type": "string",
70
+ "enum": ["none", "alertable", "enable_alert"],
71
+ "description": "Group the result by a boolean field.",
72
+ "default": "none"
73
+ }
74
+ },
75
+ "required": []
76
+ }
77
+ )
78
+
79
+ SEARCH_EVENTS_TOOL = Tool(
80
+ name="search-events",
81
+ description="""Advanced search for events with multiple filter criteria.
82
+
83
+ CRITICAL DATE/TIME RULES:
84
+ - If no date specified by user, use CURRENT date/time (last 24 hours from NOW)
85
+ - NEVER hardcode dates like 2024-XX-XX
86
+ - Calculate dates dynamically from current system time
87
+ - Format: "YYYY-MM-DDTHH:MM:SS" (without timezone, server will convert to UTC)
88
+ - Example: "2025-11-07T00:00:00" (NOT "2025-11-07T00:00:00.000Z")
89
+
90
+ USER SEARCH:
91
+ - Use user_id parameter (NOT conditions array) for filtering by user ID
92
+ - Use user_name parameter to search by name (will be resolved to user_id)
93
+ """,
94
+ inputSchema={
95
+ "type": "object",
96
+ "properties": {
97
+ "conditions": {
98
+ "type": "array",
99
+ "description": "Array of search conditions (for advanced filters only, do NOT use for datetime or user_id)",
100
+ "items": {
101
+ "type": "object",
102
+ "properties": {
103
+ "column": {"type": "string"},
104
+ "operator": {
105
+ "type": "integer",
106
+ "enum": [0, 1, 2, 3, 4, 5, 6]
107
+ },
108
+ "value": {
109
+ "type": "array",
110
+ "items": {"type": ["string","number"]}
111
+ },
112
+ "values": {
113
+ "type": "array",
114
+ "items": {"type": ["string","number"]}
115
+ }
116
+ },
117
+ "required": ["column", "operator"]
118
+ }
119
+ },
120
+ "user_id": {
121
+ "type": ["string","number"],
122
+ "description": "User ID to filter events (e.g., '61061'). Use this instead of conditions array."
123
+ },
124
+ "user_name": {
125
+ "type": "string",
126
+ "description": "User name to filter events. Server will resolve name to user_id."
127
+ },
128
+ "start_datetime": {
129
+ "type": "string",
130
+ "description": "Start datetime: 'YYYY-MM-DDTHH:MM:SS' (e.g., '2025-11-07T00:00:00'). WITHOUT timezone. Server converts to UTC."
131
+ },
132
+ "end_datetime": {
133
+ "type": "string",
134
+ "description": "End datetime: 'YYYY-MM-DDTHH:MM:SS' (e.g., '2025-11-07T23:59:59'). WITHOUT timezone. Server converts to UTC."
135
+ },
136
+ "limit": {"type": "integer", "default": 100},
137
+ "offset": {"type": "integer", "default": 0},
138
+ "order_by": {"type": "string", "default": "datetime"},
139
+ "order_type": {"type": "string", "enum": ["asc","desc"], "default": "desc"}
140
+ },
141
+ "required": []
142
+ }
143
+ )
144
+
145
+
146
+ GET_REALTIME_EVENTS_TOOL = Tool(
147
+ name="get-realtime-events",
148
+ description="Connect to BioStar 2 websocket for real-time event monitoring",
149
+ inputSchema={
150
+ "type": "object",
151
+ "properties": {
152
+ "duration": {
153
+ "type": "integer",
154
+ "description": "Duration to monitor events in seconds (max: 300)",
155
+ "maximum": 300,
156
+ "default": 60
157
+ },
158
+ "event_types": {
159
+ "type": "array",
160
+ "items": {"type": "string"},
161
+ "description": "Filter real-time events by specific event type IDs"
162
+ }
163
+ },
164
+ "required": []
165
+ }
166
+ )
167
+
168
+ GET_ACCESS_LOGS_TOOL = Tool(
169
+ name="get-access-logs",
170
+ description="""Get access control specific logs (simplified event search focused on access).
171
+
172
+ IMPORTANT: If no date specified, defaults to last 24 hours from current system time.
173
+ NEVER use hardcoded dates like 2024-XX-XX. Always calculate from NOW.
174
+ """,
175
+ inputSchema={
176
+ "type": "object",
177
+ "properties": {
178
+ "start_datetime": {
179
+ "type": "string",
180
+ "description": "Start datetime in ISO 8601 format (e.g., \"2025-10-27T00:00:00.000Z\"). If not provided, defaults to 24 hours ago from NOW. NEVER use hardcoded dates."
181
+ },
182
+ "end_datetime": {
183
+ "type": "string",
184
+ "description": "End datetime in ISO 8601 format (e.g., \"2025-10-27T23:59:59.999Z\"). If not provided, defaults to NOW. NEVER use hardcoded dates."
185
+ },
186
+ "user_name": {
187
+ "type": "string",
188
+ "description": "Filter by user name (partial match)"
189
+ },
190
+ "success_only": {
191
+ "type": "boolean",
192
+ "description": "Show only successful access attempts",
193
+ "default": False
194
+ },
195
+ "limit": {
196
+ "type": "integer",
197
+ "description": "Maximum number of logs to retrieve",
198
+ "default": 100
199
+ }
200
+ },
201
+ "required": []
202
+ }
203
+ )
204
+
205
+ EXPORT_EVENTS_CSV_TOOL = Tool(
206
+ name="export-events-csv",
207
+ description="Export event logs to CSV via /api/events/export and copy the file to the Windows Downloads folder.",
208
+ inputSchema={
209
+ "type": "object",
210
+ "properties": {
211
+ "start_datetime": {"type": "string", "description": "Start datetime (ISO 8601 with Z). If 'conditions' omitted, this and end_datetime build a BETWEEN."},
212
+ "end_datetime": {"type": "string", "description": "End datetime (ISO 8601 with Z)."},
213
+ "conditions": {
214
+ "type": "array",
215
+ "description": "Custom conditions for the Query. If provided, takes precedence.",
216
+ "items": {
217
+ "type": "object",
218
+ "properties": {
219
+ "column": {"type": "string"},
220
+ "operator": {"type": "integer"},
221
+ "values": {"type": "array", "items": {"type": ["string","number"]}}
222
+ },
223
+ "required": ["column","operator","values"]
224
+ }
225
+ },
226
+ "user_id": {
227
+ "type": ["string","number"],
228
+ "description": "Convenience filter: constrains to this user_id (mapped to column 'user_id.user_id')."
229
+ },
230
+ "user_name": {
231
+ "type": "string",
232
+ "description": "Convenience filter: resolve name -> user_id and filter (exact match preferred)."
233
+ },
234
+ "event_types": {
235
+ "type": "array",
236
+ "items": {"type": ["string","number"]},
237
+ "description": "Convenience filter: adds EQUAL condition on event_type_id with provided values."
238
+ },
239
+ "columns": {
240
+ "type": "array",
241
+ "items": {"type": "string"},
242
+ "description": "Columns to export (default matches BioStar example).",
243
+ "default": ["datetime","door_id.name","device_id.id","device_id.name","user_group_id","user_id","temperature","event_type_id","tna_key"]
244
+ },
245
+ "headers": {
246
+ "type": "array",
247
+ "items": {"type": "string"},
248
+ "description": "CSV headers (must match columns length).",
249
+ "default": ["Date","Door","Device ID","Device","User Group","User","Temperature","Event","TNA Key"]
250
+ },
251
+ "offset": {"type": "integer", "description": "Offset for pagination.", "default": 0},
252
+ "time_offset_minutes": {"type": "integer", "description": "Timezone offset in minutes, e.g., 480 for UTC+8.", "default": 0},
253
+ "use_centigrade": {"type": "boolean", "description": "Whether to export temperature in centigrade.", "default": True},
254
+ "copy_to_downloads": {"type": "boolean", "description": "Copy exported CSV to Windows Downloads.", "default": True},
255
+ "dest_dir": {"type": "string", "description": "Optional absolute destination directory (overrides Downloads)."},
256
+ "target_username": {"type": "string", "description": "If provided, copies to C:\\Users\\<name>\\Downloads."},
257
+ "filename": {"type": "string", "description": "Legacy/unused: server decides filename. Returned as 'filename' in response.", "default": "events_export.csv"}
258
+ },
259
+ "required": ["start_datetime", "end_datetime"]
260
+ }
261
+ )
262
+
263
+ GET_TEMPERATURE_LOGS_TOOL = Tool(
264
+ name="get-temperature-logs",
265
+ description="Get temperature measurement logs from thermal cameras",
266
+ inputSchema={
267
+ "type": "object",
268
+ "properties": {
269
+ "start_datetime": {
270
+ "type": "string",
271
+ "description": "Start datetime for temperature log search in ISO 8601 format with Z suffix (e.g., \"2025-07-26T15:00:00.000Z\")"
272
+ },
273
+ "end_datetime": {
274
+ "type": "string",
275
+ "description": "End datetime for temperature log search in ISO 8601 format with Z suffix (e.g., \"2025-08-02T14:59:59.000Z\")"
276
+ },
277
+ "user_id": {
278
+ "type": "string",
279
+ "description": "Filter by specific user ID"
280
+ },
281
+ "abnormal_only": {
282
+ "type": "boolean",
283
+ "description": "Show only abnormal temperature readings",
284
+ "default": False
285
+ },
286
+ "temperature_threshold": {
287
+ "type": "number",
288
+ "description": "Temperature threshold in Celsius (e.g., 37.5)",
289
+ "minimum": 35.0,
290
+ "maximum": 42.0
291
+ }
292
+ },
293
+ "required": []
294
+ }
295
+ )
296
+
297
+ # Export all tools
298
+ EVENT_TOOLS = [
299
+ GET_EVENT_TYPES_TOOL,
300
+ SEARCH_EVENTS_TOOL,
301
+ GET_REALTIME_EVENTS_TOOL,
302
+ GET_ACCESS_LOGS_TOOL,
303
+ EXPORT_EVENTS_CSV_TOOL,
304
+ GET_TEMPERATURE_LOGS_TOOL
305
+ ]
@@ -0,0 +1,28 @@
1
+ from mcp.types import Tool
2
+
3
+ # File handling tools for processing uploaded files
4
+ READ_UPLOADED_FILE_TOOL = Tool(
5
+ name="read-uploaded-file",
6
+ description=(
7
+ "Read the content of an uploaded file from the current request context. "
8
+ "Use this when the user has attached files (CSV, PDF, PNG, JPEG, JPG, etc.) to their message. "
9
+ "Returns the file content as text (for CSV/text), OCR extracted text (for images), or base64 (for binary/PDF files). "
10
+ "For image files (PNG, JPEG, JPG), automatically performs OCR to extract text content. "
11
+ "This tool can be used to get file content before calling import-users-csv-smart or other tools."
12
+ ),
13
+ inputSchema={
14
+ "type": "object",
15
+ "properties": {
16
+ "filename": {
17
+ "type": "string",
18
+ "description": "Name of the uploaded file to read (e.g., 'users.csv')"
19
+ }
20
+ },
21
+ "required": ["filename"]
22
+ }
23
+ )
24
+
25
+ # List of all file tools
26
+ FILE_TOOLS = [
27
+ READ_UPLOADED_FILE_TOOL
28
+ ]
@@ -0,0 +1,80 @@
1
+ """
2
+ Help Tool Definitions (Web-based)
3
+
4
+ Tools for searching documentation from docs.supremainc.com
5
+ No vector database required - fetches directly from web
6
+ """
7
+ from mcp.types import Tool
8
+
9
+ # Help search tool (web-based)
10
+ HELP_SEARCH_TOOL = Tool(
11
+ name="search-biostar-docs",
12
+ description="[DOCUMENTATION] Search BioStar X documentation from docs.supremainc.com. Use this when user asks 'how to', 'what is', 'explain', or wants information about BioStar X features. Fetches live documentation - always up to date. Returns relevant pages with content. For actual system operations, use action tools (get-users, create-user, control-door, etc.) instead.",
13
+ inputSchema={
14
+ "type": "object",
15
+ "properties": {
16
+ "query": {
17
+ "type": "string",
18
+ "description": "Question or keyword to search (e.g., 'how to create user', 'access group setup', 'door monitoring')"
19
+ },
20
+ "language": {
21
+ "type": "string",
22
+ "enum": ["ko", "en"],
23
+ "description": "Language selection (default: auto-detect from query)",
24
+ "default": "en"
25
+ }
26
+ },
27
+ "required": ["query"]
28
+ }
29
+ )
30
+
31
+ # Get specific docs page
32
+ GET_DOCS_PAGE_TOOL = Tool(
33
+ name="get-docs-page",
34
+ description="[DOCUMENTATION] Fetch a specific BioStar X documentation page by URL or path. Use when you need detailed information from a specific documentation section.",
35
+ inputSchema={
36
+ "type": "object",
37
+ "properties": {
38
+ "url": {
39
+ "type": "string",
40
+ "description": "Full URL or path (e.g., '/user/add-user', 'https://docs.supremainc.com/en/platform/biostar_x/user')"
41
+ },
42
+ "language": {
43
+ "type": "string",
44
+ "enum": ["ko", "en"],
45
+ "description": "Language for path-based URLs (default: en)",
46
+ "default": "en"
47
+ }
48
+ },
49
+ "required": ["url"]
50
+ }
51
+ )
52
+
53
+ # Tool help lookup
54
+ TOOL_HELP_TOOL = Tool(
55
+ name="get-tool-help",
56
+ description="Get usage information and documentation for a specific BioStar X MCP tool.",
57
+ inputSchema={
58
+ "type": "object",
59
+ "properties": {
60
+ "tool_name": {
61
+ "type": "string",
62
+ "description": "Tool name (e.g., 'create-user', 'control-door', 'search-events')"
63
+ },
64
+ "language": {
65
+ "type": "string",
66
+ "enum": ["ko", "en"],
67
+ "description": "Language selection (default: en)",
68
+ "default": "en"
69
+ }
70
+ },
71
+ "required": ["tool_name"]
72
+ }
73
+ )
74
+
75
+ # Export help tools
76
+ HELP_TOOLS = [
77
+ HELP_SEARCH_TOOL,
78
+ GET_DOCS_PAGE_TOOL,
79
+ TOOL_HELP_TOOL
80
+ ]
@@ -0,0 +1,123 @@
1
+ """
2
+ BioStar X 로그 분석 도구 정의
3
+ """
4
+ from mcp.types import Tool
5
+ from typing import List
6
+
7
+ LOG_TOOLS: List[Tool] = [
8
+ Tool(
9
+ name="analyze_server_logs",
10
+ description="BioStar X 서버 로그 파일을 분석하여 오류, 경고, 이벤트를 파악합니다. "
11
+ "메인서버, 장치, 게이트웨이, API 서버 로그의 최신 50줄을 분석합니다. "
12
+ "로그 기반 오류 분석, 문제 진단에 사용하세요. "
13
+ "인증 없이 로컬 로그 파일을 직접 읽어 분석합니다.",
14
+ inputSchema={
15
+ "type": "object",
16
+ "properties": {
17
+ "log_path": {
18
+ "type": "string",
19
+ "description": "로그 파일 경로 (기본값: C:\\Program Files\\BioStar X\\logs)",
20
+ "default": "C:\\Program Files\\BioStar X\\logs"
21
+ },
22
+ "lines_to_read": {
23
+ "type": "integer",
24
+ "description": "각 로그 파일에서 읽을 줄 수 (기본값: 50)",
25
+ "default": 50,
26
+ "minimum": 20,
27
+ "maximum": 100
28
+ }
29
+ },
30
+ "required": []
31
+ }
32
+ ),
33
+ Tool(
34
+ name="get_log_file_info",
35
+ description="BioStar X 로그 디렉토리의 파일 목록과 정보를 조회합니다.",
36
+ inputSchema={
37
+ "type": "object",
38
+ "properties": {
39
+ "log_path": {
40
+ "type": "string",
41
+ "description": "로그 파일 경로 (기본값: C:\\Program Files\\BioStar X\\logs)",
42
+ "default": "C:\\Program Files\\BioStar X\\logs"
43
+ }
44
+ },
45
+ "required": []
46
+ }
47
+ ),
48
+ Tool(
49
+ name="read_specific_log",
50
+ description="특정 로그 파일의 내용을 읽어 분석합니다.",
51
+ inputSchema={
52
+ "type": "object",
53
+ "properties": {
54
+ "log_file_path": {
55
+ "type": "string",
56
+ "description": "읽을 로그 파일의 전체 경로"
57
+ },
58
+ "lines_to_read": {
59
+ "type": "integer",
60
+ "description": "읽을 줄 수 (기본값: 50)",
61
+ "default": 50,
62
+ "minimum": 20,
63
+ "maximum": 100
64
+ },
65
+ "from_end": {
66
+ "type": "boolean",
67
+ "description": "파일 끝에서부터 읽을지 여부 (기본값: true)",
68
+ "default": True
69
+ }
70
+ },
71
+ "required": ["log_file_path"]
72
+ }
73
+ ),
74
+ Tool(
75
+ name="get_system_resources",
76
+ description="시스템 리소스 사용량을 실시간으로 모니터링합니다. "
77
+ "CPU, 메모리, 디스크 사용량과 BioStar 프로세스의 메모리 사용량을 확인합니다. "
78
+ "시스템 성능, 메모리 사용량, CPU 사용률 확인에 사용하세요. "
79
+ "로그 분석이 아닌 실시간 시스템 모니터링 도구입니다.",
80
+ inputSchema={
81
+ "type": "object",
82
+ "properties": {
83
+ "include_all_processes": {
84
+ "type": "boolean",
85
+ "description": "모든 프로세스 정보 포함 여부 (기본값: false, BioStar 관련만)",
86
+ "default": False
87
+ }
88
+ },
89
+ "required": []
90
+ }
91
+ ),
92
+ Tool(
93
+ name="analyze_server_status",
94
+ description="BioStar X 서버의 종합적인 상태를 분석합니다. "
95
+ "로그 분석(오류/경고)과 시스템 리소스(CPU/메모리) 모니터링을 결합하여 전체적인 서버 상태를 파악합니다. "
96
+ "사용자가 '서버 종합 분석', '서버 전체 상태', '서버 진단'을 요청하면 이 도구를 사용하세요. "
97
+ "단순 로그 분석이나 리소스 모니터링만 필요하면 각각의 전용 도구를 사용하세요. "
98
+ "인증 없이 로컬 로그와 시스템 정보를 직접 분석합니다.",
99
+ inputSchema={
100
+ "type": "object",
101
+ "properties": {
102
+ "log_path": {
103
+ "type": "string",
104
+ "description": "로그 파일 경로 (기본값: C:\\Program Files\\BioStar X\\logs)",
105
+ "default": "C:\\Program Files\\BioStar X\\logs"
106
+ },
107
+ "lines_to_read": {
108
+ "type": "integer",
109
+ "description": "각 로그 파일에서 읽을 줄 수 (기본값: 50)",
110
+ "default": 50,
111
+ "minimum": 20,
112
+ "maximum": 100
113
+ },
114
+ "include_system_resources": {
115
+ "type": "boolean",
116
+ "description": "시스템 리소스 정보 포함 여부 (기본값: true)",
117
+ "default": True
118
+ }
119
+ },
120
+ "required": []
121
+ }
122
+ )
123
+ ]
@@ -0,0 +1,89 @@
1
+ """
2
+ Navigation Tools for Frontend Page Routing
3
+ LLM이 작업 완료 후 적절한 페이지로 자동 이동을 제안
4
+ """
5
+ from mcp.types import Tool
6
+
7
+ NAVIGATION_TOOLS = [
8
+ Tool(
9
+ name="navigate-to-page",
10
+ description=""" MANDATORY: Call this tool at the END of every successful operation to navigate frontend to appropriate page.
11
+
12
+ YOU MUST ALWAYS CALL THIS TOOL after any operation (list, create, update, search) completes successfully.
13
+
14
+ Navigation Rules (MANDATORY):
15
+ - List devices (장치 조회) -> navigate-to-page(page_type="device_list")
16
+ - List users (사용자 조회) -> navigate-to-page(page_type="user_list")
17
+ - List doors (도어 조회) -> navigate-to-page(page_type="door_list")
18
+ - Create user (사용자 생성) -> navigate-to-page(page_type="user_detail", resource_id="USER_ID")
19
+ - Update user (사용자 수정) -> navigate-to-page(page_type="user_detail", resource_id="USER_ID")
20
+ - Update door (도어 설정) -> navigate-to-page(page_type="door_detail", resource_id="DOOR_ID")
21
+ - Update device (장치 설정) -> navigate-to-page(page_type="device_detail", resource_id="DEVICE_ID")
22
+ - Search events (이벤트 조회) -> navigate-to-page(page_type="monitoring")
23
+
24
+ Example workflow:
25
+ ```
26
+ User: "현재 사용가능한 장치들 알려줘"
27
+ Step 1: list-devices() <- Get device list
28
+ Step 2: navigate-to-page(page_type="device_list") <- MUST CALL THIS!
29
+ Step 3: Respond to user
30
+ ```
31
+
32
+ ```
33
+ User: "홍길동 사용자를 추가해줘"
34
+ Step 1: create-user(name="홍길동") <- Create user
35
+ Step 2: navigate-to-page(page_type="user_detail", resource_id="12345") <- MUST CALL THIS!
36
+ Step 3: Respond to user
37
+ ```
38
+
39
+ CRITICAL: If you see this tool in your tool list, you MUST call it at the end of your operation. Do NOT skip it.
40
+ """,
41
+ inputSchema={
42
+ "type": "object",
43
+ "properties": {
44
+ "page_type": {
45
+ "type": "string",
46
+ "enum": [
47
+ "user_list",
48
+ "user_detail",
49
+ "door_list",
50
+ "door_detail",
51
+ "device_list",
52
+ "device_detail",
53
+ "monitoring",
54
+ "custom_url"
55
+ ],
56
+ "description": "Type of page to navigate to"
57
+ },
58
+ "resource_id": {
59
+ "type": "string",
60
+ "description": "Resource ID (user_id, door_id, device_id) for detail pages. Required for *_detail page types."
61
+ },
62
+ "custom_url": {
63
+ "type": "string",
64
+ "description": "Custom URL path for custom_url page type. Example: /team/user/detail/123"
65
+ },
66
+ "action": {
67
+ "type": "object",
68
+ "description": "Optional action to perform on the page (click or scroll to element)",
69
+ "properties": {
70
+ "type": {
71
+ "type": "string",
72
+ "enum": ["click", "scroll"],
73
+ "description": "Action type"
74
+ },
75
+ "ng_label_key": {
76
+ "type": "string",
77
+ "description": "Angular label key to target (e.g., 'common.information')"
78
+ }
79
+ }
80
+ },
81
+ "reason": {
82
+ "type": "string",
83
+ "description": "Brief explanation of why navigating to this page (for user context)"
84
+ }
85
+ },
86
+ "required": ["page_type"]
87
+ }
88
+ )
89
+ ]