kubectl-mcp-server 1.16.0__py3-none-any.whl → 1.17.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.
- {kubectl_mcp_server-1.16.0.dist-info → kubectl_mcp_server-1.17.0.dist-info}/METADATA +1 -1
- {kubectl_mcp_server-1.16.0.dist-info → kubectl_mcp_server-1.17.0.dist-info}/RECORD +28 -14
- kubectl_mcp_tool/__init__.py +1 -1
- kubectl_mcp_tool/cli/cli.py +83 -9
- kubectl_mcp_tool/cli/output.py +14 -0
- kubectl_mcp_tool/config/__init__.py +46 -0
- kubectl_mcp_tool/config/loader.py +386 -0
- kubectl_mcp_tool/config/schema.py +184 -0
- kubectl_mcp_tool/mcp_server.py +219 -8
- kubectl_mcp_tool/observability/__init__.py +59 -0
- kubectl_mcp_tool/observability/metrics.py +223 -0
- kubectl_mcp_tool/observability/stats.py +255 -0
- kubectl_mcp_tool/observability/tracing.py +335 -0
- kubectl_mcp_tool/prompts/__init__.py +43 -0
- kubectl_mcp_tool/prompts/builtin.py +695 -0
- kubectl_mcp_tool/prompts/custom.py +298 -0
- kubectl_mcp_tool/prompts/prompts.py +180 -4
- kubectl_mcp_tool/safety.py +155 -0
- kubectl_mcp_tool/tools/cluster.py +384 -0
- tests/test_config.py +386 -0
- tests/test_mcp_integration.py +251 -0
- tests/test_observability.py +521 -0
- tests/test_prompts.py +716 -0
- tests/test_safety.py +218 -0
- {kubectl_mcp_server-1.16.0.dist-info → kubectl_mcp_server-1.17.0.dist-info}/WHEEL +0 -0
- {kubectl_mcp_server-1.16.0.dist-info → kubectl_mcp_server-1.17.0.dist-info}/entry_points.txt +0 -0
- {kubectl_mcp_server-1.16.0.dist-info → kubectl_mcp_server-1.17.0.dist-info}/licenses/LICENSE +0 -0
- {kubectl_mcp_server-1.16.0.dist-info → kubectl_mcp_server-1.17.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kubectl-mcp-server
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.17.0
|
|
4
4
|
Summary: A Model Context Protocol (MCP) server for Kubernetes with 220+ tools, 8 resources, and 8 prompts
|
|
5
5
|
Home-page: https://github.com/rohitg00/kubectl-mcp-server
|
|
6
6
|
Author: Rohit Ghumare
|
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
kubectl_mcp_server-1.
|
|
2
|
-
kubectl_mcp_tool/__init__.py,sha256=
|
|
1
|
+
kubectl_mcp_server-1.17.0.dist-info/licenses/LICENSE,sha256=nH9Z0W0WNH2oQ4cPrBAU8ldDcHfeI6NUbkSGiazYWgQ,1070
|
|
2
|
+
kubectl_mcp_tool/__init__.py,sha256=9s67uMXh5QXX-vJgm6xVezzvqqpgckeH0JrNM9Q381E,580
|
|
3
3
|
kubectl_mcp_tool/__main__.py,sha256=CE6cTD6PA71Ap0i5_gE17Pb9FcedOJmtGRNzZ5-TFSc,1490
|
|
4
4
|
kubectl_mcp_tool/crd_detector.py,sha256=xLZSyg3iIe_MjSMI3mESe2VK8wGJzu40rJ7F72fULBs,7139
|
|
5
5
|
kubectl_mcp_tool/diagnostics.py,sha256=uwolSoHadRkB-J8PAsabbexfj6sTNCIIRRrABBRXoTU,11776
|
|
6
6
|
kubectl_mcp_tool/k8s_config.py,sha256=tjP_VONsoqhd5qn0LPB25aKhiPw2qCYhJ_B52NbRYDo,15746
|
|
7
|
-
kubectl_mcp_tool/mcp_server.py,sha256
|
|
7
|
+
kubectl_mcp_tool/mcp_server.py,sha256=-p-r-NRaX6UiHUebvO4OIozRlA2PX851rmAlW_rO3Tk,31112
|
|
8
|
+
kubectl_mcp_tool/safety.py,sha256=7bx7tUH_hT4Y_eTnpH5knnHTsvnIZvI_0oo9MSBe_z8,5036
|
|
8
9
|
kubectl_mcp_tool/auth/__init__.py,sha256=ot8ivZZkDtV8Rg0y1UYruwobKCPyxX1svqh35wWxKvY,347
|
|
9
10
|
kubectl_mcp_tool/auth/config.py,sha256=wi3wuJNMyDqMeluDHL0MaJyedIFv5CFVxiUaEVaTvzk,2267
|
|
10
11
|
kubectl_mcp_tool/auth/scopes.py,sha256=KPmuGO0SrTkjzlElWFOV29ie9apTdMklOCkiA-965lI,6147
|
|
11
12
|
kubectl_mcp_tool/auth/verifier.py,sha256=ChZM-UsZJgZc3LjSfw8VfSydkKqKBZ1s8es71LlB_A0,2431
|
|
12
13
|
kubectl_mcp_tool/cli/__init__.py,sha256=NDd1-7_Ira9vx0uNVOUqhkK7S53IOTu0WUBWOKCtap8,1348
|
|
13
14
|
kubectl_mcp_tool/cli/__main__.py,sha256=OxhHqW8YsTd565acTDlZknljPAw6FN9JW7pNtgWIcFE,196
|
|
14
|
-
kubectl_mcp_tool/cli/cli.py,sha256=
|
|
15
|
+
kubectl_mcp_tool/cli/cli.py,sha256=vty-ooXE9lpi7BgIHmEsuUn3WYEiqlmPm6WIEmb9nYg,22510
|
|
15
16
|
kubectl_mcp_tool/cli/errors.py,sha256=nCvopWH9bt8wGRt6RTDoXo7IsKwsdwzRMvJ5OM2a1Eg,9018
|
|
16
|
-
kubectl_mcp_tool/cli/output.py,sha256=
|
|
17
|
-
kubectl_mcp_tool/
|
|
18
|
-
kubectl_mcp_tool/
|
|
17
|
+
kubectl_mcp_tool/cli/output.py,sha256=Ml14BadxgbOUpUZy_76lHrOxsxramvISgK_2Gney9lI,10558
|
|
18
|
+
kubectl_mcp_tool/config/__init__.py,sha256=1jk1JHO1Wpr7W9ISoJST8bZkm7B8ZAjVSQ3OoF9mZyw,961
|
|
19
|
+
kubectl_mcp_tool/config/loader.py,sha256=7HecHrQ-PvBad22954fqZqFLozpfhJ5BDspZWXBjOEg,12045
|
|
20
|
+
kubectl_mcp_tool/config/schema.py,sha256=Y4cvsHLXcTBpuWdobxDO5y4Ig8LiyeEgKd7wUZp4Rag,6103
|
|
21
|
+
kubectl_mcp_tool/observability/__init__.py,sha256=cNGHWjn7cAPHwI_0ZimcLUVQd5VMRKgcNnfkA6bj658,1469
|
|
22
|
+
kubectl_mcp_tool/observability/metrics.py,sha256=u2CbMTjceibz04f6o8l_iUmgMSfzX2EgnGCDS9FQbUY,5790
|
|
23
|
+
kubectl_mcp_tool/observability/stats.py,sha256=qbbWaKCuHm1nbTVF-AeIfBlhaITJuUCnv9IccpuRxgQ,7971
|
|
24
|
+
kubectl_mcp_tool/observability/tracing.py,sha256=DEziQN7WbR9taQ7vEo2yM3JtlHKXpLSyPNWjVh6SvUg,11162
|
|
25
|
+
kubectl_mcp_tool/prompts/__init__.py,sha256=ecxQuPcBKRaF8zbG5fkthrRXGhlSjORLVuk9hV4582g,1104
|
|
26
|
+
kubectl_mcp_tool/prompts/builtin.py,sha256=ET5KYqC-J3XwzVfesB7V6faLFSFlvvAqpT0gTuexRgk,20146
|
|
27
|
+
kubectl_mcp_tool/prompts/custom.py,sha256=ce4DmQLMh_UTKb4kbredekvvgI8GQWzuuB2H0P4JJAA,9214
|
|
28
|
+
kubectl_mcp_tool/prompts/prompts.py,sha256=ogDhU6FVsYIlig_QuIw-TblxR9GQJ3Xp8mJHLBcZ1z4,28263
|
|
19
29
|
kubectl_mcp_tool/resources/__init__.py,sha256=ERkn0ErlaGi9-dybv4wrAaT8WretvNp6K002h7Agjno,83
|
|
20
30
|
kubectl_mcp_tool/resources/resources.py,sha256=kvK4OM3Ox5cFvWDqJBTXOfBgnRYdoqdvvjsdCg0PJfY,12713
|
|
21
31
|
kubectl_mcp_tool/tools/__init__.py,sha256=DgFcaXxqMf7dgXcYWXl0-zKBJTUSF7Y__Cqsd79hRBA,1761
|
|
@@ -24,7 +34,7 @@ kubectl_mcp_tool/tools/browser.py,sha256=OvXUHzEuciRQInnwLLC16iObOOdniu09b9RT81y
|
|
|
24
34
|
kubectl_mcp_tool/tools/capi.py,sha256=mPCm6wUI3Sr5Mg9RjWSKBR5uwWn02Byyx42Cc1Fo7IE,25738
|
|
25
35
|
kubectl_mcp_tool/tools/certs.py,sha256=7Qdsx3IwCI3_mgcPrypzF6MFL5jZjKkVXsXUohAbfh8,25720
|
|
26
36
|
kubectl_mcp_tool/tools/cilium.py,sha256=ku5E-fQ9vS4MhSnaZA_rli6ebXXLCHBuKhZBrEo221c,19973
|
|
27
|
-
kubectl_mcp_tool/tools/cluster.py,sha256=
|
|
37
|
+
kubectl_mcp_tool/tools/cluster.py,sha256=DAA2NQyRmMtyBDgyYOgwaCEPl0jGL24HOH07ypiCOYw,35660
|
|
28
38
|
kubectl_mcp_tool/tools/core.py,sha256=67Cx1z4DqV0Qd26yXkF1eBXbUIlBB3Qj2W8rOInvb54,17801
|
|
29
39
|
kubectl_mcp_tool/tools/cost.py,sha256=fcFlIv-bsMdKESw-l-T6ECsUplDukNHaqM76JCYVHvQ,29629
|
|
30
40
|
kubectl_mcp_tool/tools/deployments.py,sha256=e138KV30DQhLCnvXntrofx1XdLH0dC0_mlODbzkluKk,18329
|
|
@@ -49,13 +59,17 @@ tests/conftest.py,sha256=6054YlpuGleV3Wg8BnVj4lnKWhGk-Eqc9JYTXxOmsXs,10782
|
|
|
49
59
|
tests/test_auth.py,sha256=PoESfWiN92wSGUdVwLL3Z1AP6C1zUsVmgTI7Q8ZdlxM,11074
|
|
50
60
|
tests/test_browser.py,sha256=6rB6Atqq3b2-xWnKzFdCVFHbF2Q3nt2Dy8Rp4ZwIgNk,20621
|
|
51
61
|
tests/test_cli.py,sha256=G-f9uByWooe-yUOH0ahBdoft4uz8TC0R0OzDs1Lom-4,10014
|
|
62
|
+
tests/test_config.py,sha256=9_A6_ntjvX556GvFvHGHuel1ERGo-WrbnFJX8OniUvg,12568
|
|
52
63
|
tests/test_ecosystem.py,sha256=SkxDWAASELIxzaYWu0d-Rw1HaKSSlyMMenwwF2HWvSA,13227
|
|
53
|
-
tests/
|
|
64
|
+
tests/test_mcp_integration.py,sha256=9ePvu1MJ0mTnMRFHthDwl3D2jyVPgQ1beUbchpT8Y3M,8782
|
|
65
|
+
tests/test_observability.py,sha256=m0m-uIQrE9OJ3FFls_rVZJst3NeAFKRtNUZohFpIZE4,17829
|
|
66
|
+
tests/test_prompts.py,sha256=VzZAXr5iFO-hG8kRwRnG4wom2LlqOmZ-SeW4d3HQ7hc,42888
|
|
54
67
|
tests/test_resources.py,sha256=Z0Ex8WdRz-B3VZa1s0eAaDDGbhy7dRdqy1uFVOe2Qbo,12689
|
|
68
|
+
tests/test_safety.py,sha256=5IOBQbcH2r8tANQD7ymsR6pBc6O50IspcFsuwrnwh1M,8292
|
|
55
69
|
tests/test_server.py,sha256=lLvgbqutnivSgQMNrki0O48whBQt0UXjdwT047nf0nw,14415
|
|
56
70
|
tests/test_tools.py,sha256=g3moVSpiFgqC107M4tBAQ6xU600rlYMPhnknyYhnTIc,34792
|
|
57
|
-
kubectl_mcp_server-1.
|
|
58
|
-
kubectl_mcp_server-1.
|
|
59
|
-
kubectl_mcp_server-1.
|
|
60
|
-
kubectl_mcp_server-1.
|
|
61
|
-
kubectl_mcp_server-1.
|
|
71
|
+
kubectl_mcp_server-1.17.0.dist-info/METADATA,sha256=EUwLkB1T8qDphYWRwKMaXiuw6BYDnQjBa21DTvnoRCc,38116
|
|
72
|
+
kubectl_mcp_server-1.17.0.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
73
|
+
kubectl_mcp_server-1.17.0.dist-info/entry_points.txt,sha256=zeOxQGaNC4r58deEmqsLCU5hfMjF0VqFUt9P5wWsKEM,109
|
|
74
|
+
kubectl_mcp_server-1.17.0.dist-info/top_level.txt,sha256=o5IpfOGG-lqU8rVWJeK9aYC0r4f6qEX09QiBhZlYbkQ,23
|
|
75
|
+
kubectl_mcp_server-1.17.0.dist-info/RECORD,,
|
kubectl_mcp_tool/__init__.py
CHANGED
|
@@ -7,7 +7,7 @@ with Kubernetes clusters through natural language commands.
|
|
|
7
7
|
For more information, see: https://github.com/rohitg00/kubectl-mcp-server
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
__version__ = "1.
|
|
10
|
+
__version__ = "1.17.0"
|
|
11
11
|
|
|
12
12
|
from .mcp_server import MCPServer
|
|
13
13
|
from .diagnostics import run_diagnostics, check_kubectl_installation, check_cluster_connection
|
kubectl_mcp_tool/cli/cli.py
CHANGED
|
@@ -37,6 +37,7 @@ from .output import (
|
|
|
37
37
|
format_error,
|
|
38
38
|
format_success,
|
|
39
39
|
)
|
|
40
|
+
from ..safety import SafetyMode, set_safety_mode, get_mode_info
|
|
40
41
|
|
|
41
42
|
# Logging setup
|
|
42
43
|
log_file = os.environ.get("MCP_LOG_FILE")
|
|
@@ -56,18 +57,49 @@ logging.basicConfig(
|
|
|
56
57
|
logger = logging.getLogger("kubectl-mcp-cli")
|
|
57
58
|
|
|
58
59
|
|
|
59
|
-
async def serve_stdio(
|
|
60
|
-
|
|
60
|
+
async def serve_stdio(
|
|
61
|
+
read_only: bool = False,
|
|
62
|
+
disable_destructive: bool = False,
|
|
63
|
+
config_file: Optional[str] = None,
|
|
64
|
+
):
|
|
65
|
+
server = MCPServer(
|
|
66
|
+
"kubernetes",
|
|
67
|
+
read_only=read_only,
|
|
68
|
+
disable_destructive=disable_destructive,
|
|
69
|
+
config_file=config_file,
|
|
70
|
+
)
|
|
61
71
|
await server.serve_stdio()
|
|
62
72
|
|
|
63
73
|
|
|
64
|
-
async def serve_sse(
|
|
65
|
-
|
|
74
|
+
async def serve_sse(
|
|
75
|
+
host: str,
|
|
76
|
+
port: int,
|
|
77
|
+
read_only: bool = False,
|
|
78
|
+
disable_destructive: bool = False,
|
|
79
|
+
config_file: Optional[str] = None,
|
|
80
|
+
):
|
|
81
|
+
server = MCPServer(
|
|
82
|
+
"kubernetes",
|
|
83
|
+
read_only=read_only,
|
|
84
|
+
disable_destructive=disable_destructive,
|
|
85
|
+
config_file=config_file,
|
|
86
|
+
)
|
|
66
87
|
await server.serve_sse(host=host, port=port)
|
|
67
88
|
|
|
68
89
|
|
|
69
|
-
async def serve_http(
|
|
70
|
-
|
|
90
|
+
async def serve_http(
|
|
91
|
+
host: str,
|
|
92
|
+
port: int,
|
|
93
|
+
read_only: bool = False,
|
|
94
|
+
disable_destructive: bool = False,
|
|
95
|
+
config_file: Optional[str] = None,
|
|
96
|
+
):
|
|
97
|
+
server = MCPServer(
|
|
98
|
+
"kubernetes",
|
|
99
|
+
read_only=read_only,
|
|
100
|
+
disable_destructive=disable_destructive,
|
|
101
|
+
config_file=config_file,
|
|
102
|
+
)
|
|
71
103
|
await server.serve_http(host=host, port=port)
|
|
72
104
|
|
|
73
105
|
|
|
@@ -282,12 +314,16 @@ def cmd_info(args):
|
|
|
282
314
|
except Exception:
|
|
283
315
|
pass
|
|
284
316
|
|
|
317
|
+
# Get safety mode info
|
|
318
|
+
mode_info = get_mode_info()
|
|
319
|
+
|
|
285
320
|
print(format_server_info(
|
|
286
321
|
version=__version__,
|
|
287
322
|
tool_count=len(tools),
|
|
288
323
|
resource_count=len(resources),
|
|
289
324
|
prompt_count=len(prompts),
|
|
290
325
|
context=context,
|
|
326
|
+
safety_mode=mode_info,
|
|
291
327
|
as_json=getattr(args, 'json', False)
|
|
292
328
|
))
|
|
293
329
|
return ErrorCode.SUCCESS
|
|
@@ -407,6 +443,16 @@ def cmd_doctor(args):
|
|
|
407
443
|
except ImportError:
|
|
408
444
|
checks.append({"name": "fastmcp", "status": "error", "details": "fastmcp not installed"})
|
|
409
445
|
|
|
446
|
+
# Check safety mode
|
|
447
|
+
mode_info = get_mode_info()
|
|
448
|
+
mode = mode_info.get("mode", "normal")
|
|
449
|
+
if mode == "normal":
|
|
450
|
+
checks.append({"name": "safety_mode", "status": "ok", "version": mode, "details": "All operations allowed"})
|
|
451
|
+
elif mode == "read_only":
|
|
452
|
+
checks.append({"name": "safety_mode", "status": "warning", "version": mode, "details": "Write operations blocked"})
|
|
453
|
+
else:
|
|
454
|
+
checks.append({"name": "safety_mode", "status": "warning", "version": mode, "details": "Destructive operations blocked"})
|
|
455
|
+
|
|
410
456
|
print(format_doctor_results(checks, as_json=getattr(args, 'json', False)))
|
|
411
457
|
|
|
412
458
|
# Return error code if any critical checks failed
|
|
@@ -453,6 +499,9 @@ Environment Variables:
|
|
|
453
499
|
)
|
|
454
500
|
serve_parser.add_argument("--host", type=str, default="0.0.0.0", help="Host for SSE/HTTP (default: 0.0.0.0)")
|
|
455
501
|
serve_parser.add_argument("--port", type=int, default=8000, help="Port for SSE/HTTP (default: 8000)")
|
|
502
|
+
serve_parser.add_argument("--config", type=str, default=None, help="Path to TOML configuration file")
|
|
503
|
+
serve_parser.add_argument("--read-only", action="store_true", help="Enable read-only mode (block all write operations)")
|
|
504
|
+
serve_parser.add_argument("--disable-destructive", action="store_true", help="Disable destructive operations (allow create/update, block delete)")
|
|
456
505
|
|
|
457
506
|
# version command (existing)
|
|
458
507
|
subparsers.add_parser("version", help="Show version")
|
|
@@ -507,12 +556,37 @@ Environment Variables:
|
|
|
507
556
|
|
|
508
557
|
try:
|
|
509
558
|
if args.command == "serve":
|
|
559
|
+
# Log safety mode (actual mode is applied in MCPServer)
|
|
560
|
+
if args.read_only:
|
|
561
|
+
logger.info("Starting server in READ-ONLY mode")
|
|
562
|
+
elif args.disable_destructive:
|
|
563
|
+
logger.info("Starting server with destructive operations disabled")
|
|
564
|
+
|
|
565
|
+
if args.config:
|
|
566
|
+
logger.info(f"Loading configuration from: {args.config}")
|
|
567
|
+
|
|
510
568
|
if args.transport == "stdio":
|
|
511
|
-
asyncio.run(serve_stdio(
|
|
569
|
+
asyncio.run(serve_stdio(
|
|
570
|
+
read_only=args.read_only,
|
|
571
|
+
disable_destructive=args.disable_destructive,
|
|
572
|
+
config_file=args.config,
|
|
573
|
+
))
|
|
512
574
|
elif args.transport == "sse":
|
|
513
|
-
asyncio.run(serve_sse(
|
|
575
|
+
asyncio.run(serve_sse(
|
|
576
|
+
host=args.host,
|
|
577
|
+
port=args.port,
|
|
578
|
+
read_only=args.read_only,
|
|
579
|
+
disable_destructive=args.disable_destructive,
|
|
580
|
+
config_file=args.config,
|
|
581
|
+
))
|
|
514
582
|
elif args.transport in ("http", "streamable-http"):
|
|
515
|
-
asyncio.run(serve_http(
|
|
583
|
+
asyncio.run(serve_http(
|
|
584
|
+
host=args.host,
|
|
585
|
+
port=args.port,
|
|
586
|
+
read_only=args.read_only,
|
|
587
|
+
disable_destructive=args.disable_destructive,
|
|
588
|
+
config_file=args.config,
|
|
589
|
+
))
|
|
516
590
|
|
|
517
591
|
elif args.command == "version":
|
|
518
592
|
from .. import __version__
|
kubectl_mcp_tool/cli/output.py
CHANGED
|
@@ -266,6 +266,7 @@ def format_server_info(
|
|
|
266
266
|
resource_count: int,
|
|
267
267
|
prompt_count: int,
|
|
268
268
|
context: Optional[str] = None,
|
|
269
|
+
safety_mode: Optional[Dict[str, Any]] = None,
|
|
269
270
|
as_json: bool = False
|
|
270
271
|
) -> str:
|
|
271
272
|
info = {
|
|
@@ -276,6 +277,9 @@ def format_server_info(
|
|
|
276
277
|
"k8s_context": context,
|
|
277
278
|
}
|
|
278
279
|
|
|
280
|
+
if safety_mode:
|
|
281
|
+
info["safety_mode"] = safety_mode
|
|
282
|
+
|
|
279
283
|
if as_json:
|
|
280
284
|
return json.dumps(info, indent=2)
|
|
281
285
|
|
|
@@ -291,6 +295,16 @@ def format_server_info(
|
|
|
291
295
|
if context:
|
|
292
296
|
lines.append(f" {cyan('K8s Context:')} {context}")
|
|
293
297
|
|
|
298
|
+
if safety_mode:
|
|
299
|
+
mode = safety_mode.get("mode", "normal")
|
|
300
|
+
if mode == "normal":
|
|
301
|
+
mode_str = green(mode)
|
|
302
|
+
elif mode == "read_only":
|
|
303
|
+
mode_str = yellow(mode) + " (write operations blocked)"
|
|
304
|
+
else:
|
|
305
|
+
mode_str = yellow(mode) + " (destructive operations blocked)"
|
|
306
|
+
lines.append(f" {cyan('Safety Mode:')} {mode_str}")
|
|
307
|
+
|
|
294
308
|
return "\n".join(lines)
|
|
295
309
|
|
|
296
310
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Configuration management for kubectl-mcp-server.
|
|
2
|
+
|
|
3
|
+
This module provides TOML-based configuration with:
|
|
4
|
+
- Main config file support
|
|
5
|
+
- Drop-in directory for modular configuration
|
|
6
|
+
- SIGHUP reload for runtime updates
|
|
7
|
+
- Environment variable overrides
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from .loader import (
|
|
11
|
+
Config,
|
|
12
|
+
load_config,
|
|
13
|
+
get_config,
|
|
14
|
+
reload_config,
|
|
15
|
+
get_config_paths,
|
|
16
|
+
setup_sighup_handler,
|
|
17
|
+
register_reload_callback,
|
|
18
|
+
unregister_reload_callback,
|
|
19
|
+
)
|
|
20
|
+
from .schema import (
|
|
21
|
+
ServerConfig,
|
|
22
|
+
SafetyConfig,
|
|
23
|
+
BrowserConfig,
|
|
24
|
+
MetricsConfig,
|
|
25
|
+
LoggingConfig,
|
|
26
|
+
validate_config,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
__all__ = [
|
|
30
|
+
# Config loading
|
|
31
|
+
"Config",
|
|
32
|
+
"load_config",
|
|
33
|
+
"get_config",
|
|
34
|
+
"reload_config",
|
|
35
|
+
"get_config_paths",
|
|
36
|
+
"setup_sighup_handler",
|
|
37
|
+
"register_reload_callback",
|
|
38
|
+
"unregister_reload_callback",
|
|
39
|
+
# Config schemas
|
|
40
|
+
"ServerConfig",
|
|
41
|
+
"SafetyConfig",
|
|
42
|
+
"BrowserConfig",
|
|
43
|
+
"MetricsConfig",
|
|
44
|
+
"LoggingConfig",
|
|
45
|
+
"validate_config",
|
|
46
|
+
]
|