DM

duplocloud/mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

0 stars 2 forks 质量 67 趋势 0MIT

MCP Server for the duplocloud API

概览

A Model Context Protocol (MCP) server for DuploCloud. Dynamically discovers duploctl commands and exposes them as MCP tools so AI agents and compatible clients can query infrastructure state and perform auditable actions. Built on FastMCP and the duplocloud-client Python package. Installs as a duploctl plugin — no separate command needed. - -- registers as a duploctl resource via entry points; run with duploctl mcp - -- all duploctl @Command methods are registered as MCP tools at startup - -- regex-based filters to control which tools are exposed - -- commands with models get typed input schemas instead of raw dicts - -- built-in config tool and GET /config route showing live server state - -- @custom_tool and @custom_route decorators with context injection - -- stdio (default) or HTTP for persistent servers - Python 3.

README

以下为原文 README 节选,完整内容请查看原文。

DuploCloud MCP Server

A Model Context Protocol (MCP) server for DuploCloud. Dynamically discovers duploctl commands and exposes them as MCP tools so AI agents and compatible clients can query infrastructure state and perform auditable actions.

Built on FastMCP and the duplocloud-client Python package. Installs as a duploctl plugin — no separate command needed.

Table of Contents

Features

  • duploctl plugin – registers as a duploctl resource via entry points; run with duploctl mcp
  • Automatic tool discovery – all duploctl @Command methods are registered as MCP tools at startup
  • Resource and command filtering – regex-based filters to control which tools are exposed
  • Pydantic model integration – commands with models get typed input schemas instead of raw dicts
  • Config display – built-in config tool and GET /config route showing live server state
  • Custom tool/route framework – @custom_tool and @custom_route decorators with context injection
  • Dual transport – stdio (default) or HTTP for persistent servers

Prerequisites

  • Python 3.10+
  • DuploCloud credentials (DUPLO_HOST, DUPLO_TOKEN)
  • A DuploCloud tenant (DUPLO_TENANT)

Installation

pip install duplocloud-mcp

For pinned version installs and alternative methods (GitHub release artifact, git tag), see the release notes.

For development:

git clone https://github.com/duplocloud/mcp.git
cd mcp
pip install -e ".[test]"

Quick Start

Set your DuploCloud credentials and start the server:

export DUPLO_HOST="https://your-portal.duplocloud.net"
export DUPLO_TOKEN="your-token"
export DUPLO_TENANT="your-tenant"

duploctl mcp

By default the server starts in stdio transport with compact mode (5 tools). To use HTTP:

duploctl mcp --transport http

Verify it’s running:

curl http://localhost:8000/health
# {"status":"healthy","service":"duplocloud-mcp"}

curl http://localhost:8000/config
# Full server configuration including registered tools

Configuration

在 GitHub 查看完整 README

安装

docker run -e DUPLO_HOST=... -e DUPLO_TOKEN=... -e DUPLO_TENANT=... duplocloud-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "duploctl": { "command": "duploctl", "args": ["mcp"], "env": { "DUPLO_HOST": "https://your-portal.duplocloud.net", "DUPLO_TOKEN": "your-token", "DUPLO_TENANT": "your-tenant" } } } }