Skip to content

Add logging to MCP main functions#292

Open
ykd007 wants to merge 1 commit into
msoedov:mainfrom
ykd007:fix/mcp-type-hints-and-logging
Open

Add logging to MCP main functions#292
ykd007 wants to merge 1 commit into
msoedov:mainfrom
ykd007:fix/mcp-type-hints-and-logging

Conversation

@ykd007
Copy link
Copy Markdown
Contributor

@ykd007 ykd007 commented May 15, 2026

Picked up from issue #199.

The five tool functions in agentic_security/mcp/main.py had no logging at all, which made it hard to follow what was happening when running the MCP server in development or production.

Added a module-level logger = logging.getLogger(__name__) and two log calls per tool:

  • logger.debug right before the HTTP request, showing the target URL and key parameters
  • logger.info after the response comes back, recording the HTTP status code

The __main__ block now calls logging.basicConfig(level=logging.INFO) so the output is visible when the server is started directly with python -m agentic_security.mcp.main.

Closes #199

Each tool now logs at debug level before making the HTTP request and at
info level once the response status comes back. The __main__ block
initialises basicConfig so the logs are visible when running the server
directly.

Closes msoedov#199
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add logging to main MCP functions

1 participant