Repository navigation
Add a Gemini CLI extension for the MCP server #335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
55d34de
9f54cbf
e3a42c3
9140541
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
| 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" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
|
||
| # 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 | ||
|
|
||
| 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`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "name": "screenly", | ||
| "version": "26.11.0", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
|
||
| "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 | ||
| } | ||
| ] | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.