Cipi API — REST API, MCP server, and Swagger docs for the Cipi server control panel

Maintainers

Package info

github.com/andreapollastri/cipi-api

pkg:composer/andreapollastri/cipi-api

Statistics

Installs: 12

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-03-05 23:33 UTC

This package is auto-updated.

Last update: 2026-03-05 23:34:40 UTC


README

Laravel package that exposes a REST API, an MCP server, and Swagger documentation for the Cipi server control panel.

Requirements

  • PHP 8.2+
  • Laravel 12+

Installation

composer require andreapollastri/cipi-api

Publish the configuration and assets:

php artisan vendor:publish --tag=cipi-config
php artisan vendor:publish --tag=cipi-assets
php artisan migrate

Seed the API user and create a token:

php artisan cipi:seed-api-user
php artisan cipi:token-create

Features

  • REST API — CRUD for apps, aliases, SSL, and async jobs (/api/*), secured with Laravel Sanctum and token abilities.
  • MCP Server — Model Context Protocol endpoint at /mcp for AI-powered integrations.
  • Swagger Docs — Interactive API reference available at /docs.
  • Artisan Commandscipi:token-create, cipi:token-list, cipi:token-revoke.

MCP Integration

The MCP server is exposed at /mcp using Streamable HTTP transport and is secured with the same Sanctum token used by the REST API (the token must have the mcp-access ability).

Generate a token if you haven't already:

php artisan cipi:token-create

Replace https://your-server.com and YOUR_TOKEN in the examples below with your actual Cipi host and token.

VS Code

Create (or edit) .vscode/mcp.json in your workspace:

{
  "inputs": [
    {
      "type": "promptString",
      "id": "cipi-token",
      "description": "Cipi API Token",
      "password": true
    }
  ],
  "servers": {
    "cipi-api": {
      "type": "http",
      "url": "https://your-server.com/mcp",
      "headers": {
        "Authorization": "Bearer ${input:cipi-token}"
      }
    }
  }
}

Restart VS Code after adding the configuration. The token will be requested on first connection and securely stored.

Cursor

Create (or edit) .cursor/mcp.json in your project root:

{
  "mcpServers": {
    "cipi-api": {
      "url": "https://your-server.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_TOKEN"
      }
    }
  }
}

Restart Cursor after adding the configuration (Cursor v0.40+).

Claude Code

Run the following command from your terminal:

claude mcp add --transport http cipi-api https://your-server.com/mcp \
  --header "Authorization: Bearer YOUR_TOKEN"

Verify the server is connected:

claude mcp list

Available MCP Tools

Once connected, the following tools are available to the AI agent:

Tool Description
AppList List all apps with domains, PHP versions, and aliases
AppShow Show details of a specific app
AppCreate Create a new app
AppEdit Edit an existing app
AppDelete Delete an app
AppDeploy Deploy an app
AppDeployRollback Rollback the last deploy
AppDeployUnlock Unlock a stuck deploy
AliasList List aliases for an app
AliasAdd Add an alias to an app
AliasRemove Remove an alias from an app
SslInstall Install an SSL certificate for an app

Configuration

This package is automatically installed and configured by cipi api. No manual setup is needed.

The CIPI_APPS_JSON env variable defaults to /etc/cipi/apps.json.

License

MIT