01: Installation¶
Concepts covered:
- How Hatch is distributed and installed
- CLI structure and available commands
- Configuration directories and cache management
Skills you will practice:
- Installing Hatch using pip
- Verifying the installation
- Exploring CLI help and available commands
This article covers the installation of Hatch, a package manager for Model Context Protocol (MCP) servers.
Step 1: Install Hatch¶
- Ensure you have Python 3.12 or later installed on your system.
- Install Hatch using pip:
- Verify the installation by checking the version:
You should see output like hatch 0.6.1. You can also view available commands:
Step 2: Understand the CLI Structure¶
Hatch provides several command groups:
hatch create- Create new package templateshatch validate- Validate package structureshatch env- Environment management commandshatch package- Package management commands
Global Configuration Options¶
The CLI accepts the following global configuration options:
--envs-dir- Directory to store environments (default:~/.hatch/envs)--cache-ttl- Cache TTL in seconds (default: 86400 seconds = 1 day)--cache-dir- Directory to store cached packages (default:~/.hatch/cache)
Step 3: Explore Available Commands¶
View detailed help for specific command groups:
Exercise:
Explore the help output for the create command. What options are available for each?
Solution
Next: Create Environment