Skip to content

Commit d9c11ca

Browse files
author
LittleCoinCoin
committed
Merge branch 'feat/kiro-support' into dev
2 parents cbc222d + 3bdae9c commit d9c11ca

28 files changed

+1654
-318
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
## Introduction
66

7-
Hatch is the package manager for managing Model Context Protocol (MCP) servers with environment isolation, multi-type dependency resolution, and multi-host deployment. Deploy MCP servers to Claude Desktop, VS Code, Cursor, and other platforms with automatic dependency management.
7+
Hatch is the package manager for managing Model Context Protocol (MCP) servers with environment isolation, multi-type dependency resolution, and multi-host deployment. Deploy MCP servers to Claude Desktop, VS Code, Cursor, Kiro, and other platforms with automatic dependency management.
88

99
The canonical documentation is at `docs/index.md` and published at <https://hatch.readthedocs.io/en/latest/>.
1010

1111
## Key Features
1212

1313
- **Environment Isolation** — Create separate, isolated workspaces for different projects without conflicts
1414
- **Multi-Type Dependency Resolution** — Automatically resolve and install system packages, Python packages, Docker containers, and Hatch packages
15-
- **Multi-Host Deployment** — Deploy MCP servers to Claude Desktop, Claude Code, VS Code, Cursor, LM Studio, and Google Gemini CLI
15+
- **Multi-Host Deployment** — Deploy MCP servers to Claude Desktop, Claude Code, VS Code, Cursor, Kiro, LM Studio, and Google Gemini CLI
1616
- **Package Validation** — Ensure packages meet schema requirements before distribution
1717
- **Development-Focused** — Optimized for rapid development and testing of MCP server ecosystems
1818

@@ -24,6 +24,7 @@ Hatch supports deployment to the following MCP host platforms:
2424
- **Claude Code** — Claude integration for VS Code with MCP capabilities
2525
- **VS Code** — Visual Studio Code with the MCP extension for tool integration
2626
- **Cursor** — AI-first code editor with built-in MCP server support
27+
- **Kiro** — Kiro IDE with MCP support
2728
- **LM Studio** — Local LLM inference platform with MCP server integration
2829
- **Google Gemini CLI** — Command-line interface for Google's Gemini model with MCP support
2930

docs/articles/devs/architecture/mcp_host_configuration.md

Lines changed: 60 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ This article is about:
99

1010
## Overview
1111

12-
The MCP host configuration system provides centralized management of Model Context Protocol server configurations across multiple host platforms (Claude Desktop, VS Code, Cursor, etc.). It uses a decorator-based architecture with inheritance patterns for clean code organization and easy extension.
12+
The MCP host configuration system provides centralized management of Model Context Protocol server configurations across multiple host platforms (Claude Desktop, VS Code, Cursor, Kiro, etc.). It uses a decorator-based architecture with inheritance patterns for clean code organization and easy extension.
13+
14+
> **Adding a new host?** See the [Implementation Guide](../implementation_guides/mcp_host_configuration_extension.md) for step-by-step instructions.
1315
1416
## Core Architecture
1517

@@ -45,8 +47,9 @@ Host strategies are organized into families for code reuse:
4547
- **Implementations**: Cursor, LM Studio
4648

4749
#### Independent Strategies
48-
- **VSCode**: Nested configuration structure (`mcp.servers`)
50+
- **VSCode**: User-wide configuration (`~/.config/Code/User/mcp.json`), uses `servers` key
4951
- **Gemini**: Official configuration path (`~/.gemini/settings.json`)
52+
- **Kiro**: User-level configuration (`~/.kiro/settings/mcp.json`), full backup manager integration
5053

5154
### Consolidated Data Model
5255

@@ -111,15 +114,51 @@ class MCPHostStrategy(ABC):
111114

112115
## Integration Points
113116

114-
### Backup System Integration
117+
Every host strategy must integrate with these systems. Missing any integration point will result in incomplete functionality.
118+
119+
### Backup System Integration (Required)
115120

