publish

plugport-ai/publish Checked 2 days ago

GitHub Action: import your OpenAPI spec into Plugport and publish a new version of your MCP server on every release.

A GitHub Action that keeps your Plugport MCP server in step with your API: on every release it imports your OpenAPI spec, waits for the import, and publishes a new version of the server's tools. Re-imports never undo your curation in Plugport: new operations become tools, removed ones are flagged, changed ones are refreshed, and your edits (names, descriptions, hidden arguments, toolsets) win over the spec. The job's summary lists the operations added, removed and changed; the import's warnings (operations Plugport couldn't use, missing descriptions) show as annotations.

Summary extracted from the README.

Publish to Plugport

A GitHub Action that keeps your Plugport MCP server in step with your API: on every release it imports your OpenAPI spec, waits for the import, and publishes a new version of the server's tools.

Re-imports never undo your curation in Plugport: new operations become tools, removed ones are flagged, changed ones are refreshed, and your edits (names, descriptions, hidden arguments, toolsets) win over the spec.

name: Release
on:
  push:
    tags: ["v*"]

jobs:
  mcp:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: plugport-ai/publish@v1
        with:
          key: ${{ secrets.PLUGPORT_KEY }}
          server: srv_01hx…            # your server's ID
          spec: openapi.yaml

The job's summary lists the operations added, removed and changed; the import's warnings (operations Plugport couldn't use, missing descriptions) show as annotations.

The server's policy, kept with your code

A server's policy decides which tool calls go through: rules in order, each a CEL condition and allow or deny, with tests that must pass. Keep it next to your spec and the action applies it once the import is ready and before publishing, so its tests run on the tools the release brings:

      - uses: plugport-ai/publish@v1
        with:
          key: ${{ secrets.PLUGPORT_KEY }}
          server: srv_01hx…
          spec: openapi.yaml
          policy: plugport-policy.json
{
  "default": "allow",
  "rules": [
    {
      "name": "keys never delete",
      "when": "caller.kind == \"key\" && tool.destructive",
      "effect": "deny",
      "message": "Deleting needs a person: do it in the dashboard."
    }
  ],
  "tests": [
    { "name": "keys can't delete", "call": { "tool": "delete_invoice", "caller": { "kind": "key" } }, "expect": "deny" },
    { "name": "keys list", "call": { "tool": "list_invoices", "caller": { "kind": "key" } }, "expect": "allow" }
  ]
}

With publish: false (a pull request), the policy is only checked: its rules must compile and its tests pass, and nothing changes on the server. A rule that doesn't compile or a failing test shows as an annotation and fails the step.

Setup

  1. In Plugport, open the server's project → API keys and create a secret key with the read and write scopes.
  2. Add it to your repository as a secret: Settings → Secrets and variables → Actions → New repository secret, named PLUGPORT_KEY.
  3. Copy the server's ID (srv_…) from its settings.

More ways to use it

Import from a URL instead of a file in the repository:

      - uses: plugport-ai/publish@v1
        with:
          key: ${{ secrets.PLUGPORT_KEY }}
          server: srv_01hx…
          spec-url: https://api.example.com/openapi.json

Check a pull request's spec without publishing, and fail on warnings. An import updates the server's tools even when nothing is published, so point this at a staging server, not the one your customers use:

on: pull_request
jobs:
  mcp:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: plugport-ai/publish@v1
        with:
          key: ${{ secrets.PLUGPORT_KEY }}
          server: srv_01hz…            # a staging server
          spec: openapi.yaml
          publish: false
          fail-on-warnings: true

Publish against a sandbox environment, and use the version afterwards:

      - uses: plugport-ai/publish@v1
        id: plugport
        with:
          key: ${{ secrets.PLUGPORT_KEY }}
          server: srv_01hx…
          spec: openapi.yaml
          environment: env_01hy…
          notes: ${{ github.event.head_commit.message }}
      - run: echo "Published version ${{ steps.plugport.outputs.version-number }} with ${{ steps.plugport.outputs.tools }} tools"

Inputs

Input Required Default
key yes A pp_sk_ key of the server's project with the read and write scopes. Keep it in a secret.
server yes The server's ID (srv_…).
spec one of Path to your OpenAPI 3.0/3.1 or Swagger 2.0 document, JSON or YAML, one file (up to 10 MB).
spec-url one of Or its https URL, for Plugport to fetch.
publish true Publish a version once the import is ready; false only imports.
environment the server's default The environment (env_…) the new version calls.
notes repository, commit and ref The version's release notes.
policy Path to the server's policy (JSON: default, rules, tests); applied before publishing, only checked with publish: false.
fail-on-warnings false Fail, and publish nothing, when the import reports warnings.
timeout 300 Seconds to wait for the import.
api-url https://api.plugport.ai Plugport's API.

Outputs

Output
spec The import's ID (spec_…).
version The published version's ID (ver_…); empty when publish is false.
version-number The published version's number.
tools How many tools the published version serves.
added, removed, changed How many operations the import added, removed and changed.

Notes

  • Publishing serves the new version at once. To go back, activate an earlier version in Plugport; who may call the server and its credentials don't change with versions.
  • One import runs at a time per server: when another is running, the action waits for it.
  • A policy applies at once, to the version being served too, and survives rollbacks: it's the server's, not a version's.
  • The key is masked in the logs, and is only ever sent to api-url.
  • The action has no dependencies; it runs on Linux, macOS and Windows runners.

License

MIT