Skip to content

Fix MCP issue 1 regressions#2

Merged
sebasmos merged 1 commit intomainfrom
fix/mcp-issue-1-regressions
Apr 2, 2026
Merged

Fix MCP issue 1 regressions#2
sebasmos merged 1 commit intomainfrom
fix/mcp-issue-1-regressions

Conversation

@sahilk873
Copy link
Copy Markdown
Collaborator

This PR finishes the MCP server work in #1 and fixes the follow-up regressions found during review.

The main API compatibility issue was session handling. run_detector() had started generating a new session id whenever callers omitted session_id, while get_summary(), get_method_detail(), and generate_report() still defaulted to the legacy default session. That broke the existing plain Python workflow where callers run a detector and immediately ask for summary or detail without passing the returned id. This change restores the legacy default session for direct Python usage, while still keeping generated per-client session ids for MCP calls that include a client context.

The path-based input loader also now preserves a valid (n, 1) shape for single-feature embedding files. Labels and group labels can still collapse to one dimension, but embeddings loaded from CSV, TSV, or TXT remain two-dimensional so the file-based API behaves the same way as inline array inputs.

Report generation now handles PDF fallback correctly. When PDF export falls back to HTML because the PDF dependency is unavailable, the response returns the actual generated HTML path and base64 content from that file instead of reporting a nonexistent PDF path.

Validation:

  • pytest tests/test_mcp_server.py -q
  • Result: 37 passed

Closes #1.

@sahilk873 sahilk873 requested a review from sebasmos March 28, 2026 14:05
@sebasmos sebasmos merged commit 5ef010d into main Apr 2, 2026
3 checks passed
@sebasmos sebasmos deleted the fix/mcp-issue-1-regressions branch April 2, 2026 14:01
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.

feat: expose ShortKit-ML as an MCP server

2 participants