
swarmpit/mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
MCP server for managing swarmpit
概要
MCP server for managing Swarmpit Docker Swarm instances from any MCP-compatible client. 100% Swarmpit API coverage (79 endpoints). The server runs locally and holds API tokens — they never enter the LLM conversation context. Works with opencode (recommended), Claude Code, and any other MCP client. Add to your .mcp.json (project-level) or ~/.claude.json (global): Get your API token from Swarmpit UI: Profile → API Access → Generate token. One process can manage several Swarmpit instances. Every tool then takes an optional server argument naming the target — the tool set is registered once instead of once per instance, which matters because the full surface is ~79 tools and the model loads all of them for every MCP server you wire up. Point SWARMPIT_CONFIG_FILE at a JSON file: Or without a file, using per-name env vars (SWARMPIT_ _URL, with - becoming _ and the name upper-cased):
README
以下は原文 README の抜粋です。原文を見る。
mcp-swarmpit
MCP server for managing Swarmpit Docker Swarm instances from any MCP-compatible client. 100% Swarmpit API coverage (79 endpoints).
The server runs locally and holds API tokens — they never enter the LLM conversation context.
Works with opencode (recommended), Claude Code, and any other MCP client.
Configuration
opencode
Add to your .opencode.json:
{
"mcpServers": {
"swarmpit-prod": {
"type": "stdio",
"command": "npx",
"args": ["github:swarmpit/mcp"],
"env": {
"SWARMPIT_URL": "https://swarmpit.example.com",
"SWARMPIT_TOKEN": "your-api-token",
"SWARMPIT_REDACT": "sensitive"
}
}
}
}
Claude Code
Add to your .mcp.json (project-level) or ~/.claude.json (global):
{
"mcpServers": {
"swarmpit-prod": {
"command": "npx",
"args": ["github:swarmpit/mcp"],
"env": {
"SWARMPIT_URL": "https://swarmpit.example.com",
"SWARMPIT_TOKEN": "your-api-token",
"SWARMPIT_REDACT": "sensitive"
}
}
}
}
Get your API token from Swarmpit UI: Profile → API Access → Generate token.
Multiple instances
One process can manage several Swarmpit instances. Every tool then takes an optional server argument naming the target — the tool set is registered once instead of once per instance, which matters because the full surface is ~79 tools and the model loads all of them for every MCP server you wire up.
Point SWARMPIT_CONFIG_FILE at a JSON file:
{
"default": "prod-eu",
"servers": {
"prod-eu": { "url": "https://swarmpit.eu.example.com", "tokenFile": "~/.config/swarmpit/prod-eu" },
"prod-us": { "url": "https://swarmpit.us.example.com", "tokenFile": "~/.config/swarmpit/prod-us" }
}
}
{
"mcpServers": {
"swarmpit": {
"command": "npx",
"args": ["github:swarmpit/mcp"],
"env": { "SWARMPIT_CONFIG_FILE": "~/.config/swarmpit/servers.json", "SWARMPIT_REDACT": "sensitive" }
}
}
}
Or without a file, using per-name env vars (SWARMPIT__URL, with - becoming _ and the name upper-cased):
"env": {
"SWARMPIT_SERVERS": "prod-eu,prod-us",
"SWARMPIT_DEFAULT_SERVER": "prod-eu",
"SWARMPIT_PROD_EU_URL": "https://swarmpit.eu.example.com",
"SWARMPIT_PROD_EU_TOKEN_FILE": "~/.config/swarmpit/prod-eu",
"SWARMPIT_PROD_US_URL": "https://swarmpit.us.example.com",
"SWARMPIT_PROD_US_TOKEN_FILE": "~/.config/swarmpit/prod-us"
}
Then: list_services({ server: "prod-us" }). Omitting server uses the default. If several instances are configured and no default is set, the argument is required — a forgotten argument will never silently pick a cluster for you. swarmpit_info lists what’s configured.
Querying several instances at once
Read-only tools also accept "*" or a list of names, and return results grouped by server:
インストール
npx github:swarmpit/mcp設定
{
"mcpServers": {
"swarmpit-prod": {
"type": "stdio",
"command": "npx",
"args": ["github:swarmpit/mcp"],
"env": {
"SWARMPIT_URL": "https://swarmpit.example.com",
"SWARMPIT_TOKEN": "your-api-token",
"SWARMPIT_REDACT": "sensitive"
}
}
}
}