PHPackages                             cipi-sh/api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. cipi-sh/api

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

cipi-sh/api
===========

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

1.6.10(1mo ago)50MITPHPPHP ^8.3

Since Mar 5Pushed 2w agoCompare

[ Source](https://github.com/cipi-sh/api)[ Packagist](https://packagist.org/packages/cipi-sh/api)[ RSS](/packages/cipi-sh-api/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (4)Versions (16)Used By (0)

Cipi API
========

[](#cipi-api)

Laravel package that exposes a REST API, an MCP server, and Swagger documentation for the [Cipi](https://cipi.sh) server control panel.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 12+

Installation
------------

[](#installation)

```
composer require 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
--------

[](#features)

- **REST API** — CRUD for apps, aliases, databases, SSL, and async jobs (`/api/*`), secured with Laravel Sanctum and token abilities. App create supports optional Git for **custom** apps (SFTP-only), matching Cipi 4.4.4+. Apps can also be taken offline and restored with **suspend / unsuspend** (HTTP 503 maintenance page), matching Cipi 4.5.8+.
- **MCP Server** — Model Context Protocol endpoint at `/mcp` for AI-powered integrations.
- **Swagger Docs** — Interactive API reference at `/docs`, generated from `public/api-docs/openapi.json`. The spec covers apps, aliases, deploy, SSL, databases (`GET /api/dbs` via `cipi db list`; other `/api/dbs/*` actions use jobs), and job polling (including structured `result` types per job).
- **Artisan Commands** — `cipi:token-create`, `cipi:token-list`, `cipi:token-revoke`.

MCP Integration
---------------

[](#mcp-integration)

The MCP server is exposed at `/mcp` using [Streamable HTTP](https://modelcontextprotocol.io/) 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

[](#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

[](#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

[](#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

[](#available-mcp-tools)

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

ToolDescription`AppList`List all apps with domains, PHP versions, and aliases`AppShow`Show details of a specific app`AppCreate`Create a new app (`custom` for non-Laravel apps; optional Git for custom SFTP-only sites, Cipi 4.4.4+)`AppEdit`Edit an existing app`AppDelete`Delete an app`AppDeploy`Deploy an app`AppDeployRollback`Rollback the last deploy`AppDeployUnlock`Unlock a stuck deploy`AppSuspend`Take an app offline (HTTP 503) without deleting it`AppUnsuspend`Bring a suspended app back online`AliasList`List aliases for an app`AliasAdd`Add an alias to an app`AliasRemove`Remove an alias from an app`DbList`List all databases with their sizes`DbCreate`Create a new database with auto-generated credentials`DbDelete`Permanently delete a database`DbBackup`Create a compressed backup of a database`DbRestore`Restore a database from a backup file`DbPassword`Regenerate database password and update `.env``SslInstall`Install an SSL certificate for an appConfiguration
-------------

[](#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`.

`GET /api/dbs` runs **`sudo cipi db list`** on the host (synchronously), like the Cipi server CLI: vault and MariaDB access stay inside Cipi, not duplicated in PHP.

**Why other API actions worked but `db` failed:** Cipi configures **`/etc/sudoers.d/cipi-api`** so `www-data` may run **`NOPASSWD`** only for an explicit list of `cipi` subcommands (`app`, `deploy`, `alias`, `ssl`, …). Database commands were missing from that whitelist until **Cipi 4.4.17**, so `sudo` tried to ask for a password and failed without a TTY (`sudo: a terminal is required`). Update the server with **`cipi self-update`** (applies migration 4.4.17) or add the `cipi db …` lines to `cipi-api` sudoers manually (see Cipi `setup.sh`).

License
-------

[](#license)

MIT

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance93

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

14

Last Release

57d ago

PHP version history (2 changes)1.0.0PHP ^8.2

1.5PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/449a18cf58263a03f804b68077a817e79b50bc24a6764e67242a3bcad337acdd?d=identicon)[cipi](/maintainers/cipi)

---

Top Contributors

[![andreapollastri](https://avatars.githubusercontent.com/u/18210420?v=4)](https://github.com/andreapollastri "andreapollastri (29 commits)")

---

Tags

aiapiapi-restautomationcipicrudintegrationlaravellemplinuxmanagementmcpmcp-servermonitoringopenapiphpserverswaggertoken-based-authenticationvpsapilaravelmcpserverdeploycipi

### Embed Badge

![Health badge](/badges/cipi-sh-api/health.svg)

```
[![Health](https://phpackages.com/badges/cipi-sh-api/health.svg)](https://phpackages.com/packages/cipi-sh-api)
```

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.3k2.2k](/packages/unopim-unopim)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14844.4k1](/packages/guanguans-laravel-exception-notify)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6753.6k5](/packages/hasinhayder-tyro)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[lucianotonet/laravel-telescope-mcp

MCP Server extension for Laravel Telescope

2019.6k](/packages/lucianotonet-laravel-telescope-mcp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
