Skip to content

Fix mcp_data_dir instances#39

Merged
kevinbackhouse merged 1 commit intoGitHubSecurityLab:mainfrom
kevinbackhouse:mcp_data_dir
Feb 3, 2026
Merged

Fix mcp_data_dir instances#39
kevinbackhouse merged 1 commit intoGitHubSecurityLab:mainfrom
kevinbackhouse:mcp_data_dir

Conversation

@kevinbackhouse
Copy link
Copy Markdown
Contributor

I noticed that local_file_viewer.py wasn't working because it was looking for the zip file in the wrong directory. It's supposed to use the same directory as local_gh_resources.py. This bug doesn't happen if you explicitly set the LOCAL_GH_DIR environment variable, but it's a problem if you let mcp_data_dir use the default location.

ALERT_RESULTS_DIR has the same bug.

I accidentally introduced this bug in #11.

Copilot AI review requested due to automatic review settings February 3, 2026 17:30
Copy link
Copy Markdown
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 aims to fix directory/path handling for MCP data so that alert results and local GitHub ZIPs are consistently stored and consumed from the same locations across servers.

Changes:

  • Centralizes ALERT_RESULTS_DIR in alert_results_models and updates report_alert_state to use this shared directory instead of its own MEMORY path.
  • Makes local_file_viewer reuse LOCAL_GH_DIR from local_gh_resources, so it looks for repository ZIP files in the same directory as the fetcher.
  • Starts wiring gh_code_scanning to the shared ALERT_RESULTS_DIR constant, though a local definition still overrides it.

Reviewed changes

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

File Description
src/seclab_taskflows/mcp_servers/alert_results_models.py Introduces a shared ALERT_RESULTS_DIR (via mcp_data_dir) for alert results storage, to be reused by multiple MCP servers.
src/seclab_taskflows/mcp_servers/report_alert_state.py Switches the backend to use the shared ALERT_RESULTS_DIR from alert_results_models so alert state reads/writes from the common directory.
src/seclab_taskflows/mcp_servers/local_file_viewer.py Removes the per-module LOCAL_GH_DIR definition and instead relies on LOCAL_GH_DIR from local_gh_resources, aligning the viewer’s ZIP location with the fetcher.
src/seclab_taskflows/mcp_servers/gh_code_scanning.py Imports the shared ALERT_RESULTS_DIR constant for alert result persistence, though the existing local constant currently still overrides it.
Comments suppressed due to low confidence (1)

src/seclab_taskflows/mcp_servers/alert_results_models.py:7

  • log_file_name is imported but never used in this file; it should be removed to keep dependencies minimal and avoid confusion about logging behavior here.
from seclab_taskflow_agent.path_utils import mcp_data_dir, log_file_name

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

Comment thread src/seclab_taskflows/mcp_servers/local_file_viewer.py Outdated
Comment thread src/seclab_taskflows/mcp_servers/gh_code_scanning.py
Copilot AI review requested due to automatic review settings February 3, 2026 17:42
Copy link
Copy Markdown
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 6 out of 6 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/seclab_taskflows/mcp_servers/alert_results_models.py:7

  • log_file_name is imported here but never used in this module; consider removing it from the import to avoid an unused import and keep dependencies minimal.
from seclab_taskflow_agent.path_utils import mcp_data_dir, log_file_name

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

Comment thread src/seclab_taskflows/mcp_servers/report_alert_state.py Outdated
Copy link
Copy Markdown
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 6 out of 6 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

src/seclab_taskflows/mcp_servers/alert_results_models.py:7

  • log_file_name is imported but never used in this module; consider removing the unused import to keep dependencies minimal and avoid confusion about its purpose here.
from seclab_taskflow_agent.path_utils import mcp_data_dir, log_file_name

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

Comment thread src/seclab_taskflows/mcp_servers/local_file_viewer.py Outdated
Copilot AI review requested due to automatic review settings February 3, 2026 18:04
Copy link
Copy Markdown
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 6 out of 6 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/seclab_taskflows/mcp_servers/alert_results_models.py:7

  • log_file_name is imported but never used in this module; consider removing it from the import to avoid an unused-import warning and keep dependencies minimal.
from seclab_taskflow_agent.path_utils import mcp_data_dir, log_file_name

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

@kevinbackhouse kevinbackhouse marked this pull request as ready for review February 3, 2026 18:16
Copilot AI review requested due to automatic review settings February 3, 2026 18:16
Copy link
Copy Markdown
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 6 out of 6 changed files in this pull request and generated no new comments.


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

@kevinbackhouse kevinbackhouse merged commit 21404c9 into GitHubSecurityLab:main Feb 3, 2026
12 checks passed
@kevinbackhouse kevinbackhouse deleted the mcp_data_dir branch February 3, 2026 20:52
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.

3 participants