Skip to content

Commit 6d12ca8

Browse files
authored
Merge pull request #78 from stackhawk/feature/improve-mcp-ux-feedback
refactor: trim MCP tools from 12 to 7 for focused developer workflow
2 parents 442c92b + 9bfc993 commit 6d12ca8

File tree

9 files changed

+1179
-2180
lines changed

9 files changed

+1179
-2180
lines changed

stackhawk_mcp/server.py

Lines changed: 463 additions & 1580 deletions
Large diffs are not rendered by default.

tests/test_all_time_fix.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -107,31 +107,11 @@ async def test_all_time_reports():
107107
print(f" Applications analyzed: {total_trends}")
108108
print(f" Processing time: {(end_time - start_time).total_seconds():.2f} seconds")
109109

110-
# Test 5: Comprehensive Sensitive Data Summary - All Time
111-
print("\n5. Testing all-time comprehensive sensitive data summary...")
112-
start_time = datetime.now()
113-
sensitive_summary = await server._get_comprehensive_sensitive_data_summary(
114-
org_id=org_id,
115-
time_period="all",
116-
include_trends=True,
117-
include_critical_only=False,
118-
include_recommendations=True,
119-
group_by="data_type"
120-
)
121-
end_time = datetime.now()
122-
123-
total_sensitive = sensitive_summary.get("total_findings", 0)
124-
125-
print(f"✅ All-time comprehensive sensitive data summary generated!")
126-
print(f" Total sensitive data findings: {total_sensitive}")
127-
print(f" Processing time: {(end_time - start_time).total_seconds():.2f} seconds")
128-
129110
# Summary
130111
print(f"\n📈 SUMMARY:")
131112
print(f" Executive Summary Findings: {total_findings}")
132113
print(f" Vulnerability Report Findings: {total_findings_vuln}")
133114
print(f" Critical Findings: {total_critical}")
134-
print(f" Sensitive Data Summary: {total_sensitive}")
135115

136116
# Verify consistency
137117
if total_findings == total_findings_vuln:

tests/test_anti_hallucination.py

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -69,37 +69,9 @@ async def test_anti_hallucination():
6969
print(f"❌ Should have rejected: {field}")
7070

7171
print("\n" + "="*50 + "\n")
72-
73-
# Test 3: Get schema fields for specific sections
74-
print("3. Getting schema fields for specific sections...")
75-
sections = ["app", "hawk", "hawkAddOn", "tags"]
76-
77-
for section in sections:
78-
result = await server._get_stackhawk_schema(section=section)
79-
if "fields" in result:
80-
print(f"✅ {section} section: {result['total_fields']} fields")
81-
# Show first few fields
82-
field_names = list(result["fields"].keys())[:3]
83-
print(f" Sample fields: {', '.join(field_names)}")
84-
else:
85-
print(f"❌ Failed to get {section} fields: {result['error']}")
86-
87-
print("\n" + "="*50 + "\n")
88-
89-
# Test 4: Get all available fields
90-
print("4. Getting all available fields...")
91-
result = await server._get_stackhawk_schema()
92-
if "all_fields" in result:
93-
print(f"✅ Total fields available: {result['total_fields']}")
94-
print(f" Available sections: {', '.join(result['available_sections'])}")
95-
print(f" Schema URL: {result['schema_url']}")
96-
else:
97-
print(f"❌ Failed to get all fields: {result.get('error', result.get('message', 'Unknown error'))}")
98-
99-
print("\n" + "="*50 + "\n")
100-
101-
# Test 6: Demonstrate how to prevent hallucination
102-
print("6. Anti-Hallucination Workflow Example:")
72+
73+
# Test 3: Demonstrate how to prevent hallucination
74+
print("3. Anti-Hallucination Workflow Example:")
10375
print(" Step 1: Always validate fields before suggesting them")
10476
print(" Step 2: Use get_stackhawk_schema to see what's actually available")
10577
print(" Step 3: Use suggest_configuration for AI-powered recommendations")

tests/test_repository_analysis.py

Lines changed: 0 additions & 283 deletions
This file was deleted.

0 commit comments

Comments
 (0)