116-
All configuration operations integrate with the backup system:
121+
All configuration write operations **must** integrate with the backup system via `MCPHostConfigBackupManager` and `AtomicFileOperations`:
117122

123+
```python
124+
from .backup import MCPHostConfigBackupManager, AtomicFileOperations
125+
126+
def write_configuration(self, config: HostConfiguration, no_backup: bool = False) -> bool:
127+
# ... prepare data ...
128+
backup_manager = MCPHostConfigBackupManager()
129+
atomic_ops = AtomicFileOperations()
130+
atomic_ops.atomic_write_with_backup(
131+
file_path=config_path,
132+
data=existing_data,
133+
backup_manager=backup_manager,
134+
hostname="your-host", # Must match MCPHostType value
135+
skip_backup=no_backup
136+
)
137+
```
138+
139+
**Key requirements:**
118140
- **Atomic operations**: Configuration changes are backed up before modification
119-
- **Rollback capability**: Failed operations can be reverted
120-
- **Multi-host support**: Separate backups per host platform
141+
- **Rollback capability**: Failed operations can be reverted automatically
142+
- **Hostname identification**: Each host uses its `MCPHostType` value for backup tracking
121143
- **Timestamped retention**: Backup files include timestamps for tracking
122144

145+
### Model Registry Integration (Required for host-specific fields)
146+
147+
If your host has unique configuration fields (like Kiro's `disabled`, `autoApprove`, `disabledTools`):
148+
149+
1. Create host-specific model class in `models.py`
150+
2. Register in `HOST_MODEL_REGISTRY`
151+
3. Extend `MCPServerConfigOmni` with new fields
152+
4. Implement `from_omni()` conversion method
153+
154+
### CLI Integration (Required for host-specific arguments)
155+
156+
If your host has unique CLI arguments:
157+
158+
1. Extend `handle_mcp_configure()` function signature in `cli_hatch.py`
159+
2. Add argument parser entries for new flags
160+
3. Update omni model population logic
161+
123162
### Environment Manager Integration
124163

125164
The system integrates with environment management through corrected data structures:
@@ -132,27 +171,31 @@ The system integrates with environment management through corrected data structu
132171

133172
### Adding New Host Platforms
134173

135-
To add support for a new host platform:
174+
To add support for a new host platform, complete these integration points:
136175

137-
1. **Define host type** in `MCPHostType` enum
138-
2. **Create strategy class** inheriting from appropriate family base or `MCPHostStrategy`
139-
3. **Implement required methods** for configuration path, validation, read/write operations
140-
4. **Add decorator registration** with `@register_host_strategy(MCPHostType.NEW_HOST)`
141-
5. **Add tests** following existing test patterns
176+
| Integration Point | Required? | Files to Modify |
177+
|-------------------|-----------|-----------------|
178+
| Host type enum | Always | `models.py` |
179+
| Strategy class | Always | `strategies.py` |
180+
| Backup integration | Always | `strategies.py` (in `write_configuration`) |
181+
| Host-specific model | If unique fields | `models.py`, `HOST_MODEL_REGISTRY` |
182+
| CLI arguments | If unique fields | `cli_hatch.py` |
183+
| Test infrastructure | Always | `tests/` |
142184

143-
Example:
185+
**Minimal implementation** (standard host, no unique fields):
144186

145187
```python
146188
@register_host_strategy(MCPHostType.NEW_HOST)
147-
class NewHostStrategy(MCPHostStrategy):
189+
class NewHostStrategy(ClaudeHostStrategy): # Inherit backup integration
148190
def get_config_path(self) -> Optional[Path]:
149191
return Path.home() / ".new_host" / "config.json"
150192

151-
def validate_server_config(self, server_config: MCPServerConfig) -> bool:
152-
# Host-specific validation logic
153-
return True
193+
def is_host_available(self) -> bool:
194+
return self.get_config_path().parent.exists()
154195
```
155196

197+
**Full implementation** (host with unique fields): See [Implementation Guide](../implementation_guides/mcp_host_configuration_extension.md).
198+
156199
### Extending Validation Rules
157200

158201
Host strategies can implement custom validation:

0 commit comments

Comments
 (0)