Skip to content

Support Claude Code - #21

Merged
corv89 merged 16 commits into
mainfrom
dev
Oct 25, 2025
Merged

Support Claude Code#21
corv89 merged 16 commits into
mainfrom
dev

Conversation

@corv89

@corv89 corv89 commented Oct 25, 2025

Copy link
Copy Markdown
Owner

Closes #15 and adds PEP 561 Type Checking Support

corv89 added 15 commits October 23, 2025 13:31
- Add executor-aware tool names/descriptions in mcp_server.py
  - Tool names now include executor label (e.g., sandbox_prod_minimal)
  - Descriptions include remote host information
- Pass SSH agent env vars when generating Claude config in cli.py
  - MCP install now passes SSH_AUTH_SOCK and SSH_AGENT_PID to server
- Update docs and tests to reflect single-tool-per-profile model
  - MCP server exposes one generic command tool per profile
  - Tests verify executor label integration and tool naming
- Extend SSHExecutor and config models with known_hosts / strict_host_key
  - Add known_hosts and strict_host_key fields to SSHExecutorConfig
  - Implement host key validation in SSHExecutor
  - Default strict_host_key=True for security
- Persist new options in TOML I/O and guard executor creation
  - Config save/load handles known_hosts and strict_host_key
  - Path expansion for known_hosts file
- Cover host-key behavior in docs and unit tests
  - Document host key verification in configuration.md
  - Add tests for config round-trip with host key settings
  - Add SSH executor tests for host key validation
- Promote pydantic>=2 to a core dependency in pyproject.toml
  - Move pydantic from optional to required dependencies
  - Ensures config models always available
- Fold asyncssh into the mcp extra
  - asyncssh now part of [mcp] optional dependencies
  - Remote execution requires [mcp] or [remote] extra
- Update lockfile and formatting fixes
  - Regenerate uv.lock with new dependencies
  - Fix trailing whitespace in docs
- Add type ignore comments for dynamic module attribute assignments
- Add type annotation for _SimpleType __init__ kwargs parameter
- Suppress attr-defined errors for mcp module monkeypatching
- Add noqa comments for E402 (module imports after setup code)

Resolves remaining 12 basedpyright errors from CI.
- Add pytest.importorskip for optional dependencies (mcp, pydantic)
- Add complete dummy MCP server stubs (InitializationOptions, ServerCapabilities, stdio_server)
- Fix mock fixtures to include executor=None attribute
- Add _tool_cache to dummy server
- Skip tests requiring real MCP server when using mocks
- Add noqa comments for E402 (imports after pytest.importorskip)

All tests now pass: 97 passed, 48 skipped
Replace static skipif decorators with runtime skip checks.
Tests now skip if _tool_cache is empty (dummy server) rather than
trying to detect if real MCP SDK is installed.

This fixes failures in CI where real MCP is installed but the
mocks still result in empty tool cache.
- Changed _update_claude_cli_local_server to _update_claude_cli_user_server
- Now writes to top-level mcpServers (user scope) instead of projects.{cwd}.mcpServers
- Makes MCP server available across all projects instead of just one
- Updated test to reflect user scope behavior
- Fixed line length lint error in test docstring
- Added noqa comment for E402 (import after importorskip is intentional)
- Add proper ServerCapabilities with ToolsCapability and ResourcesCapability
- Import new capability types from mcp.types
- Update test stubs to include new capability types
- Fixes 'Capabilities: none' issue in Claude Code /mcp interface
- Server now properly advertises that it provides tools and resources
Major improvements:
- Add platform-specific Quick Start sections (macOS/Windows vs Linux)
- Document user scope as default for Claude Code (available across all projects)
- Add 'claude mcp add' command examples for native CLI usage
- Explain all three scopes: local, user, and project
- Add team collaboration section with .mcp.json workflow
- Add Claude Code-specific troubleshooting section
- Add Quick Reference section with common commands
- Clarify that macOS/Windows require remote Linux targets
- Add verification steps using /mcp command

Fixes:
- Remove confusing section numbering after adding Quick Starts
- Add Windows/macOS platform notes early in the document
- Provide clear guidance on when to use each installation method
- Creates shannot/py.typed to mark package as typed
- Enables type checkers and IDEs to recognize Shannot as a typed library
- Required by pyproject.toml package_data declaration (line 81)
- Allows downstream users to benefit from Shannot's type annotations

Per PEP 561, this empty file signals that the package supports type checking
and that inline type hints should be used by static type checkers.
@corv89 corv89 self-assigned this Oct 25, 2025
@corv89 corv89 added the enhancement New feature or request label Oct 25, 2025
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 83.72093% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
shannot/cli.py 82.50% 14 Missing ⚠️

📢 Thoughts on this report? Let us know!

@corv89
corv89 merged commit 34b8c65 into main Oct 25, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude Code support for MCP

2 participants