|
| 1 | +# 01: Host Platform Overview |
| 2 | + |
| 3 | +--- |
| 4 | +**Concepts covered:** |
| 5 | + |
| 6 | +- MCP host platforms (Claude Desktop, VS Code, Cursor, etc.) |
| 7 | +- Hatch's role as package manager with host configuration features |
| 8 | +- Host platform configuration files and formats |
| 9 | +- Package-first vs. direct configuration approaches |
| 10 | + |
| 11 | +**Skills you will practice:** |
| 12 | + |
| 13 | +- Discovering available host platforms |
| 14 | +- Understanding host-specific requirements |
| 15 | +- Planning deployment strategy (package-first preferred) |
| 16 | +- Exploring configuration management concepts |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +This article introduces MCP host configuration concepts and Hatch's role in managing MCP server deployments across different host platforms. |
| 21 | + |
| 22 | +## Understanding MCP Host Configuration |
| 23 | + |
| 24 | +### Hatch's Primary Role |
| 25 | + |
| 26 | +**Hatch is primarily an MCP package manager** where packages contain MCP servers. The MCP host configuration management feature was added to support diverse developer preferences for deployment: |
| 27 | + |
| 28 | +- **Primary Role**: Package manager for MCP servers with dependency resolution (Python, apt, Docker, other Hatch packages) |
| 29 | +- **Supporting Feature**: Configures MCP servers (from Hatch packages or arbitrary sources) on host platforms |
| 30 | +- **Configuration Management**: Synchronizes server configurations between Hatch environments and host applications |
| 31 | +- **Scope Boundary**: Does NOT develop MCP servers or implement MCP protocol |
| 32 | + |
| 33 | +### Configuration vs. Development |
| 34 | + |
| 35 | +**What Hatch Does**: |
| 36 | +- ✅ Manages MCP server packages with dependencies |
| 37 | +- ✅ Configures existing MCP servers on host platforms |
| 38 | +- ✅ Synchronizes configurations across environments |
| 39 | +- ✅ Manages backups and recovery |
| 40 | + |
| 41 | +**What Hatch Does NOT Do**: |
| 42 | +- ❌ Develop MCP servers (use any tools/frameworks) |
| 43 | +- ❌ Implement MCP protocol |
| 44 | +- ❌ Replace MCP development frameworks |
| 45 | + |
| 46 | +## Host Platform Ecosystem |
| 47 | + |
| 48 | +### Supported Host Platforms |
| 49 | + |
| 50 | +Hatch currently supports configuration for these MCP host platforms: |
| 51 | + |
| 52 | +**AI Development Environments**: |
| 53 | +- **Claude Desktop** - Anthropic's desktop application |
| 54 | +- **Claude Code** - Anthropic's VS Code extension |
| 55 | +- **Cursor** - AI-powered code editor |
| 56 | + |
| 57 | +**Traditional Development Environments**: |
| 58 | +- **VS Code** - Microsoft Visual Studio Code with MCP extensions |
| 59 | +- **LM Studio** - Local language model interface |
| 60 | +- **Gemini** - Google's AI development environment |
| 61 | + |
| 62 | +### Host-Specific Characteristics |
| 63 | + |
| 64 | +**Claude Family (Claude Desktop, Claude Code)**: |
| 65 | +- Requires absolute paths for local commands |
| 66 | +- Supports both local and remote MCP servers |
| 67 | +- JSON configuration format |
| 68 | +- Automatic server discovery |
| 69 | + |
| 70 | +**VS Code and Cursor**: |
| 71 | +- Supports relative paths in workspace context |
| 72 | +- Extension-based MCP integration |
| 73 | +- JSONC configuration format with comments |
| 74 | +- Manual server registration required |
| 75 | + |
| 76 | +**LM Studio and Gemini**: |
| 77 | +- Platform-specific configuration formats |
| 78 | +- Varying levels of MCP protocol support |
| 79 | +- Different authentication requirements |
| 80 | + |
| 81 | +## Configuration Management Workflow |
| 82 | + |
| 83 | +### Complete Development-to-Deployment Pipeline |
| 84 | + |
| 85 | +``` |
| 86 | +1. Develop MCP servers (using any tools/frameworks) |
| 87 | + ↓ |
| 88 | +2. Package servers with Hatch (Tutorial 03) |
| 89 | + ↓ |
| 90 | +3. Deploy packages to host platforms (Tutorial 04-02) ← PREFERRED |
| 91 | + ↓ |
| 92 | +4. Alternative: Configure arbitrary servers (Tutorial 04-03) ← ADVANCED |
| 93 | + ↓ |
| 94 | +5. Synchronize across environments (Tutorial 04-04) |
| 95 | + ↓ |
| 96 | +6. Advanced synchronization patterns (Tutorial 04-05) |
| 97 | +``` |
| 98 | + |
| 99 | +### Two Deployment Approaches |
| 100 | + |
| 101 | +**Package-First Deployment (Recommended)**: |
| 102 | +- Use `hatch package add --host` for Hatch packages |
| 103 | +- Automatic dependency resolution |
| 104 | +- Guaranteed compatibility |
| 105 | +- Environment isolation |
| 106 | +- Rollback capabilities |
| 107 | + |
| 108 | +**Direct Server Configuration (Advanced)**: |
| 109 | +- Use `hatch mcp configure` for arbitrary servers |
| 110 | +- Manual dependency management |
| 111 | +- More control but more complexity |
| 112 | +- Suitable for third-party servers |
| 113 | + |
| 114 | +## Discovering Your Environment |
| 115 | + |
| 116 | +### Check Available Hosts |
| 117 | + |
| 118 | +```bash |
| 119 | +# List all detected host platforms |
| 120 | +hatch mcp list hosts |
| 121 | +``` |
| 122 | + |
| 123 | +**Expected Output**: |
| 124 | +``` |
| 125 | +Available MCP host platforms: |
| 126 | +✓ claude-desktop (detected: ~/.config/claude/claude_desktop_config.json) |
| 127 | +✓ cursor (detected: ~/.cursor/mcp_config.json) |
| 128 | +✓ vscode (detected: ~/.vscode/settings.json) |
| 129 | +✗ lmstudio (not detected) |
| 130 | +✗ gemini (not detected) |
| 131 | +``` |
| 132 | + |
| 133 | +### Check Current Environment |
| 134 | + |
| 135 | +```bash |
| 136 | +# See your current Hatch environment |
| 137 | +hatch env current |
| 138 | + |
| 139 | +# List available environments |
| 140 | +hatch env list |
| 141 | + |
| 142 | +# List installed packages |
| 143 | +hatch package list |
| 144 | +``` |
| 145 | + |
| 146 | +### Verify Host Platform Installation |
| 147 | + |
| 148 | +**Claude Desktop**: |
| 149 | +- Download from Anthropic's website |
| 150 | +- Configuration location: `~/.config/claude/claude_desktop_config.json` |
| 151 | +- Supports both local and remote MCP servers |
| 152 | + |
| 153 | +**Cursor**: |
| 154 | +- Download from cursor.sh |
| 155 | +- Configuration location: `~/.cursor/mcp_config.json` |
| 156 | +- AI-powered development features |
| 157 | + |
| 158 | +**VS Code**: |
| 159 | +- Install MCP extension from marketplace |
| 160 | +- Configuration in workspace or user settings |
| 161 | +- Requires manual MCP server registration |
| 162 | + |
| 163 | +## Planning Your Deployment Strategy |
| 164 | + |
| 165 | +### Choose Your Approach |
| 166 | + |
| 167 | +**Use Package-First Deployment When**: |
| 168 | +- ✅ You have Hatch packages (from Tutorial 03) |
| 169 | +- ✅ You want automatic dependency resolution |
| 170 | +- ✅ You need environment isolation |
| 171 | +- ✅ You want rollback capabilities |
| 172 | +- ✅ You're deploying to multiple hosts |
| 173 | + |
| 174 | +**Use Direct Configuration When**: |
| 175 | +- ✅ You have third-party MCP servers |
| 176 | +- ✅ You need maximum control over configuration |
| 177 | +- ✅ You're working with specialized server setups |
| 178 | +- ✅ You're integrating existing server infrastructure |
| 179 | + |
| 180 | +### Host Selection Strategy |
| 181 | + |
| 182 | +**Development Workflow**: |
| 183 | +- Start with **Claude Desktop** for initial testing |
| 184 | +- Add **Cursor** for AI-powered development |
| 185 | +- Include **VS Code** for traditional development |
| 186 | + |
| 187 | +**Production Deployment**: |
| 188 | +- Deploy to all relevant host platforms |
| 189 | +- Use environment-specific configurations |
| 190 | +- Implement backup and recovery procedures |
| 191 | + |
| 192 | +## Configuration File Formats |
| 193 | + |
| 194 | +### Understanding Host-Specific Formats |
| 195 | + |
| 196 | +**Claude Desktop Configuration**: |
| 197 | +```json |
| 198 | +{ |
| 199 | + "mcpServers": { |
| 200 | + "my-server": { |
| 201 | + "command": "python", |
| 202 | + "args": ["/absolute/path/to/server.py"], |
| 203 | + "env": { |
| 204 | + "API_KEY": "value" |
| 205 | + } |
| 206 | + } |
| 207 | + } |
| 208 | +} |
| 209 | +``` |
| 210 | + |
| 211 | +**VS Code Configuration**: |
| 212 | +```jsonc |
| 213 | +{ |
| 214 | + "mcp.servers": { |
| 215 | + "my-server": { |
| 216 | + "command": "python", |
| 217 | + "args": ["./relative/path/to/server.py"], |
| 218 | + "env": { |
| 219 | + "API_KEY": "value" |
| 220 | + } |
| 221 | + } |
| 222 | + } |
| 223 | +} |
| 224 | +``` |
| 225 | + |
| 226 | +**Key Differences**: |
| 227 | +- **Path Requirements**: Claude requires absolute paths, VS Code supports relative |
| 228 | +- **Environment Variables**: Different syntax and support levels |
| 229 | +- **Comments**: VS Code supports JSONC with comments |
| 230 | + |
| 231 | +## Safety and Best Practices |
| 232 | + |
| 233 | +### Backup Strategy |
| 234 | + |
| 235 | +Hatch automatically creates backups before making configuration changes: |
| 236 | + |
| 237 | +```bash |
| 238 | +# Backups stored in ~/.hatch/mcp_host_config_backups/ |
| 239 | +# Format: mcp.json.<hostname>.<timestamp> |
| 240 | +``` |
| 241 | + |
| 242 | +### Testing Strategy |
| 243 | + |
| 244 | +```bash |
| 245 | +# Always preview changes first |
| 246 | +hatch package add . --host claude-desktop --dry-run |
| 247 | +hatch mcp configure my-server --host cursor --dry-run |
| 248 | + |
| 249 | +# Test in development environment first |
| 250 | +hatch env use development |
| 251 | +hatch package add . --host claude-desktop |
| 252 | +``` |
| 253 | + |
| 254 | +### Environment Isolation |
| 255 | + |
| 256 | +```bash |
| 257 | +# Different environments maintain separate configurations |
| 258 | +hatch env create development |
| 259 | +hatch env create production |
| 260 | + |
| 261 | +# Each environment can have different MCP server setups |
| 262 | +``` |
| 263 | + |
| 264 | +## Next Steps |
| 265 | + |
| 266 | +You now understand the MCP host configuration landscape and Hatch's role as a package manager with configuration capabilities. You're ready to start deploying MCP servers to host platforms. |
| 267 | + |
| 268 | +**Continue to**: [Tutorial 04-02: Configuring Hatch Packages](02-configuring-hatch-packages.md) to learn the **preferred deployment method** using Hatch packages with automatic dependency resolution. |
| 269 | + |
| 270 | +**Related Documentation**: |
| 271 | +- [CLI Reference](../../CLIReference.md) - Complete command syntax |
| 272 | +- [Getting Started Guide](../../GettingStarted.md) - Basic Hatch concepts |
| 273 | +- [Package Authoring Tutorial](../03-author-package/) - Creating packages for deployment |
0 commit comments