From 6589f7cfb9649da8e87fc1eb77015b965f249d14 Mon Sep 17 00:00:00 2001 From: Topher Lamey Date: Tue, 16 Sep 2025 09:57:39 -0600 Subject: [PATCH 1/7] Test using stdio --- Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 09fb2a4..1a6ecbb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,5 @@ WORKDIR /app COPY . . RUN pip install --no-cache-dir -r requirements.txt \ && pip install fastapi uvicorn -EXPOSE 8080 -# Default: run HTTP server -ENTRYPOINT ["uvicorn", "stackhawk_mcp.http_server:app", "--host", "0.0.0.0", "--port", "8080"] -# To run stdio: override entrypoint with -# docker run --entrypoint python ... -m stackhawk_mcp.server \ No newline at end of file + +ENTRYPOINT ["python", "-m", "stackhawk_mcp.server"] \ No newline at end of file From 00b3c44c9087b71e17d54434b3c014fa39ff327c Mon Sep 17 00:00:00 2001 From: Topher Lamey Date: Tue, 16 Sep 2025 10:14:58 -0600 Subject: [PATCH 2/7] Avoid extra output --- stackhawk_mcp/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackhawk_mcp/server.py b/stackhawk_mcp/server.py index 5810a8f..9f34707 100644 --- a/stackhawk_mcp/server.py +++ b/stackhawk_mcp/server.py @@ -50,7 +50,7 @@ def debug_print(message): """Print debug messages to stderr for Claude Desktop""" - print(f"[DEBUG] {message}", file=sys.stderr, flush=True) + " print(f"[DEBUG] {message}", file=sys.stderr, flush=True) class StackHawkClient: From 5e45b9c3ef44fcba98ec3728d66eccd24a6a0daa Mon Sep 17 00:00:00 2001 From: Topher Lamey Date: Tue, 16 Sep 2025 10:15:57 -0600 Subject: [PATCH 3/7] Fix comment typo --- stackhawk_mcp/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackhawk_mcp/server.py b/stackhawk_mcp/server.py index 9f34707..871e676 100644 --- a/stackhawk_mcp/server.py +++ b/stackhawk_mcp/server.py @@ -50,7 +50,7 @@ def debug_print(message): """Print debug messages to stderr for Claude Desktop""" - " print(f"[DEBUG] {message}", file=sys.stderr, flush=True) + """ print(f"[DEBUG] {message}", file=sys.stderr, flush=True) class StackHawkClient: From 7f54691528016a8a044d80470fab71d3daa8c2cf Mon Sep 17 00:00:00 2001 From: Topher Lamey Date: Tue, 16 Sep 2025 10:23:23 -0600 Subject: [PATCH 4/7] Fixing invalid character --- stackhawk_mcp/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackhawk_mcp/server.py b/stackhawk_mcp/server.py index 871e676..d3e35a7 100644 --- a/stackhawk_mcp/server.py +++ b/stackhawk_mcp/server.py @@ -1852,7 +1852,7 @@ def _get_stackhawk_scan_instructions(self, config_path: str = "stackhawk.yml") - ``` ## Viewing Results -1. When the scan finishes, you can triage and remediate findings directly from this LLM chat interface—just ask for open issues or help fixing vulnerabilities. +1. When the scan finishes, you can triage and remediate findings directly from this LLM chat interface. Just ask for open issues or help fixing vulnerabilities. 2. You can also check the StackHawk dashboard at https://app.stackhawk.com for a full view of your application and findings. ## Troubleshooting From a330ddfc85aa880346b4555cb168c6ef28562ad3 Mon Sep 17 00:00:00 2001 From: Topher Lamey Date: Tue, 16 Sep 2025 10:26:11 -0600 Subject: [PATCH 5/7] Fixing logger --- stackhawk_mcp/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackhawk_mcp/server.py b/stackhawk_mcp/server.py index d3e35a7..f84a904 100644 --- a/stackhawk_mcp/server.py +++ b/stackhawk_mcp/server.py @@ -50,7 +50,7 @@ def debug_print(message): """Print debug messages to stderr for Claude Desktop""" - """ print(f"[DEBUG] {message}", file=sys.stderr, flush=True) + logger.debug(f"{message}", file=sys.stderr, flush=True) class StackHawkClient: From 4a7d9f40c7e728d56508320dd5c5b84bae51d67d Mon Sep 17 00:00:00 2001 From: Topher Lamey Date: Fri, 19 Sep 2025 14:06:00 -0600 Subject: [PATCH 6/7] Stuff for anthropic registry --- README.md | 2 ++ server.json | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 server.json diff --git a/README.md b/README.md index 2e9f341..05d15e6 100644 --- a/README.md +++ b/README.md @@ -347,3 +347,5 @@ Workflows are designed to skip jobs if the latest commit is an automated version 2. Select the "Prepare Release" workflow. 3. Click "Run workflow" and choose the desired bump type (minor or major). 4. The workflow will handle the rest! + +[//]: # (mcp-name: stackhawk.com/stackhawk-mcp) \ No newline at end of file diff --git a/server.json b/server.json new file mode 100644 index 0000000..2d4a41b --- /dev/null +++ b/server.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json", + "name": "stackhawk.com/stackhawk-mcp", + "description": "An MCP server that provides interaction with StackHawk's security scanning platform.", + "status": "active", + "repository": { + "url": "https://github.com/stackhawk/stackhawk-mcp", + "source": "github" + }, + "version": "1.0.0", + "packages": [ + { + "registry_type": "pypi", + "registry_base_url": "https://pypi.org", + "identifier": "stackhawk-mcp", + "version": "1.0.0", + "transport": { + "type": "stdio" + }, + "environment_variables": [ + { + "description": "StackHawk API key", + "is_required": true, + "format": "string", + "is_secret": true, + "name": "STACKHAWK_API_KEY" + } + ] + } + ] +} From bb82d307ace898ef4e631ab83865f4d345e61a00 Mon Sep 17 00:00:00 2001 From: Topher Lamey Date: Fri, 19 Sep 2025 14:07:48 -0600 Subject: [PATCH 7/7] Go back to old stderr debug output --- stackhawk_mcp/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackhawk_mcp/server.py b/stackhawk_mcp/server.py index f84a904..a08d0cf 100644 --- a/stackhawk_mcp/server.py +++ b/stackhawk_mcp/server.py @@ -50,7 +50,7 @@ def debug_print(message): """Print debug messages to stderr for Claude Desktop""" - logger.debug(f"{message}", file=sys.stderr, flush=True) + print(f"[DEBUG] {message}", file=sys.stderr, flush=True) class StackHawkClient: