-
Notifications
You must be signed in to change notification settings - Fork 6
Add utility for generating data directories #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add utility for generating data directories #99
Conversation
There was a problem hiding this 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 inpath_utils.pythat 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>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this 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>
There was a problem hiding this 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>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this 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>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this 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.
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_dirwhich 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