MCP Server
pypreset includes an MCP (Model Context Protocol) server that lets AI coding assistants create projects, augment existing ones, verify workflows, manage metadata, and configure defaults — all programmatically.
Installation
pypreset is published to the MCP Registry
as io.github.KaiErikNiermann/pypreset.
Install from the registry via uvx (recommended):
# Claude Code — one-liner
claude mcp add pypreset -- uvx --from "pypreset[mcp]" pypreset-mcp
No local install needed — uvx fetches the package on demand.
Or install locally from PyPI:
pip install pypreset[mcp]
Client Configuration
Claude Code (~/.claude/settings.json):
Using uvx (no local install):
{
"mcpServers": {
"pypreset": {
"command": "uvx",
"args": ["--from", "pypreset[mcp]", "pypreset-mcp"]
}
}
}
Using a local install:
{
"mcpServers": {
"pypreset": {
"command": "pypreset-mcp",
"args": []
}
}
}
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"pypreset": {
"command": "uvx",
"args": ["--from", "pypreset[mcp]", "pypreset-mcp"]
}
}
}
Available Tools
Tools are actions the AI assistant can invoke:
Tool |
Description |
|---|---|
|
Create a new project from a preset with optional overrides (layout, type checker, package manager, typing level, Python version, Docker, devcontainer, docs, coverage, tox) |
|
Add CI workflows, tests, gitignore, dependabot, Dockerfile, devcontainer, codecov,
documentation, tox, and PyPI publish workflow to an existing project.
Auto-detects tooling from |
|
Check structural correctness of a generated project directory |
|
Verify GitHub Actions workflows locally using |
|
List all available presets with names and descriptions |
|
Show the full YAML configuration of a specific preset |
|
Read current user-level defaults from |
|
Update user-level defaults (merges into existing config) |
|
Set or update PyPI metadata (description, authors, license, URLs, keywords) in
|
|
Migrate a Python project to uv from another package manager (Poetry, Pipenv,
pip-tools, or pip) using the upstream
migrate-to-uv tool.
Requires |
Tool Parameters
verify_workflow accepts these parameters:
Parameter |
Default |
Description |
|---|---|---|
|
(required) |
Path to the project root directory |
|
|
Specific workflow file relative to project (e.g. |
|
|
Specific job name to verify; runs all jobs if omitted |
|
|
GitHub event to simulate |
|
|
Validate without executing containers |
|
|
Platform mapping (e.g. |
|
|
Additional flags to pass through to act |
|
|
Timeout in seconds for act commands |
|
|
Attempt to auto-install act if not found |
set_project_metadata accepts these parameters:
Parameter |
Default |
Description |
|---|---|---|
|
(required) |
Path to the project directory |
|
|
Short package description for PyPI |
|
|
Authors list, e.g. |
|
|
SPDX license identifier (e.g. |
|
|
PyPI search keywords |
|
|
PyPI trove classifiers |
|
|
Source repository URL |
|
|
Project homepage URL |
|
|
Documentation site URL |
|
|
Issue/bug tracker URL |
|
|
GitHub owner/org name — auto-generates repository, homepage, and bug tracker URLs |
|
|
Overwrite existing non-empty values (default: only fill blanks) |
migrate_to_uv accepts these parameters:
Parameter |
Default |
Description |
|---|---|---|
|
(required) |
Path to the project to migrate |
|
|
Preview changes without modifying files |
|
|
Skip locking dependencies with uv after migration |
|
|
Skip checks for whether the project already uses uv |
|
|
Ignore current locked dependency versions |
|
|
Replace existing |
|
|
Keep the current build backend |
|
|
Keep data from current package manager (don’t delete old files/sections) |
|
|
Continue migration even if errors occur |
|
|
Source package manager: |
|
|
Strategy for migrating dependency groups: |
|
|
Build backend to use: |
Available Resources
Resources are read-only data the AI can access:
URI |
Description |
|---|---|
|
JSON list of all preset names and descriptions |
|
JSON of current user config path and values |
|
JSON list of available Jinja2 template filenames |
Guided Prompts
Prompts provide guided workflows for multi-step tasks:
- create-project
Walks the AI through project creation: choosing a name, selecting a preset, configuring overrides (layout, package manager, type checker, Docker, docs, coverage, tox), selecting an output directory, and calling
create_project. Optionally validates the result withvalidate_project.- augment-project
Walks the AI through augmenting an existing project: confirming the directory, explaining all available components (test workflow, lint workflow, dependabot, tests directory, gitignore, codecov, documentation, tox, Dockerfile, devcontainer, PyPI publish), asking which to generate, and calling
augment_project.
Architecture
The MCP server is a thin wrapper around pypreset’s core modules — tools contain no business logic and delegate to existing functions:
FastMCP server
├── tools.py → calls preset_loader, generator, validator,
│ user_config, metadata_utils, act_runner, migration
├── resources.py → calls preset_loader, user_config, template_engine
└── prompts.py → builds guided conversation flows
The server is built with FastMCP 3.x and uses
Pydantic Field annotations for tool parameter validation and documentation.
All tool handlers use lazy imports (from pypreset.xxx import ... inside the
function body) to keep server startup fast and avoid circular imports.