initial server
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
from personal_mcp.skills.python_logging_dictconfig.server import (
|
||||
python_logging_dictconfig_server,
|
||||
)
|
||||
|
||||
__all__ = ["python_logging_dictconfig_server"]
|
||||
@@ -0,0 +1,7 @@
|
||||
id: python-logging-dictconfig
|
||||
name: Python Logging DictConfig
|
||||
description: Provide minimal logging.config.dictConfig setup guidance.
|
||||
tags:
|
||||
- logging
|
||||
- python
|
||||
- observability
|
||||
@@ -0,0 +1,30 @@
|
||||
from fastmcp import FastMCP
|
||||
|
||||
python_logging_dictconfig_server = FastMCP("python-logging-dictconfig")
|
||||
|
||||
|
||||
@python_logging_dictconfig_server.tool()
|
||||
def logging_dictconfig_template(level: str = "INFO") -> dict:
|
||||
"""Return a minimal dictConfig template for application startup."""
|
||||
normalized = level.upper()
|
||||
return {
|
||||
"version": 1,
|
||||
"disable_existing_loggers": False,
|
||||
"formatters": {
|
||||
"standard": {
|
||||
"format": "%(asctime)s %(levelname)s %(name)s: %(message)s",
|
||||
}
|
||||
},
|
||||
"handlers": {
|
||||
"console": {
|
||||
"class": "logging.StreamHandler",
|
||||
"level": normalized,
|
||||
"formatter": "standard",
|
||||
"stream": "ext://sys.stdout",
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"level": normalized,
|
||||
"handlers": ["console"],
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user