Skip to content
Merged
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
9 changes: 5 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ 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`, 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`,
`freightright_list_shipment_documents`, `freightright_get_shipment_document` and
Expand Down
12 changes: 10 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

```
.claude-plugin/marketplace.json the marketplace Claude Code reads
gemini-extension.json the Gemini CLI extension gallery manifest (repository root)
GEMINI.md connector facts Gemini CLI loads with the extension
skills -> plugins/freightright/skills
Gemini CLI reads skills/<name>/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
Expand All @@ -29,6 +33,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) |

Expand Down Expand Up @@ -153,15 +158,18 @@ 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.
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

Expand Down
10 changes: 10 additions & 0 deletions GEMINI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Freight Right

This extension connects Gemini CLI to the Freight Right MCP connector at
`https://mcp.freightright.com/mcp` over streamable HTTP. Sign in with
`/mcp auth freightright` and a Shipment Manager account. There is no API key.

The tool timeout is 60 seconds. A price check asks carriers live and can take that long.

The skills shipped with this extension are the workflow. The connector documentation is at
<https://developers.freightright.com>.
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

<p>Freight rates, quote requests and shipment tracking from your Freight Right account.</p>

<p><b>Claude Code · Codex · GitHub Copilot CLI · Cursor · Grok · Muse Code</b></p>
<p><b>Claude Code · Codex · GitHub Copilot CLI · Cursor · Gemini CLI · Grok · Muse Code</b></p>

<p>
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-1e3063">
<img alt="Model Context Protocol" src="https://img.shields.io/badge/MCP-streamable%20HTTP-1e3063">
<img alt="Auth: OAuth 2.1 + PKCE" src="https://img.shields.io/badge/auth-OAuth%202.1%20%2B%20PKCE-1e3063">
<img alt="Clients: Claude Code, Codex, Copilot CLI, Cursor, Grok, Muse Code" src="https://img.shields.io/badge/clients-Claude%20Code%20%7C%20Codex%20%7C%20Copilot%20%7C%20Cursor%20%7C%20Grok%20%7C%20Muse-1e3063">
<img alt="Clients: Claude Code, Codex, Copilot CLI, Cursor, Gemini CLI, Grok, Muse Code" src="https://img.shields.io/badge/clients-Claude%20Code%20%7C%20Codex%20%7C%20Copilot%20%7C%20Cursor%20%7C%20Gemini%20%7C%20Grok%20%7C%20Muse-1e3063">
</p>

</div>
Expand Down Expand Up @@ -148,6 +148,24 @@ 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**

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
Comment thread
hanryuken marked this conversation as resolved.
Resolved
```

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).

### Supported clients

| Client | Installs | Skills work |
Expand All @@ -156,14 +174,17 @@ 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 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 |

Each client is given a manifest at the path it looks for, rather than being made to fall through to another
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`. 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
Expand Down
13 changes: 13 additions & 0 deletions gemini-extension.json
Original file line number Diff line number Diff line change
@@ -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"
}
10 changes: 9 additions & 1 deletion scripts/selftest.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -38,6 +38,14 @@ 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 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) =>
Expand Down
3 changes: 2 additions & 1 deletion scripts/set-version.mjs
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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) {
Expand Down
44 changes: 42 additions & 2 deletions scripts/validate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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`.

Expand Down Expand Up @@ -216,6 +216,46 @@ 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');
// Gemini CLI loads skills/<name>/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 {
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;
Expand Down
1 change: 1 addition & 0 deletions skills
Loading