From f0c2cca6c2ed6f88699b0dd7b3682d35085cf1b8 Mon Sep 17 00:00:00 2001 From: Han Ryoo Date: Wed, 4 Nov 2026 10:28:06 -0800 Subject: [PATCH 1/2] feat: list the Freight Right MCP connector in the Gemini CLI extension gallery Add a root gemini-extension.json for https://mcp.freightright.com/mcp with dynamic OAuth discovery, GEMINI.md context, README install steps, and validator coverage so the gallery listing stays pinned to production. Co-authored-by: Cursor --- AGENTS.md | 9 +++++---- CHANGELOG.md | 4 ++++ CONTRIBUTING.md | 7 +++++-- GEMINI.md | 21 +++++++++++++++++++++ README.md | 22 +++++++++++++++++++--- gemini-extension.json | 13 +++++++++++++ scripts/selftest.mjs | 4 ++++ scripts/set-version.mjs | 3 ++- scripts/validate.mjs | 34 +++++++++++++++++++++++++++++++++- 9 files changed, 106 insertions(+), 11 deletions(-) create mode 100644 GEMINI.md create mode 100644 gemini-extension.json diff --git a/AGENTS.md b/AGENTS.md index 08e2be7..6938168 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,8 +4,9 @@ - This repository is public. It must never contain credentials, customer data, internal ticket identifiers, or a hostname belonging to a development or staging environment. -- `plugins/freightright/.mcp.json` must carry exactly `https://mcp.freightright.com/mcp`. The validator pins this - string. To test against development, copy the plugin elsewhere and change the copy. +- `plugins/freightright/.mcp.json` and the root `gemini-extension.json` must carry exactly + `https://mcp.freightright.com/mcp`. The validator pins this string. To test against development, copy the plugin + elsewhere and change the copy. ## Source of truth @@ -22,5 +23,5 @@ stays inside the portable Agent Skills fields, and that every eval grader names ## Releases -Bump the version in both manifests, refresh the contract, run the evals, and record the tested commit. Details in -CONTRIBUTING.md. +Bump the version with `npm run set-version`, refresh the contract, run the evals, and record the tested commit. +Details in CONTRIBUTING.md. diff --git a/CHANGELOG.md b/CHANGELOG.md index acbb744..d4e4848 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ All notable changes to this plugin are documented here. The format follows ### Added +- Gemini CLI extension gallery listing: root `gemini-extension.json` pointing at + `https://mcp.freightright.com/mcp` with `authProviderType: dynamic_discovery`, a short `GEMINI.md`, and install + steps in the README. The gallery also needs the `gemini-cli-extension` GitHub topic after merge. + - A shipment's billing, customs and documents, the customer's invoices across shipments, and the feed of what changed: `freightright_get_shipment_billing`, `freightright_get_shipment_customs`, `freightright_list_invoices`, `freightright_list_shipment_documents`, `freightright_get_shipment_document` and diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9fddec7..a67e3cf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,6 +4,8 @@ ``` .claude-plugin/marketplace.json the marketplace Claude Code reads +gemini-extension.json the Gemini CLI extension gallery manifest (repository root) +GEMINI.md short context Gemini CLI loads with the extension contract/tools.json a snapshot of the connector's real tool surface, with the fr-mcp revision plugins/freightright/ plugin.json portable manifest @@ -29,6 +31,7 @@ prefer installing that way. | Codex CLI | `.agents/plugins/marketplace.json` | `.codex-plugin/plugin.json` | | Copilot CLI | `.github/plugin/marketplace.json` | root `plugin.json` | | Cursor | `.cursor-plugin/marketplace.json` | `.cursor-plugin/plugin.json` | +| Gemini CLI | GitHub topic `gemini-cli-extension` after merge | root `gemini-extension.json` | | Grok | none — it scans `plugins/*/` | root `plugin.json` (the portable manifest) | | Muse Code | `.agents/plugins/marketplace.json` or `.claude-plugin/marketplace.json`, whichever it finds first | root `plugin.json` (the portable manifest) | @@ -153,11 +156,11 @@ release; see `plugins/freightright/evals/README.md`. python scripts/export_contract.py --fr-mcp ../fr-mcp ``` If a tool was added, removed or renamed, update the skills and the mocks, and say so in the changelog. -2. Bump the version. Eight files state it, in four different shapes, so there is one command and no hand-editing: +2. Bump the version. Nine files state it, in several shapes, so there is one command and no hand-editing: ```sh npm run set-version -- 0.2.0 ``` - The validator checks all eight agree. A bump makes an update *detectable*; it does not update anyone + The validator checks all nine agree. A bump makes an update *detectable*; it does not update anyone automatically — each client has its own update action. 3. Run the eval suite on a pinned model with three trials, and record the model and commit — the gate refuses to run without both. diff --git a/GEMINI.md b/GEMINI.md new file mode 100644 index 0000000..d1661d9 --- /dev/null +++ b/GEMINI.md @@ -0,0 +1,21 @@ +# Freight Right for Gemini CLI + +This extension connects Gemini CLI to the Freight Right MCP connector at +`https://mcp.freightright.com/mcp` over streamable HTTP. Authentication is OAuth 2.1 with PKCE and +dynamic client registration: run `/mcp auth freightright` and sign in with your Shipment Manager +account. There is no API key to paste. + +Set the tool timeout to at least 60 seconds. A price check asks carriers live and a slow lane +takes that long. + +## What it is for + +- Live freight prices for FCL, LCL, AIR and LTL, and quote requests when a live price is not enough +- Preparing a booking confirmation link the customer submits themselves +- Finding shipments and reading their milestones + +Nothing here books freight. An offer is a price, valid only until its `valid_until`. Call +`freightright_get_connection_status` and `freightright_get_account` before the first price check or +quote request of a conversation so billing and permissions are clear. + +The connector documentation is at . diff --git a/README.md b/README.md index 5bf325a..db33ab0 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@

