From bb997dba792bcb9e6c9f8ea58145633179b11afd Mon Sep 17 00:00:00 2001 From: KC Berg Date: Mon, 7 Jul 2025 17:18:07 -0600 Subject: [PATCH 01/12] WIP: support for configurable base url --- stackhawk_mcp/http_server.py | 3 ++- stackhawk_mcp/server.py | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/stackhawk_mcp/http_server.py b/stackhawk_mcp/http_server.py index 8e9dc1c..261afb4 100644 --- a/stackhawk_mcp/http_server.py +++ b/stackhawk_mcp/http_server.py @@ -21,9 +21,10 @@ # Get API key from environment API_KEY = os.environ.get("STACKHAWK_API_KEY", "changeme") +BASE_URL = os.environ.get("STACKHAWK_BASE_URL", "https://api.stackhawk.com") # Create the MCP server instance -mcp_server = StackHawkMCPServer(api_key=API_KEY) +mcp_server = StackHawkMCPServer(api_key=API_KEY, base_url=BASE_URL) # Store active SSE connections active_connections = {} diff --git a/stackhawk_mcp/server.py b/stackhawk_mcp/server.py index 1140236..4be5160 100644 --- a/stackhawk_mcp/server.py +++ b/stackhawk_mcp/server.py @@ -597,9 +597,9 @@ async def _get_application_vulnerabilities(self, app_id: str = None, severity_fi class StackHawkMCPServer: """StackHawk MCP Server implementation""" - def __init__(self, api_key: str): + def __init__(self, api_key: str, base_url: str = "https://api.stackhawk.com"): debug_print("Initializing StackHawkMCPServer...") - self.client = StackHawkClient(api_key) + self.client = StackHawkClient(api_key, base_url) self.server = Server("stackhawk-mcp") self._schema_cache: Optional[Dict[str, Any]] = None self._schema_cache_time: Optional[datetime] = None @@ -2380,16 +2380,18 @@ async def main(): import os api_key = os.environ.get("STACKHAWK_API_KEY") + base_url = os.environ.get("STACKHAWK_BASE_URL", "https://api.stackhawk.com") if not api_key: debug_print("ERROR: STACKHAWK_API_KEY environment variable is required") sys.exit(1) debug_print(f"API key found: {api_key[:20]}...") + debug_print(f"Base URL: {base_url}") server = None try: debug_print("Creating StackHawkMCPServer...") - server = StackHawkMCPServer(api_key) + server = StackHawkMCPServer(api_key, base_url) debug_print("Running server...") await server.run() except KeyboardInterrupt: From ba482afa5c2dee5d3ebe14fc87c327c169eb05e1 Mon Sep 17 00:00:00 2001 From: KC Berg Date: Mon, 7 Jul 2025 17:19:47 -0600 Subject: [PATCH 02/12] docs: add local install instructions using pip install --user . --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 99daddb..6a211ec 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,12 @@ A Model Context Protocol (MCP) server for integrating with StackHawk's security pip install stackhawk-mcp # Requires Python 3.10 or higher ``` -2. **Set your StackHawk API key:** +2. **Install locally from the repo:** + ```bash + pip install --user . + # Run this command from the root of the cloned repository + ``` +3. **Set your StackHawk API key:** ```bash export STACKHAWK_API_KEY="your-api-key-here" ``` From 15ad5f0aed7d3ff5294831a5b0d9f0774610bef9 Mon Sep 17 00:00:00 2001 From: KC Berg Date: Tue, 8 Jul 2025 09:00:06 -0600 Subject: [PATCH 03/12] chore: add new files --- .github/CODEOWNERS | 1 + .github/pull_request_template.md | 37 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/pull_request_template.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..595903f --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @stackhawk/engineering \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..9deb86b --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,37 @@ +## StackHawk Pull Request + +> Description here + + +![replace me](giphy-url.gif) + +### Type of change + +- [x] Code +- [ ] Documentation +- [ ] Release +- [ ] Other _(please explain)_ + +### Related Issues + + +> [NGNRNG-XXX](https://stackhawk.atlassian.net/browse/NGNRNG-XXX) + +### Code + +- [ ] This PR has a descriptive title, attached issue id, and information useful to a reviewer +- [ ] The "Ready for Review" label attached to the PR, and reviewers have been informed +- [ ] All lint rules and tests related to the changed code pass locally + +Did you add or update tests to cover this change? +- [ ] Yes +- [ ] No: _(please explain)_ + +### Documentation + +- [ ] Documentation has been updated, with attention to spelling, grammar and clarity + +### Release + +- [ ] This software deployment has been communicated to the team +- [ ] Relevant changes are reflected in the product changelog From 3b3fb8d1de412589292422fdc5e548c94044f378 Mon Sep 17 00:00:00 2001 From: Scott Gerlach Date: Tue, 8 Jul 2025 15:39:32 -0600 Subject: [PATCH 04/12] fixes some build and pipx problems --- pyproject.toml | 9 +- server.json | 277 ++++++++++++++++++++++++++++++++++++++ stackhawk_mcp/__main__.py | 8 ++ 3 files changed, 291 insertions(+), 3 deletions(-) create mode 100644 server.json create mode 100644 stackhawk_mcp/__main__.py diff --git a/pyproject.toml b/pyproject.toml index 1a45d7c..cb7f464 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "stackhawk-mcp" version = "0.1.0" description = "StackHawk MCP Server for Security Analytics and Developer Integration" authors = [{name = "StackHawk, Inc.", email = "support@stackhawk.com"}] -license = {text = "Apache-2.0"} +license = "Apache-2.0" readme = "README.md" requires-python = ">=3.10" dependencies = [ @@ -27,7 +27,7 @@ dev = [ ] [project.scripts] -stackhawk-mcp = "stackhawk_mcp.server:main" +stackhawk-mcp = "stackhawk_mcp.__main__:cli" [project.urls] Homepage = "https://github.com/stackhawk/stackhawk-mcp" @@ -45,4 +45,7 @@ disallow_untyped_defs = true [tool.pytest.ini_options] asyncio_mode = "auto" -testpaths = ["tests"] \ No newline at end of file +testpaths = ["tests"] + +[tool.setuptools.packages.find] +include = ["stackhawk_mcp*"] \ No newline at end of file diff --git a/server.json b/server.json new file mode 100644 index 0000000..190c6ed --- /dev/null +++ b/server.json @@ -0,0 +1,277 @@ +{ + "name": "stackhawk-mcp", + "displayName": "StackHawk MCP Server", + "description": "Model Context Protocol (MCP) server that integrates StackHawk security analytics, YAML configuration management, sensitive data/threat surface analysis, and anti-hallucination tools into IDEs, LLMs, and developer workflows.", + "version": "0.1.0", + "author": { + "name": "StackHawk", + "email": "support@stackhawk.com", + "url": "https://www.stackhawk.com" + }, + "repository": { + "type": "git", + "url": "https://github.com/stackhawk/stackhawk-mcp" + }, + "license": "Apache-2.0", + "categories": [ + "security", + "devops", + "developer-tools" + ], + "keywords": [ + "mcp", + "stackhawk", + "security", + "vulnerability", + "api-security", + "developer-tools" + ], + "server": { + "executable": "python", + "args": [ + "-m", + "stackhawk_mcp.server" + ], + "env": { + "STACKHAWK_API_KEY": "" + }, + "transport": "stdio", + "installation": { + "pip": "stackhawk-mcp>=0.1.0" + } + }, + "capabilities": { + "resources": [ + { + "uri": "stackhawk://auth/user", + "name": "Current User", + "description": "Information about the authenticated user and their organizations.", + "mimeType": "application/json" + }, + { + "uri": "stackhawk://applications", + "name": "Applications Overview", + "description": "Overview of all applications accessible to the authenticated user.", + "mimeType": "application/json" + }, + { + "uri": "stackhawk://vulnerabilities/summary", + "name": "Vulnerability Summary", + "description": "High-level vulnerability metrics and severity breakdown.", + "mimeType": "application/json" + } + ], + "tools": [ + { + "name": "get_organization_info", + "description": "Retrieve detailed information about a StackHawk organization.", + "inputSchema": { + "type": "object", + "properties": { + "org_id": { "type": "string" } + }, + "required": ["org_id"] + } + }, + { + "name": "list_applications", + "description": "List applications for an organization.", + "inputSchema": { + "type": "object", + "properties": { + "org_id": { "type": "string" }, + "query": { "type": "string" }, + "page_size": { "type": "integer" } + }, + "required": ["org_id"] + } + }, + { + "name": "search_vulnerabilities", + "description": "Search for vulnerabilities by severity.", + "inputSchema": { + "type": "object", + "properties": { + "org_id": { "type": "string" }, + "severity": { + "type": "string", + "enum": ["High", "Medium", "Low"] + } + }, + "required": ["org_id"] + } + }, + { + "name": "generate_security_dashboard", + "description": "Generate an executive security dashboard.", + "inputSchema": { + "type": "object", + "properties": { + "org_id": { "type": "string" } + }, + "required": ["org_id"] + } + }, + { + "name": "create_stackhawk_config", + "description": "Create a StackHawk configuration file.", + "inputSchema": { + "type": "object", + "properties": { + "project_name": { "type": "string" }, + "environment": { "type": "string" } + }, + "required": ["project_name"] + } + }, + { + "name": "validate_field_exists", + "description": "Validate whether a field exists in the StackHawk YAML schema to prevent LLM hallucination and ensure schema compliance.", + "inputSchema": { + "type": "object", + "properties": { + "field_path": { "type": "string" } + }, + "required": ["field_path"] + } + }, + { + "name": "validate_stackhawk_config", + "description": "Validate a StackHawk YAML configuration for correctness, schema compliance, and best practices.", + "inputSchema": { + "type": "object", + "properties": { + "config_content": { "type": "string" } + }, + "required": ["config_content"] + } + }, + { + "name": "get_stackhawk_schema", + "description": "Retrieve the configuration schema definition.", + "inputSchema": { + "type": "object", + "properties": {} + } + }, + { + "name": "get_sensitive_data", + "description": "Retrieve sensitive data from scans.", + "inputSchema": { + "type": "object", + "properties": { + "app_id": { "type": "string" } + }, + "required": ["app_id"] + } + }, + { + "name": "map_sensitive_data_surface", + "description": "Map sensitive data surfaces across the organization.", + "inputSchema": { + "type": "object", + "properties": { + "org_id": { "type": "string" } + }, + "required": ["org_id"] + } + }, + { + "name": "setup_stackhawk_for_project", + "description": "Set up StackHawk scanning for a project.", + "inputSchema": { + "type": "object", + "properties": { + "project_name": { "type": "string" } + }, + "required": ["project_name"] + } + }, + { + "name": "get_stackhawk_scan_instructions", + "description": "Retrieve instructions to run a StackHawk scan.", + "inputSchema": { + "type": "object", + "properties": { + "config_path": { "type": "string" } + } + } + }, + { + "name": "run_stackhawk_scan", + "description": "Run a StackHawk scan on the specified configuration.", + "inputSchema": { + "type": "object", + "properties": { + "config_path": { "type": "string" } + } + } + }, + { + "name": "get_app_findings_for_triage", + "description": "Retrieve findings for triage for an application.", + "inputSchema": { + "type": "object", + "properties": { + "app_id": { "type": "string" }, + "config_path": { "type": "string" }, + "config_content": { "type": "string" } + }, + "required": ["app_id"] + } + }, + { + "name": "get_sensitive_data_report", + "description": "Get a report of sensitive data findings.", + "inputSchema": { + "type": "object", + "properties": { + "org_id": { "type": "string" } + }, + "required": ["org_id"] + } + }, + { + "name": "analyze_sensitive_data_trends", + "description": "Analyze sensitive data exposure trends.", + "inputSchema": { + "type": "object", + "properties": { + "org_id": { "type": "string" }, + "time_range": { "type": "string" } + }, + "required": ["org_id"] + } + }, + { + "name": "get_critical_sensitive_data", + "description": "Retrieve critical severity sensitive data findings.", + "inputSchema": { + "type": "object", + "properties": { + "org_id": { "type": "string" } + }, + "required": ["org_id"] + } + }, + { + "name": "generate_sensitive_data_summary", + "description": "Generate a summary report of sensitive data.", + "inputSchema": { + "type": "object", + "properties": { + "org_id": { "type": "string" } + }, + "required": ["org_id"] + } + } + ] + }, + "documentation": { + "homepage": "https://www.stackhawk.com", + "gettingStarted": "https://pypi.org/project/stackhawk-mcp/0.1.0/", + "readme": "https://github.com/stackhawk/stackhawk-mcp#readme", + "icon": "https://www.stackhawk.com/favicon-32x32.png" + } + } + \ No newline at end of file diff --git a/stackhawk_mcp/__main__.py b/stackhawk_mcp/__main__.py new file mode 100644 index 0000000..a77ad57 --- /dev/null +++ b/stackhawk_mcp/__main__.py @@ -0,0 +1,8 @@ +import asyncio +from .server import main + +def cli(): + asyncio.run(main()) + +if __name__ == "__main__": + cli() \ No newline at end of file From 0b9b5eee46faa270c5acd22cc741755111b4725d Mon Sep 17 00:00:00 2001 From: KC Berg Date: Tue, 8 Jul 2025 15:40:27 -0600 Subject: [PATCH 05/12] chore: prepare for bumpver test (local only) --- .bumpver.toml | 32 +++++++++++++++++++++ .github/workflows/ci.yml | 46 +++++++++++++++++++++++++++++- .github/workflows/publish-pypi.yml | 13 ++++++++- README.md | 2 +- requirements.txt | 1 + stackhawk-mcp.dxt | 2 +- stackhawk_mcp/http_server.py | 7 +++-- stackhawk_mcp/server.py | 3 +- 8 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 .bumpver.toml diff --git a/.bumpver.toml b/.bumpver.toml new file mode 100644 index 0000000..8ae8153 --- /dev/null +++ b/.bumpver.toml @@ -0,0 +1,32 @@ +[bumpver] +current_version = "0.1.0" +version_pattern = "MAJOR.MINOR.PATCH" +commit_message = "bump: version {old_version} → {new_version}" +tag_message = "v{new_version}" +tag_scope = "default" + +[bumpver.file_patterns] +# pyproject.toml +"pyproject.toml" = [ + 'version = "{version}"' +] +# Python package __init__ +"stackhawk_mcp/__init__.py" = [ + '__version__ = "{version}"' +] +# Server version constant +"stackhawk_mcp/server.py" = [ + 'STACKHAWK_MCP_VERSION = "{version}"' +] +# HTTP server version in JSON +"stackhawk_mcp/http_server.py" = [ + '"version": "{version}"' +] +# README version badge or text +"README.md" = [ + '**Current Version: {version}**' +] +# DXT file version +"stackhawk-mcp.dxt" = [ + '"version": "{version}"' +] \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f0a651..504bf55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,4 +25,48 @@ jobs: pip install . - name: Run tests run: | - pytest --maxfail=1 --disable-warnings \ No newline at end of file + pytest --maxfail=1 --disable-warnings + + tag-version: + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Get version from pyproject.toml + id: get_version + run: | + VERSION=$(grep '^version = ' pyproject.toml | head -1 | cut -d '"' -f2) + echo "::set-output name=version::$VERSION" + - name: Create and push tag for current version + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag v${{ steps.get_version.outputs.version }} + git push origin v${{ steps.get_version.outputs.version }} + + bump-version: + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + needs: [test, tag-version] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install bumpver + run: | + python -m pip install --upgrade pip + pip install bumpver + - name: Bump patch version with bumpver + run: bumpver update --patch --no-tag --commit + - name: Push version bump commit + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git push \ No newline at end of file diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index d07e48c..528cc7b 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -16,6 +16,8 @@ jobs: environment: pypi steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v5 with: @@ -23,7 +25,16 @@ jobs: - name: Install build dependencies run: | python -m pip install --upgrade pip - pip install build + pip install build bumpver + - name: Bump minor version with bumpver + if: github.ref == 'refs/heads/main' + run: bumpver update --minor --no-tag --commit + - name: Push version bump commit + if: github.ref == 'refs/heads/main' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git push - name: Build package run: | python -m build diff --git a/README.md b/README.md index 6a211ec..2bfe097 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # StackHawk MCP Server -**Current Version: 0.1.0** +**Current Version: {version}** _Requires Python 3.10 or higher_ A Model Context Protocol (MCP) server for integrating with StackHawk's security scanning platform. Provides security analytics, YAML configuration management, sensitive data/threat surface analysis, and anti-hallucination tools for LLMs. diff --git a/requirements.txt b/requirements.txt index 0dfee06..0c525c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,6 +12,7 @@ pytest>=7.0.0 pytest-asyncio>=0.21.0 black>=23.0.0 mypy>=1.0.0 +bumpver>=2023.1129 # FastAPI dependencies fastapi diff --git a/stackhawk-mcp.dxt b/stackhawk-mcp.dxt index e0cf4ff..951406a 100644 --- a/stackhawk-mcp.dxt +++ b/stackhawk-mcp.dxt @@ -1,7 +1,7 @@ { "name": "stackhawk-mcp", "description": "StackHawk MCP Server for security testing, analytics, YAML validation, and vulnerability management.", - "version": "1.0.0", + "version": "{version}", "author": "StackHawk", "license": "MIT", "homepage": "https://github.com/stackhawk/stackhawk-mcp", diff --git a/stackhawk_mcp/http_server.py b/stackhawk_mcp/http_server.py index 261afb4..f630037 100644 --- a/stackhawk_mcp/http_server.py +++ b/stackhawk_mcp/http_server.py @@ -7,6 +7,7 @@ import uvicorn import asyncio from stackhawk_mcp.server import StackHawkMCPServer +from stackhawk_mcp import __version__ app = FastAPI() @@ -71,7 +72,7 @@ async def handle_initialize_request(request_data): }, "serverInfo": { "name": "StackHawk MCP", - "version": "0.1.0" + "version": __version__ } } ) @@ -237,7 +238,7 @@ async def root(): "id": 1, "result": { "serverName": "StackHawk MCP", - "serverVersion": "0.1.0", + "serverVersion": __version__, "protocolVersion": "v1" } }) @@ -249,7 +250,7 @@ async def root_post(): "id": 1, "result": { "serverName": "StackHawk MCP", - "serverVersion": "0.1.0", + "serverVersion": __version__, "protocolVersion": "v1" } }) diff --git a/stackhawk_mcp/server.py b/stackhawk_mcp/server.py index 4be5160..5810a8f 100644 --- a/stackhawk_mcp/server.py +++ b/stackhawk_mcp/server.py @@ -35,6 +35,7 @@ ) import mcp.server.stdio import mcp.types as types +from stackhawk_mcp import __version__ # Configure logging to stderr so Claude Desktop can see it logging.basicConfig( @@ -44,7 +45,7 @@ ) logger = logging.getLogger("stackhawk-mcp") -STACKHAWK_MCP_VERSION = "0.1.0" +STACKHAWK_MCP_VERSION = __version__ def debug_print(message): From a6eab0c6c36de7dd1cdc74ccdf36ef753ccb55ec Mon Sep 17 00:00:00 2001 From: KC Berg Date: Tue, 8 Jul 2025 15:42:46 -0600 Subject: [PATCH 06/12] chore: local changes before pull --- pyproject.toml | 2 +- stackhawk_mcp/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1a45d7c..6c22ce7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "stackhawk-mcp" -version = "0.1.0" +version = "0.1.1" description = "StackHawk MCP Server for Security Analytics and Developer Integration" authors = [{name = "StackHawk, Inc.", email = "support@stackhawk.com"}] license = {text = "Apache-2.0"} diff --git a/stackhawk_mcp/__init__.py b/stackhawk_mcp/__init__.py index 4102c2d..694686e 100644 --- a/stackhawk_mcp/__init__.py +++ b/stackhawk_mcp/__init__.py @@ -5,6 +5,6 @@ with the StackHawk API through the Model Context Protocol (MCP). """ -__version__ = "0.1.0" +__version__ = "0.1.1" __author__ = "StackHawk MCP Team" __email__ = "support@stackhawk.com" \ No newline at end of file From 9f5cad984105d1716ccb675962cb86b44ee4f910 Mon Sep 17 00:00:00 2001 From: KC Berg Date: Tue, 8 Jul 2025 15:44:21 -0600 Subject: [PATCH 07/12] fix: remove server.py from bumpver patterns --- .bumpver.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.bumpver.toml b/.bumpver.toml index 8ae8153..841ed6c 100644 --- a/.bumpver.toml +++ b/.bumpver.toml @@ -14,10 +14,6 @@ tag_scope = "default" "stackhawk_mcp/__init__.py" = [ '__version__ = "{version}"' ] -# Server version constant -"stackhawk_mcp/server.py" = [ - 'STACKHAWK_MCP_VERSION = "{version}"' -] # HTTP server version in JSON "stackhawk_mcp/http_server.py" = [ '"version": "{version}"' From 80b2f96786b9d580591eae0e81848386fb9416cf Mon Sep 17 00:00:00 2001 From: KC Berg Date: Tue, 8 Jul 2025 15:44:52 -0600 Subject: [PATCH 08/12] fix: remove http_server.py from bumpver patterns --- .bumpver.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.bumpver.toml b/.bumpver.toml index 841ed6c..1bb576a 100644 --- a/.bumpver.toml +++ b/.bumpver.toml @@ -14,10 +14,6 @@ tag_scope = "default" "stackhawk_mcp/__init__.py" = [ '__version__ = "{version}"' ] -# HTTP server version in JSON -"stackhawk_mcp/http_server.py" = [ - '"version": "{version}"' -] # README version badge or text "README.md" = [ '**Current Version: {version}**' From 226a21265f278fbfff96e2a1ac6d17c5c4602151 Mon Sep 17 00:00:00 2001 From: KC Berg Date: Tue, 8 Jul 2025 15:45:25 -0600 Subject: [PATCH 09/12] fix: restore version numbers for bumpver compatibility --- README.md | 2 +- stackhawk-mcp.dxt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2bfe097..6a211ec 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # StackHawk MCP Server -**Current Version: {version}** +**Current Version: 0.1.0** _Requires Python 3.10 or higher_ A Model Context Protocol (MCP) server for integrating with StackHawk's security scanning platform. Provides security analytics, YAML configuration management, sensitive data/threat surface analysis, and anti-hallucination tools for LLMs. diff --git a/stackhawk-mcp.dxt b/stackhawk-mcp.dxt index 951406a..0a2ffa9 100644 --- a/stackhawk-mcp.dxt +++ b/stackhawk-mcp.dxt @@ -1,7 +1,7 @@ { "name": "stackhawk-mcp", "description": "StackHawk MCP Server for security testing, analytics, YAML validation, and vulnerability management.", - "version": "{version}", + "version": "0.1.0", "author": "StackHawk", "license": "MIT", "homepage": "https://github.com/stackhawk/stackhawk-mcp", From ab2909917b37e216273e301dc0687d221e987d8c Mon Sep 17 00:00:00 2001 From: KC Berg Date: Tue, 8 Jul 2025 15:45:28 -0600 Subject: [PATCH 10/12] =?UTF-8?q?bump:=20version=200.1.0=20=E2=86=92=200.1?= =?UTF-8?q?.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpver.toml | 2 +- README.md | 2 +- stackhawk-mcp.dxt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpver.toml b/.bumpver.toml index 1bb576a..db6fe6f 100644 --- a/.bumpver.toml +++ b/.bumpver.toml @@ -1,5 +1,5 @@ [bumpver] -current_version = "0.1.0" +current_version = "0.1.1" version_pattern = "MAJOR.MINOR.PATCH" commit_message = "bump: version {old_version} → {new_version}" tag_message = "v{new_version}" diff --git a/README.md b/README.md index 6a211ec..9cf0920 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # StackHawk MCP Server -**Current Version: 0.1.0** +**Current Version: 0.1.1** _Requires Python 3.10 or higher_ A Model Context Protocol (MCP) server for integrating with StackHawk's security scanning platform. Provides security analytics, YAML configuration management, sensitive data/threat surface analysis, and anti-hallucination tools for LLMs. diff --git a/stackhawk-mcp.dxt b/stackhawk-mcp.dxt index 0a2ffa9..e56dda6 100644 --- a/stackhawk-mcp.dxt +++ b/stackhawk-mcp.dxt @@ -1,7 +1,7 @@ { "name": "stackhawk-mcp", "description": "StackHawk MCP Server for security testing, analytics, YAML validation, and vulnerability management.", - "version": "0.1.0", + "version": "0.1.1", "author": "StackHawk", "license": "MIT", "homepage": "https://github.com/stackhawk/stackhawk-mcp", From 8c12d340dba1b91f66656d9013d101261c44a296 Mon Sep 17 00:00:00 2001 From: KC Berg Date: Tue, 8 Jul 2025 15:50:44 -0600 Subject: [PATCH 11/12] chore: remove unused server.json metadata file --- server.json | 277 ---------------------------------------------------- 1 file changed, 277 deletions(-) delete mode 100644 server.json diff --git a/server.json b/server.json deleted file mode 100644 index 190c6ed..0000000 --- a/server.json +++ /dev/null @@ -1,277 +0,0 @@ -{ - "name": "stackhawk-mcp", - "displayName": "StackHawk MCP Server", - "description": "Model Context Protocol (MCP) server that integrates StackHawk security analytics, YAML configuration management, sensitive data/threat surface analysis, and anti-hallucination tools into IDEs, LLMs, and developer workflows.", - "version": "0.1.0", - "author": { - "name": "StackHawk", - "email": "support@stackhawk.com", - "url": "https://www.stackhawk.com" - }, - "repository": { - "type": "git", - "url": "https://github.com/stackhawk/stackhawk-mcp" - }, - "license": "Apache-2.0", - "categories": [ - "security", - "devops", - "developer-tools" - ], - "keywords": [ - "mcp", - "stackhawk", - "security", - "vulnerability", - "api-security", - "developer-tools" - ], - "server": { - "executable": "python", - "args": [ - "-m", - "stackhawk_mcp.server" - ], - "env": { - "STACKHAWK_API_KEY": "" - }, - "transport": "stdio", - "installation": { - "pip": "stackhawk-mcp>=0.1.0" - } - }, - "capabilities": { - "resources": [ - { - "uri": "stackhawk://auth/user", - "name": "Current User", - "description": "Information about the authenticated user and their organizations.", - "mimeType": "application/json" - }, - { - "uri": "stackhawk://applications", - "name": "Applications Overview", - "description": "Overview of all applications accessible to the authenticated user.", - "mimeType": "application/json" - }, - { - "uri": "stackhawk://vulnerabilities/summary", - "name": "Vulnerability Summary", - "description": "High-level vulnerability metrics and severity breakdown.", - "mimeType": "application/json" - } - ], - "tools": [ - { - "name": "get_organization_info", - "description": "Retrieve detailed information about a StackHawk organization.", - "inputSchema": { - "type": "object", - "properties": { - "org_id": { "type": "string" } - }, - "required": ["org_id"] - } - }, - { - "name": "list_applications", - "description": "List applications for an organization.", - "inputSchema": { - "type": "object", - "properties": { - "org_id": { "type": "string" }, - "query": { "type": "string" }, - "page_size": { "type": "integer" } - }, - "required": ["org_id"] - } - }, - { - "name": "search_vulnerabilities", - "description": "Search for vulnerabilities by severity.", - "inputSchema": { - "type": "object", - "properties": { - "org_id": { "type": "string" }, - "severity": { - "type": "string", - "enum": ["High", "Medium", "Low"] - } - }, - "required": ["org_id"] - } - }, - { - "name": "generate_security_dashboard", - "description": "Generate an executive security dashboard.", - "inputSchema": { - "type": "object", - "properties": { - "org_id": { "type": "string" } - }, - "required": ["org_id"] - } - }, - { - "name": "create_stackhawk_config", - "description": "Create a StackHawk configuration file.", - "inputSchema": { - "type": "object", - "properties": { - "project_name": { "type": "string" }, - "environment": { "type": "string" } - }, - "required": ["project_name"] - } - }, - { - "name": "validate_field_exists", - "description": "Validate whether a field exists in the StackHawk YAML schema to prevent LLM hallucination and ensure schema compliance.", - "inputSchema": { - "type": "object", - "properties": { - "field_path": { "type": "string" } - }, - "required": ["field_path"] - } - }, - { - "name": "validate_stackhawk_config", - "description": "Validate a StackHawk YAML configuration for correctness, schema compliance, and best practices.", - "inputSchema": { - "type": "object", - "properties": { - "config_content": { "type": "string" } - }, - "required": ["config_content"] - } - }, - { - "name": "get_stackhawk_schema", - "description": "Retrieve the configuration schema definition.", - "inputSchema": { - "type": "object", - "properties": {} - } - }, - { - "name": "get_sensitive_data", - "description": "Retrieve sensitive data from scans.", - "inputSchema": { - "type": "object", - "properties": { - "app_id": { "type": "string" } - }, - "required": ["app_id"] - } - }, - { - "name": "map_sensitive_data_surface", - "description": "Map sensitive data surfaces across the organization.", - "inputSchema": { - "type": "object", - "properties": { - "org_id": { "type": "string" } - }, - "required": ["org_id"] - } - }, - { - "name": "setup_stackhawk_for_project", - "description": "Set up StackHawk scanning for a project.", - "inputSchema": { - "type": "object", - "properties": { - "project_name": { "type": "string" } - }, - "required": ["project_name"] - } - }, - { - "name": "get_stackhawk_scan_instructions", - "description": "Retrieve instructions to run a StackHawk scan.", - "inputSchema": { - "type": "object", - "properties": { - "config_path": { "type": "string" } - } - } - }, - { - "name": "run_stackhawk_scan", - "description": "Run a StackHawk scan on the specified configuration.", - "inputSchema": { - "type": "object", - "properties": { - "config_path": { "type": "string" } - } - } - }, - { - "name": "get_app_findings_for_triage", - "description": "Retrieve findings for triage for an application.", - "inputSchema": { - "type": "object", - "properties": { - "app_id": { "type": "string" }, - "config_path": { "type": "string" }, - "config_content": { "type": "string" } - }, - "required": ["app_id"] - } - }, - { - "name": "get_sensitive_data_report", - "description": "Get a report of sensitive data findings.", - "inputSchema": { - "type": "object", - "properties": { - "org_id": { "type": "string" } - }, - "required": ["org_id"] - } - }, - { - "name": "analyze_sensitive_data_trends", - "description": "Analyze sensitive data exposure trends.", - "inputSchema": { - "type": "object", - "properties": { - "org_id": { "type": "string" }, - "time_range": { "type": "string" } - }, - "required": ["org_id"] - } - }, - { - "name": "get_critical_sensitive_data", - "description": "Retrieve critical severity sensitive data findings.", - "inputSchema": { - "type": "object", - "properties": { - "org_id": { "type": "string" } - }, - "required": ["org_id"] - } - }, - { - "name": "generate_sensitive_data_summary", - "description": "Generate a summary report of sensitive data.", - "inputSchema": { - "type": "object", - "properties": { - "org_id": { "type": "string" } - }, - "required": ["org_id"] - } - } - ] - }, - "documentation": { - "homepage": "https://www.stackhawk.com", - "gettingStarted": "https://pypi.org/project/stackhawk-mcp/0.1.0/", - "readme": "https://github.com/stackhawk/stackhawk-mcp#readme", - "icon": "https://www.stackhawk.com/favicon-32x32.png" - } - } - \ No newline at end of file From 5886464da503efd78170de7f2f6eeaaac4d38021 Mon Sep 17 00:00:00 2001 From: KC Berg Date: Tue, 8 Jul 2025 15:56:51 -0600 Subject: [PATCH 12/12] chore: verify MCP server main entrypoint and versioning integration --- .github/workflows/publish-pypi.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 528cc7b..a8c18c7 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -28,7 +28,19 @@ jobs: pip install build bumpver - name: Bump minor version with bumpver if: github.ref == 'refs/heads/main' - run: bumpver update --minor --no-tag --commit + run: bumpver update --minor --commit + - name: Get version from pyproject.toml + id: get_version + run: | + VERSION=$(grep '^version = ' pyproject.toml | head -1 | cut -d '"' -f2) + echo "version=$VERSION" >> $GITHUB_OUTPUT + - name: Create and push tag for new version + if: github.ref == 'refs/heads/main' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag v${{ steps.get_version.outputs.version }} + git push origin v${{ steps.get_version.outputs.version }} - name: Push version bump commit if: github.ref == 'refs/heads/main' run: |