Skip to content

feat: add shared core services for CLI and MCP - #57

Merged
codeasier merged 1 commit into
mainfrom
feat/mcp-server-support
Apr 21, 2026
Merged

codeasier merged 1 commit into
mainfrom
feat/mcp-server-support

Conversation

@codeasier

Copy link
Copy Markdown
Owner

📝 Description

Refactor pt-snap-cli to introduce a shared core service layer for focus and query behavior, then route the CLI, Python API, and MCP server through that shared implementation. This keeps current CLI semantics intact while making MCP/API behavior consistent and easier to extend.

🔗 Related Issue

Fixes #56

🧪 Testing

  • Tests added/updated

  • Manual testing completed

  • conda run -n cc ruff check .

  • conda run -n cc black --check .

  • conda run -n cc python -m pytest --cov --cov-report=xml --cov-report=term-missing

✅ Checklist

  • Code follows project guidelines
  • Documentation updated (if applicable)
  • No new warnings introduced
  • Changes tested locally

📸 Screenshots (if applicable)

N/A

📋 Additional Notes

  • Added src/pt_snap_cli/core/ with shared models, domain errors, FocusService, and QueryService.
  • Preserved compatibility for focus resolution precedence, device_id=0, and max_rows <= 0.
  • python -m pytest was used locally inside the cc conda environment to ensure the editable install from that environment was used consistently.

Centralize focus and query behavior in reusable services so the CLI, Python API, and MCP server share the same semantics and compatibility guarantees.
@codeasier
codeasier force-pushed the feat/mcp-server-support branch from 161bb36 to df277ca Compare April 21, 2026 13:39

@codeasier codeasier left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codeasier
codeasier merged commit 3f1d34d into main Apr 21, 2026
5 checks passed
@codeasier
codeasier deleted the feat/mcp-server-support branch April 21, 2026 13:41
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.

[FEATURE] Add shared core service layer for CLI and MCP

1 participant