Freight rates, quote requests and shipment tracking from your Freight Right account.

-

Claude Code · Codex · GitHub Copilot CLI · Cursor · Grok · Muse Code

+

Claude Code · Codex · GitHub Copilot CLI · Cursor · Gemini CLI · Grok · Muse Code

License: MIT Model Context Protocol Auth: OAuth 2.1 + PKCE - Clients: Claude Code, Codex, Copilot CLI, Cursor, Grok, Muse Code + Clients: Claude Code, Codex, Copilot CLI, Cursor, Gemini CLI, Grok, Muse Code

@@ -148,6 +148,19 @@ Cursor takes a full git URL rather than `owner/repo`, and indexes the default br *From the Cursor marketplace*: once the listing is live, install with one click and no URL to paste. +**Gemini CLI** + +```sh +gemini extensions install https://github.com/freight-right/agent-plugins +``` + +Then in a session run `/mcp auth freightright` and sign in with your Shipment Manager account. Gemini CLI discovers +the OAuth endpoints from the connector and registers a client dynamically — there is no client id or secret in this +repository. The extension's tool timeout is already set to 60 seconds. + +Once the repository carries the `gemini-cli-extension` GitHub topic, the same extension appears in the +[Gemini CLI extension gallery](https://geminicli.com/extensions). + ### Supported clients | Client | Installs | Skills work | @@ -156,6 +169,7 @@ Cursor takes a full git URL rather than `owner/repo`, and indexes the default br | Codex CLI 0.155.1 | Verified | Verified | | Copilot CLI 1.0.87 | Verified | Verified | | Cursor 2.2.44 | Verified | Verified | +| Gemini CLI | Pending interactive check | Extension context only | | Grok 1.0.40 | Verified | Verified | | Muse Code 1.3.0 | Verified, behind `MUSE_EXPERIMENTAL_PLUGINS` | Verified | @@ -163,7 +177,9 @@ Each client is given a manifest at the path it looks for, rather than being made vendor's directory. Grok and Muse Code are the exceptions that prove the point: both read the open [Agent Plugins](https://agent-plugins.org) manifest — Muse Code reads the Codex or Claude Code catalog as well — so neither needs anything of its own. Muse Code installs the skills only: its plugin format cannot carry an authenticated -MCP server yet, which is why its install ends in a settings entry and a sign-in. +MCP server yet, which is why its install ends in a settings entry and a sign-in. Gemini CLI reads the root +`gemini-extension.json` and `GEMINI.md`; the Agent Plugins skills stay under `plugins/freightright/skills/` for the +other clients. The production connector the plugin ships, `https://mcp.freightright.com/mcp`, is live: Freight Right's scripted canary — a registered MCP client that signs in through the same OAuth flow these clients use — completes the sign-in diff --git a/gemini-extension.json b/gemini-extension.json new file mode 100644 index 0000000..31f7253 --- /dev/null +++ b/gemini-extension.json @@ -0,0 +1,13 @@ +{ + "name": "freightright", + "version": "0.2.0", + "description": "Freight rates, quote requests, and shipment tracking with billing, customs, documents and a feed of what changed, from your Freight Right account, with skills that keep billing and bookings right.", + "mcpServers": { + "freightright": { + "httpUrl": "https://mcp.freightright.com/mcp", + "authProviderType": "dynamic_discovery", + "timeout": 60000 + } + }, + "contextFileName": "GEMINI.md" +} diff --git a/scripts/selftest.mjs b/scripts/selftest.mjs index 1c36683..2b97d43 100644 --- a/scripts/selftest.mjs +++ b/scripts/selftest.mjs @@ -38,6 +38,10 @@ const VALIDATOR_CASES = [ json(d, 'plugins/freightright/.mcp.json', (v) => { v.mcpServers.freightright.url = 'https://dev-mcp.sm.freightright.com/mcp'; })], + ['a Gemini CLI connector URL that is not production', (d) => + json(d, 'gemini-extension.json', (v) => { + v.mcpServers.freightright.httpUrl = 'https://dev-mcp.sm.freightright.com/mcp'; + })], ['a client manifest drifting from the others', (d) => json(d, '.cursor-plugin/marketplace.json', (v) => { v.metadata.version = '9.9.9'; })], ['a tool with no mock, which would make a must-not-call check vacuous', (d) => diff --git a/scripts/set-version.mjs b/scripts/set-version.mjs index 498216f..c5c095a 100644 --- a/scripts/set-version.mjs +++ b/scripts/set-version.mjs @@ -1,5 +1,5 @@ #!/usr/bin/env node -// One version lives in eight files. Bumping them by hand is how a release goes out inconsistent, so this is the +// One version lives in nine files. Bumping them by hand is how a release goes out inconsistent, so this is the // only supported way to do it. // // npm run set-version -- 0.2.0 @@ -27,6 +27,7 @@ const TARGETS = [ ['.claude-plugin/marketplace.json', (v) => { v.version = version; }], ['.github/plugin/marketplace.json', (v) => { v.version = version; }], ['.cursor-plugin/marketplace.json', (v) => { v.metadata.version = version; }], + ['gemini-extension.json', (v) => { v.version = version; }], ]; for (const [file, set] of TARGETS) { diff --git a/scripts/validate.mjs b/scripts/validate.mjs index cad4609..cf7a37f 100644 --- a/scripts/validate.mjs +++ b/scripts/validate.mjs @@ -58,7 +58,7 @@ const need = (path) => { // ------------------------------------------------- every client's manifest says the same thing, in its own shape // Each client is given its OWN file rather than being made to fall through to another vendor's path, and the shared -// `.claude-plugin/` file is kept because several clients happily read it. That means one fact lives in eight places, +// `.claude-plugin/` file is kept because several clients happily read it. That means one fact lives in many places, // so the check below is the thing that makes it safe: compare what each file MEANS, through an explicit accessor per // client, never by requiring the same field placement — Cursor nests under `metadata`, Codex under `interface`. @@ -216,6 +216,38 @@ if (portableMcp) { } } +// ------------------------------------------------ Gemini CLI reads a root-level gallery manifest, not a plugin path +// The gallery crawler looks for `gemini-extension.json` at the repository root. It is a ninth place the version and +// the connector URL live, so pin the same facts the other clients already share: name, version, description, and +// production `httpUrl` with dynamic OAuth discovery — no client id, secret or token. +const gemini = need('gemini-extension.json'); +if (gemini && portable) { + for (const field of ['name', 'version', 'description']) { + if (gemini[field] !== portable[field]) { + fail('gemini-extension.json', `\`${field}\` differs from the portable manifest`); + } + } + if (gemini.contextFileName !== 'GEMINI.md') { + fail('gemini-extension.json', 'contextFileName must be GEMINI.md'); + } + if (!existsSync(join(ROOT, 'GEMINI.md'))) fail('GEMINI.md', 'is missing'); + const server = gemini.mcpServers?.[SERVER_KEY]; + if (!server) fail('gemini-extension.json', `expected a server named "${SERVER_KEY}"`); + else { + if (server.httpUrl !== CONNECTOR_URL) { + fail('gemini-extension.json', `httpUrl must be exactly ${CONNECTOR_URL}`); + } + if (server.authProviderType !== 'dynamic_discovery') { + fail('gemini-extension.json', 'authProviderType must be "dynamic_discovery"'); + } + for (const secret of ['clientId', 'clientSecret', 'authorizationUrl', 'tokenUrl', 'issuer']) { + if (server[secret] != null || server.oauth?.[secret] != null) { + fail('gemini-extension.json', `do not ship \`${secret}\` — Gemini CLI discovers OAuth dynamically`); + } + } + } +} + // ---------------------------------------------------------------- nothing points at a non-production environment for (const path of files.filter((p) => !p.startsWith('.git/'))) { if (['CONTRIBUTING.md', 'AGENTS.md', 'scripts/validate.mjs', 'scripts/selftest.mjs'].includes(path)) continue; From 7809be9d9b41147094fe383f5432a3a491617eae Mon Sep 17 00:00:00 2001 From: Han Ryoo Date: Wed, 4 Nov 2026 12:21:33 -0800 Subject: [PATCH 2/2] fix: Gemini CLI installs the latest release, and loads the existing skills The install command was tracking v0.2.0, which has no manifest. Document that a GitHub Release tag is what Gemini installs and updates from, and point skills at the plugin skills so the gallery is not a second copy. Co-authored-by: Cursor --- CHANGELOG.md | 6 ++++-- CONTRIBUTING.md | 7 ++++++- GEMINI.md | 23 ++++++----------------- README.md | 17 +++++++++++------ scripts/selftest.mjs | 6 +++++- scripts/validate.mjs | 10 +++++++++- skills | 1 + 7 files changed, 42 insertions(+), 28 deletions(-) create mode 120000 skills diff --git a/CHANGELOG.md b/CHANGELOG.md index d4e4848..1a81d99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,10 @@ All notable changes to this plugin are documented here. The format follows ### Added - Gemini CLI extension gallery listing: root `gemini-extension.json` pointing at - `https://mcp.freightright.com/mcp` with `authProviderType: dynamic_discovery`, a short `GEMINI.md`, and install - steps in the README. The gallery also needs the `gemini-cli-extension` GitHub topic after merge. + `https://mcp.freightright.com/mcp` with `authProviderType: dynamic_discovery`, connector facts in `GEMINI.md`, + and the five skills through a `skills` symlink. Gemini CLI installs the latest GitHub Release, so a release tag + has to carry the manifest before the README install command works. The gallery also needs the + `gemini-cli-extension` GitHub topic after merge. - A shipment's billing, customs and documents, the customer's invoices across shipments, and the feed of what changed: `freightright_get_shipment_billing`, `freightright_get_shipment_customs`, `freightright_list_invoices`, diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a67e3cf..5ab4ae9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,9 @@ ``` .claude-plugin/marketplace.json the marketplace Claude Code reads gemini-extension.json the Gemini CLI extension gallery manifest (repository root) -GEMINI.md short context Gemini CLI loads with the extension +GEMINI.md connector facts Gemini CLI loads with the extension +skills -> plugins/freightright/skills + Gemini CLI reads skills//SKILL.md from the extension root contract/tools.json a snapshot of the connector's real tool surface, with the fr-mcp revision plugins/freightright/ plugin.json portable manifest @@ -165,6 +167,9 @@ release; see `plugins/freightright/evals/README.md`. 3. Run the eval suite on a pinned model with three trials, and record the model and commit — the gate refuses to run without both. 4. Update `CHANGELOG.md`. +5. Publish a GitHub Release whose tag is `v` plus the version, for example `v0.2.0`. Gemini CLI installs the + latest release, not the default branch, and it detects updates from that tag. A version that exists only as + commits does not reach Gemini CLI. The repository already has a release, so there is no clone fallback. ## Commits diff --git a/GEMINI.md b/GEMINI.md index d1661d9..1d5ab85 100644 --- a/GEMINI.md +++ b/GEMINI.md @@ -1,21 +1,10 @@ -# Freight Right for Gemini CLI +# Freight Right This extension connects Gemini CLI to the Freight Right MCP connector at -`https://mcp.freightright.com/mcp` over streamable HTTP. Authentication is OAuth 2.1 with PKCE and -dynamic client registration: run `/mcp auth freightright` and sign in with your Shipment Manager -account. There is no API key to paste. +`https://mcp.freightright.com/mcp` over streamable HTTP. Sign in with +`/mcp auth freightright` and a Shipment Manager account. There is no API key. -Set the tool timeout to at least 60 seconds. A price check asks carriers live and a slow lane -takes that long. +The tool timeout is 60 seconds. A price check asks carriers live and can take that long. -## What it is for - -- Live freight prices for FCL, LCL, AIR and LTL, and quote requests when a live price is not enough -- Preparing a booking confirmation link the customer submits themselves -- Finding shipments and reading their milestones - -Nothing here books freight. An offer is a price, valid only until its `valid_until`. Call -`freightright_get_connection_status` and `freightright_get_account` before the first price check or -quote request of a conversation so billing and permissions are clear. - -The connector documentation is at . +The skills shipped with this extension are the workflow. The connector documentation is at +. diff --git a/README.md b/README.md index db33ab0..41b188b 100644 --- a/README.md +++ b/README.md @@ -150,13 +150,18 @@ Cursor takes a full git URL rather than `owner/repo`, and indexes the default br **Gemini CLI** +Gemini CLI installs the latest GitHub Release, not the default branch. It clones the repository only when the +repository has no release at all. The current release does not contain `gemini-extension.json`, so this command +fails with `configuration file not found` until a release tag includes the manifest: + ```sh gemini extensions install https://github.com/freight-right/agent-plugins ``` -Then in a session run `/mcp auth freightright` and sign in with your Shipment Manager account. Gemini CLI discovers -the OAuth endpoints from the connector and registers a client dynamically — there is no client id or secret in this -repository. The extension's tool timeout is already set to 60 seconds. +After that release, run `/mcp auth freightright` and sign in with your Shipment Manager account. Gemini CLI +discovers the OAuth endpoints from the connector and registers a client dynamically. There is no client id or +secret in this repository. The extension's tool timeout is already set to 60 seconds. Later updates follow the +release tag. Once the repository carries the `gemini-cli-extension` GitHub topic, the same extension appears in the [Gemini CLI extension gallery](https://geminicli.com/extensions). @@ -169,7 +174,7 @@ Once the repository carries the `gemini-cli-extension` GitHub topic, the same ex | Codex CLI 0.155.1 | Verified | Verified | | Copilot CLI 1.0.87 | Verified | Verified | | Cursor 2.2.44 | Verified | Verified | -| Gemini CLI | Pending interactive check | Extension context only | +| Gemini CLI | Pending the next GitHub Release | The five skills, via a `skills` symlink | | Grok 1.0.40 | Verified | Verified | | Muse Code 1.3.0 | Verified, behind `MUSE_EXPERIMENTAL_PLUGINS` | Verified | @@ -178,8 +183,8 @@ vendor's directory. Grok and Muse Code are the exceptions that prove the point: [Agent Plugins](https://agent-plugins.org) manifest — Muse Code reads the Codex or Claude Code catalog as well — so neither needs anything of its own. Muse Code installs the skills only: its plugin format cannot carry an authenticated MCP server yet, which is why its install ends in a settings entry and a sign-in. Gemini CLI reads the root -`gemini-extension.json` and `GEMINI.md`; the Agent Plugins skills stay under `plugins/freightright/skills/` for the -other clients. +`gemini-extension.json` and `GEMINI.md`. Its `skills` directory is a symlink to `plugins/freightright/skills`, so +it loads the same five skills. The production connector the plugin ships, `https://mcp.freightright.com/mcp`, is live: Freight Right's scripted canary — a registered MCP client that signs in through the same OAuth flow these clients use — completes the sign-in diff --git a/scripts/selftest.mjs b/scripts/selftest.mjs index 2b97d43..4c5a178 100644 --- a/scripts/selftest.mjs +++ b/scripts/selftest.mjs @@ -3,7 +3,7 @@ // here was a real false pass at some point, so each one stays as a regression. import { execFileSync } from 'node:child_process'; -import { mkdtempSync, cpSync, rmSync, readFileSync, writeFileSync, readdirSync, existsSync } from 'node:fs'; +import { mkdtempSync, cpSync, rmSync, readFileSync, symlinkSync, writeFileSync, readdirSync, existsSync } from 'node:fs'; import { tmpdir } from 'node:os'; import { join, dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; @@ -42,6 +42,10 @@ const VALIDATOR_CASES = [ json(d, 'gemini-extension.json', (v) => { v.mcpServers.freightright.httpUrl = 'https://dev-mcp.sm.freightright.com/mcp'; })], + ['a Gemini CLI skills link that is not the plugin skills', (d) => { + rmSync(join(d, 'skills')); + symlinkSync('plugins/freightright/evals', join(d, 'skills')); + }], ['a client manifest drifting from the others', (d) => json(d, '.cursor-plugin/marketplace.json', (v) => { v.metadata.version = '9.9.9'; })], ['a tool with no mock, which would make a must-not-call check vacuous', (d) => diff --git a/scripts/validate.mjs b/scripts/validate.mjs index cf7a37f..c6505a5 100644 --- a/scripts/validate.mjs +++ b/scripts/validate.mjs @@ -3,7 +3,7 @@ // names really exists on the connector, that no skill has drifted outside the portable Agent Skills fields, and that // nothing here points at a development environment. -import { readFileSync, readdirSync, existsSync, statSync } from 'node:fs'; +import { readFileSync, readdirSync, existsSync, lstatSync, readlinkSync, statSync } from 'node:fs'; import { join, relative, dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; @@ -231,6 +231,14 @@ if (gemini && portable) { fail('gemini-extension.json', 'contextFileName must be GEMINI.md'); } if (!existsSync(join(ROOT, 'GEMINI.md'))) fail('GEMINI.md', 'is missing'); + // Gemini CLI loads skills//SKILL.md from the extension root. A symlink keeps one copy with the + // other clients. A real directory here would drift. + const skillsLink = join(ROOT, 'skills'); + if (!existsSync(skillsLink) || !lstatSync(skillsLink).isSymbolicLink()) { + fail('skills', 'must be a symlink to plugins/freightright/skills'); + } else if (readlinkSync(skillsLink) !== 'plugins/freightright/skills') { + fail('skills', 'must point at plugins/freightright/skills'); + } const server = gemini.mcpServers?.[SERVER_KEY]; if (!server) fail('gemini-extension.json', `expected a server named "${SERVER_KEY}"`); else { diff --git a/skills b/skills new file mode 120000 index 0000000..0297ad9 --- /dev/null +++ b/skills @@ -0,0 +1 @@ +plugins/freightright/skills \ No newline at end of file