Skip to content

Commit e855749

Browse files
author
LittleCoinCoin
committed
fix(docs): Tutorial 04-01
Remove all the inaccuracies regarding commands and justifications. Fix the flow and organization of sections
1 parent c48be5c commit e855749

File tree

1 file changed

+87
-112
lines changed

1 file changed

+87
-112
lines changed

docs/articles/users/tutorials/04-mcp-host-configuration/01-host-platform-overview.md

Lines changed: 87 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -33,101 +33,102 @@ This article introduces MCP host configuration concepts and Hatch's role in mana
3333
### Configuration vs. Development
3434

3535
**What Hatch Does**:
36+
3637
- ✅ Manages MCP server packages with dependencies
3738
- ✅ Configures existing MCP servers on host platforms
3839
- ✅ Synchronizes configurations across environments
3940
- ✅ Manages backups and recovery
4041

4142
**What Hatch Does NOT Do**:
43+
4244
- ❌ Develop MCP servers (use any tools/frameworks)
4345
- ❌ Implement MCP protocol
4446
- ❌ Replace MCP development frameworks
4547

46-
## Host Platform Ecosystem
47-
48-
### Supported Host Platforms
48+
## Supported Host Platforms
4949

5050
Hatch currently supports configuration for these MCP host platforms:
5151

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
52+
- [**Claude Desktop**](https://claude.ai/download) - Anthropic's desktop application
53+
- [**Claude Code**](https://claude.com/product/claude-code) - Anthropic's AI Command Line Interface
54+
- [**Cursor**](https://cursor.com/) - AI-powered code editor
55+
- [**VS Code**](https://code.visualstudio.com/) - Microsoft Visual Studio Code
56+
- [**LM Studio**](https://lmstudio.ai/) - Local language model interface
57+
- [**Gemini**](https://github.com/google-gemini/gemini-cli) - Google's AI Command Line Interface
8058

8159
## Configuration Management Workflow
8260

8361
### Complete Development-to-Deployment Pipeline
8462

85-
```
63+
```text
8664
1. Develop MCP servers (using any tools/frameworks)
8765
88-
2. Package servers with Hatch (Tutorial 03)
89-
66+
2. Package servers with Hatch ([Previous Tutorial](../03-author-package/01-generate-template.md))
67+
9068
3. Deploy packages to host platforms (Tutorial 04-02) ← PREFERRED
9169
9270
4. Alternative: Configure arbitrary servers (Tutorial 04-03) ← ADVANCED
9371
94-
5. Synchronize across environments (Tutorial 04-04)
95-
96-
6. Advanced synchronization patterns (Tutorial 04-05)
72+
5. Multi-host package deployment (Tutorial 04-04)
9773
```
9874

9975
### Two Deployment Approaches
10076

10177
**Package-First Deployment (Recommended)**:
102-
- Use `hatch package add --host` for Hatch packages
78+
79+
- Use `hatch package add <server_name> --host` for Hatch packages
10380
- Automatic dependency resolution
10481
- Guaranteed compatibility
10582
- Environment isolation
106-
- Rollback capabilities
10783

10884
**Direct Server Configuration (Advanced)**:
85+
10986
- Use `hatch mcp configure` for arbitrary servers
11087
- Manual dependency management
11188
- More control but more complexity
11289
- Suitable for third-party servers
11390

91+
### Choose Your Approach
92+
93+
**Use Package-First Deployment When**:
94+
95+
- ✅ You have Hatch packages (from Tutorial 03)
96+
- ✅ You want automatic dependency resolution
97+
- ✅ You need environment isolation
98+
- ✅ You want rollback capabilities
99+
- ✅ You're deploying to multiple hosts
100+
101+
**Use Direct Configuration When**:
102+
103+
- ✅ You have third-party MCP servers
104+
- ✅ You need maximum control over configuration
105+
- ✅ You're working with specialized server setups
106+
114107
## Discovering Your Environment
115108

116109
### Check Available Hosts
117110

118111
```bash
119-
# List all detected host platforms
120-
hatch mcp list hosts
112+
# Search all detected host platforms
113+
hatch mcp discover hosts
121114
```
122115

123-
**Expected Output**:
124-
```
116+
**Possible Output (depending on the software you have installed)**:
117+
118+
```plaintext
125119
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)
120+
claude-desktop: ✓ Available
121+
Config path: path/to/claude_desktop_config.json
122+
claude-code: ✗ Not detected
123+
Config path: path/to/.claude/mcp_config.json
124+
vscode: ✗ Not detected
125+
Config path: path/to/.vscode/settings.json
126+
cursor: ✓ Available
127+
Config path: path/to/.cursor/mcp.json
128+
lmstudio: ✓ Available
129+
Config path: path/toLMStudio/mcp.json
130+
gemini: ✓ Available
131+
Config path: path/to/.gemini/settings.json
131132
```
132133

133134
### Check Current Environment
@@ -143,62 +144,21 @@ hatch env list
143144
hatch package list
144145
```
145146

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-
192147
## Configuration File Formats
193148

194-
### Understanding Host-Specific Formats
149+
Typically, MCP hosts configuration file follow very similar structures; yet differences in the name of some fields or the presence/absence of other fields may require some adaptation.
195150

196151
**Claude Desktop Configuration**:
152+
197153
```json
198154
{
199155
"mcpServers": {
200156
"my-server": {
201-
"command": "python",
157+
"command": "python", // system python;
158+
// note that in the case of Hatch packages,
159+
// we will use the python executable of the
160+
// Hatch environment in which the package
161+
// is installed
202162
"args": ["/absolute/path/to/server.py"],
203163
"env": {
204164
"API_KEY": "value"
@@ -209,11 +169,12 @@ hatch package list
209169
```
210170

211171
**VS Code Configuration**:
212-
```jsonc
172+
173+
```json
213174
{
214-
"mcp.servers": {
175+
"servers": { // VS Code uses "servers" as the root object
215176
"my-server": {
216-
"command": "python",
177+
"command": "python", // system python - same as above
217178
"args": ["./relative/path/to/server.py"],
218179
"env": {
219180
"API_KEY": "value"
@@ -223,10 +184,23 @@ hatch package list
223184
}
224185
```
225186

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
187+
**Gemini Configuration**:
188+
189+
```json
190+
{
191+
"mcpServers": {
192+
"my-server": {
193+
"command": "python", // system python - same as above
194+
"args": ["/absolute/path/to/server.py"],
195+
"env": {
196+
"API_KEY": "value"
197+
},
198+
"trust": false, // typically doesn't exist outside of Gemini
199+
"timeout": 30000 // typically doesn't exist outside of Gemini
200+
}
201+
}
202+
}
203+
```
230204

231205
## Safety and Best Practices
232206

@@ -243,22 +217,22 @@ Hatch automatically creates backups before making configuration changes:
243217

244218
```bash
245219
# Always preview changes first
246-
hatch package add . --host claude-desktop --dry-run
247-
hatch mcp configure my-server --host cursor --dry-run
220+
hatch package add my_package --host claude-desktop --dry-run
221+
hatch mcp configure my_package --host cursor --dry-run
248222

249-
# Test in development environment first
250-
hatch env use development
251-
hatch package add . --host claude-desktop
223+
# Test in testing environment first
224+
hatch env use package-testing
225+
hatch package add . --host claude-desktop # from within the package directory
252226
```
253227

254228
### Environment Isolation
255229

256230
```bash
257-
# Different environments maintain separate configurations
258-
hatch env create development
259-
hatch env create production
231+
# Different environments maintain separate package versions
232+
hatch env create package-testing-v2
233+
hatch env create team-standard-2024q4
260234

261-
# Each environment can have different MCP server setups
235+
# Each environment can have different MCP package versions
262236
```
263237

264238
## Next Steps
@@ -268,6 +242,7 @@ You now understand the MCP host configuration landscape and Hatch's role as a pa
268242
**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.
269243

270244
**Related Documentation**:
245+
271246
- [CLI Reference](../../CLIReference.md) - Complete command syntax
272247
- [Getting Started Guide](../../GettingStarted.md) - Basic Hatch concepts
273248
- [Package Authoring Tutorial](../03-author-package/) - Creating packages for deployment

0 commit comments

Comments
 (0)