Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/gemini-extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Checks the Gemini CLI extension manifest (gemini-extension.json).
#
# Gemini CLI installs the extension from the latest release's source tarball and
# expects the manifest version to match the release tag. Releases bump the
# version in Cargo.toml, so this fails any change where the two disagree.

name: Gemini extension

on:
push:
branches:
- master
paths:
- "gemini-extension.json"
- "GEMINI.md"
- "Cargo.toml"
- ".github/workflows/gemini-extension.yml"
pull_request:
branches:
- master
paths:
- "gemini-extension.json"
- "GEMINI.md"
- "Cargo.toml"
- ".github/workflows/gemini-extension.yml"

permissions:
contents: read

jobs:
check:
name: Check manifest
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: Check manifest
shell: bash
run: |
set -euo pipefail
manifest=gemini-extension.json

jq -e . "$manifest" > /dev/null

cargo_version="$(sed -n 's/^version = "\(.*\)"$/\1/p' Cargo.toml | head -n1)"
manifest_version="$(jq -r '.version' "$manifest")"
if [[ "$manifest_version" != "$cargo_version" ]]; then
echo "::error file=$manifest::version is $manifest_version but Cargo.toml is $cargo_version. Bump both together."
exit 1
Comment thread
salmanfarisvp marked this conversation as resolved.
Resolved
fi

context_file="$(jq -r '.contextFileName // "GEMINI.md"' "$manifest")"
if [[ ! -f "$context_file" ]]; then
echo "::error file=$manifest::contextFileName $context_file does not exist"
exit 1
fi

# Gemini only passes declared settings to the server, and an empty
# API_TOKEN would override ~/.screenly, so the token must be declared.
jq -e '.settings | any(.envVar == "API_TOKEN" and .sensitive == true)' "$manifest" > /dev/null \
|| { echo "::error file=$manifest::API_TOKEN must be declared as a sensitive setting"; exit 1; }

echo "gemini-extension.json $manifest_version OK"
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,41 @@ on:
- "v*"

jobs:
check-version:
name: check-version
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

# Gemini CLI compares gemini-extension.json's version with the release tag,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to have. 2. Gemini doesn't compare the manifest version with the tag

  • What this is: This comment (and the description) says Gemini compares gemini-extension.json's version with the release tag.
  • Problem: It doesn't. In gemini-cli 0.71.1, update detection for GitHub-release installs is releaseData.tag_name !== releaseTag only, and the docs (docs/extensions/releasing.md, "Sync manifest and tags") say the CLI ignores the manifest version and only shows it in the UI. So a mismatch is cosmetic; nothing gets rejected.
  • Fix: Reword to "Gemini shows the manifest version in its UI, so keep it equal to the tag and Cargo.toml." The check itself is fine to keep as hygiene.
  • If we skip it: The next person treats a version mismatch as install-breaking and debugs the wrong thing.

# so a stable tag must match it and Cargo.toml before anything is built.
# Prerelease tags (v1.2.3-rc1) are skipped: Gemini installs only the
# release marked Latest.
- name: Check tag matches Cargo.toml and gemini-extension.json
shell: bash
env:
TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
if [[ "$TAG" == *-* ]]; then
echo "Prerelease tag $TAG; skipping version check"
exit 0
fi
tag_version="${TAG#v}"
cargo_version="$(sed -n 's/^version = "\(.*\)"$/\1/p' Cargo.toml | head -n1)"
manifest_version="$(jq -r '.version' gemini-extension.json)"
if [[ "$cargo_version" != "$tag_version" || "$manifest_version" != "$tag_version" ]]; then
echo "::error::Tag $TAG does not match Cargo.toml ($cargo_version) and gemini-extension.json ($manifest_version)"
exit 1
fi
echo "Tag $TAG matches Cargo.toml and gemini-extension.json"

build-release:
name: deploy
needs: check-version
permissions:
contents: write
id-token: write
Expand Down
33 changes: 33 additions & 0 deletions GEMINI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Screenly

The `screenly` MCP server manages a Screenly digital signage network: screens,
assets, asset groups, playlists, labels, shared playlists and Edge Apps. It runs
the official Screenly CLI (`screenly mcp`), which must be installed and on
`PATH`. See https://github.com/Screenly/cli#installation.

## How content reaches a screen

1. An **asset** is a piece of content: a web page, image or video
(`asset_create` takes a public URL).
2. A **playlist** holds assets as **playlist items**, each with a duration and
position. A playlist's **predicate** decides when it plays; the server's
instructions describe the predicate syntax.
3. **Labels** connect playlists to screens: link the same label to a playlist
(`label_link_playlist`) and to screens (`label_link_screen`).

To put HTML (for example a dashboard you just wrote) on screens, use
`edge_app_publish_from_html`, not `asset_create`.

## Working safely

- Prefer list and get tools to look things up before changing anything, and
refer to objects by UUID.
- Confirm with the user before any `*_delete` tool. `asset_group_delete` also
deletes every asset in the group.
- Changes apply to live screens right away, so state what will change before
making updates to playlists, labels or assets that are already in use.

## Authentication

The server reads the `API_TOKEN` setting provided when this extension was
installed. To change it, run `gemini extensions config screenly`.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ Details: [`mcpb/README.md`](mcpb/README.md).

The token is stored in your operating system's keychain rather than a plaintext config file.

#### Gemini CLI

Install the Screenly CLI first (see [Installation](#installation)), then add the extension:

```bash
$ gemini extensions install https://github.com/Screenly/cli
```

Gemini CLI asks for your API token during install and keeps it in your system keychain.
To change it later, run `gemini extensions config screenly`.

#### Cursor / other clients

Add to your MCP configuration file:
Expand Down
23 changes: 23 additions & 0 deletions gemini-extension.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "screenly",
"version": "26.11.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should fix. 1. Install is broken until the next release, and v26.11.0 is already tagged

  • What this is: Gemini installs from the source tarball of the release marked Latest, so the manifest must be inside a tagged release. The description's plan is to tag v26.11.0 after merge.
  • Problem: v26.11.0 already exists (b12710b, the Bump version to 26.11.0 #333 merge) and is Latest, and its tarball has no manifest. Running the README command now fails: Configuration file not found at /tmp/gemini-extension…/gemini-extension.json (tested with gemini-cli 0.71.1). The next tag will be v26.11.1 or later (Release: don't cancel the matrix on one failure; pin Windows targets to Rust 1.98 #336 needs one too), and check-version will then fail the whole release unless this file and Cargo.toml are bumped together.
  • Fix: Bump Cargo.toml and this version to the next release (e.g. 26.11.1) in the release PR that ships Release: don't cancel the matrix on one failure; pin Windows targets to Rust 1.98 #336, and change "After merge" step 2 to that tag. Optionally hold the README section until that release is out.
  • If we skip it: The README tells users to run a command that fails, and the first person to follow "tag v26.11.0" finds the tag taken.

"description": "Manage your Screenly digital signage network: screens, playlists, assets, labels and Edge Apps.",
"contextFileName": "GEMINI.md",
"mcpServers": {
"screenly": {
"command": "screenly",
"args": ["mcp"],
"env": {
"API_TOKEN": "${API_TOKEN}"
}
}
},
"settings": [
{
"name": "Screenly API Token",
"description": "API token for your Screenly team. Create one in your Screenly workspace under Settings > Security > API tokens.",
"envVar": "API_TOKEN",
"sensitive": true
}
]
}
Loading