Skip to content

Conversation

@kevinbackhouse
Copy link
Collaborator

I'd like to remove the need to specify where each of the MCP servers should store its data (using an environment variable). It will be easier if they can automatically pick a default location. This PR adds a function called mcp_data_dir which does that. It uses platformdirs to create a directory in an appropriate location.

As an example, with this change the default location for the memcache MCP server is:

~/.local/share/seclab-taskflow-agent/seclab-taskflow-agent/memcache

Copilot AI review requested due to automatic review settings November 28, 2025 17:18
Copilot finished reviewing on behalf of kevinbackhouse November 28, 2025 17:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a utility function mcp_data_dir to automatically determine default data storage locations for MCP servers, eliminating the need for manual directory specification via environment variables. The implementation uses the platformdirs library to select appropriate cross-platform directories.

Key Changes:

  • Added mcp_data_dir() utility function in path_utils.py that leverages platformdirs for cross-platform directory selection
  • Updated three MCP servers (memcache, logbook, and codeql) to use the new utility while maintaining backwards compatibility via environment variable overrides
  • Added platformdirs 4.5.0 as a dependency

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/seclab_taskflow_agent/path_utils.py New utility module providing mcp_data_dir() function for standardized data directory management
src/seclab_taskflow_agent/mcp_servers/memcache/memcache.py Replaced manual path construction with mcp_data_dir() call for memcache data storage
src/seclab_taskflow_agent/mcp_servers/logbook/logbook.py Replaced manual path construction with mcp_data_dir() call for logbook data storage
src/seclab_taskflow_agent/mcp_servers/codeql/mcp_server.py Replaced manual path construction with mcp_data_dir() call for codeql database storage
pyproject.toml Added platformdirs 4.5.0 dependency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings November 28, 2025 17:49
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot finished reviewing on behalf of kevinbackhouse November 28, 2025 17:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

src/seclab_taskflow_agent/path_utils.py:4

  • Import of 'logging' is not used.
import logging

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 1, 2025 11:03
Copilot finished reviewing on behalf of kevinbackhouse December 1, 2025 11:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 1, 2025 12:24
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 1, 2025 12:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
kevinbackhouse and others added 2 commits December 1, 2025 12:44
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot finished reviewing on behalf of kevinbackhouse December 1, 2025 12:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kevinbackhouse
Copy link
Collaborator Author

@m-y-mo , @p-: Are you happy with this change?

@kevinbackhouse kevinbackhouse merged commit 3f840b2 into GitHubSecurityLab:main Dec 2, 2025
9 checks passed
@kevinbackhouse kevinbackhouse deleted the autogen-tmpdirs branch December 2, 2025 09:21
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.

2 participants