Let AI agents deploy and manage code through Berth programmatically.
The Model Context Protocol (MCP) is a standard that lets AI coding agents interact with external tools. Berth exposes an MCP server with 26 tools, enabling AI agents like Claude Code to deploy, run, stop, and monitor projects programmatically.
The MCP server uses stdio transport — Claude Code spawns it as a subprocess and communicates over stdin/stdout.
Add Berth to your project's .mcp.json file:
{
"mcpServers": {
"berth": {
"command": "cargo",
"args": ["run", "-p", "berth-mcp", "--quiet"],
"cwd": "/path/to/berth"
}
}
}
Replace /path/to/berth with the path to your Berth source directory.
Tip: After adding the config, restart Claude Code. You can verify the MCP server is connected by asking Claude to run berth_health.
| Tool | Description | Parameters |
|---|---|---|
berth_list_projects |
List all projects with status, runtime, and metadata | None |
berth_project_status |
Get detailed status of a project including run history | project_id required |
berth_deploy |
Deploy code to a target from a path or inline code |
name requiredpath optional — code directory or filecode optional — inline codetarget optional — default: local
|
berth_run |
Run a project and return output |
project_id requiredtimeout_secs optional — default: 30
|
berth_stop |
Stop a running project | project_id required |
berth_logs |
Fetch recent logs from a project |
project_id requiredtail optional — lines to return, default: 50
|
berth_import_code |
Import code from a path or inline string, creating a new project |
name requiredpath optional — path to codecode optional — inline codefilename optional — filename for inline code
|
berth_detect_runtime |
Auto-detect runtime, entrypoint, and dependencies for a path | path required |
berth_delete |
Delete a project | project_id required |
berth_health |
Check system health and version | None |
| Tool | Description | Parameters |
|---|---|---|
berth_schedule_add |
Add a cron-like schedule to a project |
project_id requiredcron required — e.g. @hourly, 30 9 * * *
|
berth_schedule_list |
List all schedules | None |
berth_schedule_remove |
Remove a schedule by UUID | schedule_id required |
| Tool | Description | Parameters |
|---|---|---|
berth_list_targets |
List configured deploy targets (local + remote) | None |
berth_add_target |
Add a new remote deploy target |
name requiredhost requiredport optional — default: 50051
|
berth_remove_target |
Remove a deploy target by name | name required |
berth_list_agents |
List connected agents and their health status (pings each target) | None |
| Tool | Description | Parameters |
|---|---|---|
berth_publish |
Publish a running project to a public URL via tunnel |
project_id requiredport required — port the service listens onprovider optional — default: cloudflared
|
berth_unpublish |
Stop the public URL tunnel for a project | project_id required |
| Tool | Description | Parameters |
|---|---|---|
berth_env_set |
Set an environment variable for a project |
project_id requiredkey requiredvalue required
|
berth_env_get |
Get all environment variables for a project | project_id required |
berth_env_delete |
Delete an environment variable |
project_id requiredkey required
|
berth_env_import |
Import variables from .env format (merges with existing) |
project_id requiredcontent required — KEY=VALUE lines
|
| Tool | Description | Parameters |
|---|---|---|
berth_store_list |
List available templates, optionally filtered by category | category optional — scrapers, api-servers, bots, ai-ml |
berth_store_search |
Search templates by keyword | query required |
berth_store_install |
Install a template, creating a new project | template_id required |
Ask Claude Code:
"Deploy this Python script to Berth and run it:
import requests
r = requests.get('https://news.ycombinator.com')
print(f'HN status: {r.status_code}')"
Claude Code will call berth_deploy with the inline code, then berth_run to execute it.
"Set the API_KEY environment variable on my-bot to sk-abc123, then run it"
Claude Code calls berth_env_set followed by berth_run.
"What's the status of all my Berth projects?"
Claude Code calls berth_list_projects and summarizes the results.
"Publish my-api on port 8080 to a public URL"
Claude Code calls berth_publish and returns the public URL.