Skip to content

Commit e2759ac

Browse files
authored
chore: run toolbox via npx instead of the bundled binary (#89)
1 parent 7046850 commit e2759ac

8 files changed

Lines changed: 27 additions & 173 deletions

File tree

‎.github/renovate.json5‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,20 @@
2121
pinDigests: true,
2222
},
2323
{
24-
matchPackageNames: ['googleapis/mcp-toolbox'],
25-
'semanticCommitType': 'feat'
24+
matchPackageNames: ['@toolbox-sdk/server'],
25+
// Group the toolbox update under a stable branch name (renovate/toolbox).
26+
groupName: 'toolbox',
27+
semanticCommitType: 'feat',
2628
}
2729
],
2830
customManagers: [
2931
{
32+
// Track the npm toolbox server pinned in the extension's MCP command.
3033
customType: "regex",
31-
managerFilePatterns: ["/toolbox_version\\.txt$/"],
32-
matchStrings: ["(?<currentValue>[\\d\\.]+)"],
33-
datasourceTemplate: "github-releases",
34-
packageNameTemplate: "googleapis/mcp-toolbox",
35-
extractVersionTemplate: "^v(?<version>.*)$",
34+
managerFilePatterns: ["/gemini-extension\\.json$/"],
35+
matchStrings: ["@toolbox-sdk/server@(?<currentValue>[\\d\\.]+)"],
36+
datasourceTemplate: "npm",
37+
depNameTemplate: "@toolbox-sdk/server",
3638
}
3739
]
3840
}

‎.github/workflows/mirror-changelog.yml‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@
1515
name: Mirror Toolbox Changelog
1616

1717
on:
18-
pull_request_target:
18+
# Fork Renovate PRs need a write token; safe (no PR-code checkout, API-only).
19+
pull_request_target: # zizmor: ignore[dangerous-triggers]
1920
types: [opened, edited]
2021

2122
jobs:
2223
add-release-notes:
23-
if: github.actor == 'renovate-bot' && startsWith(github.head_ref, 'renovate/googleapis-mcp-toolbox')
24+
# Renovate groups the npm toolbox update under groupName 'toolbox' (see
25+
# renovate.json5), so its branch is renovate/toolbox. Release notes still come
26+
# from googleapis/mcp-toolbox (same source repo), so the markers below are unchanged.
27+
if: github.actor == 'renovate-bot' && startsWith(github.head_ref, 'renovate/toolbox')
2428
runs-on: ubuntu-latest
2529
permissions:
2630
pull-requests: write
@@ -102,7 +106,6 @@ jobs:
102106
originalContent = originalContent.replace(/\[#(\d+)\](\([^)]+\))/g, '[mcp-toolbox#\u200B$1]$2');
103107
104108
const lineAsLowerCase = originalContent.toLowerCase();
105-
106109
const hasPrefix = prefixesToFilter.some(prefix => lineAsLowerCase.includes(prefix));
107110
108111
// Check if the line includes ANY of the required keywords

‎.github/workflows/package-and-upload-assets.yml‎

Lines changed: 0 additions & 140 deletions
This file was deleted.

‎.github/workflows/presubmit-tests.yml‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,15 @@ on:
2020
jobs:
2121
run-presubmit-tests:
2222
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
2325
steps:
2426
- name: Check out code
25-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2628

2729
- name: Install Gemini CLI
2830
run: npm install @google/gemini-cli
2931

30-
- name: Install toolbox binary
31-
run: |
32-
VERSION=$(cat toolbox_version.txt)
33-
curl -L -o toolbox "https://storage.googleapis.com/mcp-toolbox-for-databases/v${VERSION}/linux/amd64/toolbox"
34-
chmod +x toolbox
35-
3632
- name: Install Extension
3733
run: npx gemini extensions validate .
3834
env:

‎DEVELOPER.md‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,9 @@ are currently tested in the [MCP Toolbox GitHub](https://github.com/googleapis/m
7575

7676
## Building the Extension
7777

78-
The "build" process for this extension involves packaging the extension's
79-
metadata files (`gemini-extension.json`, `mysql.md`, `LICENSE`) along with the
80-
pre-built `toolbox` binary into platform-specific archives (`.tar.gz` or `.zip`).
81-
82-
This process is handled automatically by the
83-
[`package-and-upload-assets.yml`](.github/workflows/package-and-upload-assets.yml)
84-
GitHub Actions workflow when a new release is created. Manual building is not
85-
required.
78+
No build step is required. The extension is a set of metadata files
79+
(`gemini-extension.json`, the context file, `LICENSE`); the MCP server is fetched
80+
and run at launch via `npx`, so there is no binary to compile or package.
8681

8782
## Maintainer Information
8883

@@ -138,7 +133,3 @@ The process is handled by the [`mirror-changelog.yml`](.github/workflows/mirror-
138133
2. **Merge Release PR:** A maintainer approves and merges the Release PR. This
139134
action triggers `release-please` to create a new GitHub tag and a
140135
corresponding GitHub Release.
141-
3. **Package and Upload:** The new release triggers the
142-
`package-and-upload-assets.yml` workflow. This workflow builds the
143-
platform-specific extension archives and uploads them as assets to the
144-
GitHub Release.

‎README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Before you begin, ensure you have the following:
2424

2525
* [Gemini CLI](https://github.com/google-gemini/gemini-cli) installed with version **+v0.6.0**.
2626
* Setup Gemini CLI [Authentication](https://github.com/google-gemini/gemini-cli/tree/main?tab=readme-ov-file#-authentication-options).
27+
* [Node.js](https://nodejs.org/) (the MCP server runs via `npx`).
2728
* A running MySQL instance.
2829
* A user with database-level permissions to execute queries.
2930

@@ -118,5 +119,5 @@ Use `gemini --debug` to enable debugging.
118119
Common issues:
119120

120121
* "✖ Error during discovery for server: MCP error -32000: Connection closed": The database connection has not been established. Ensure your configuration is set via environment variables.
121-
* "✖ MCP ERROR: Error: spawn /Users/USER/.gemini/extensions/mysql/toolbox ENOENT": The Toolbox binary did not download correctly. Ensure you are using Gemini CLI v0.6.0+.
122-
* "cannot execute binary file": The Toolbox binary did not download correctly. Ensure the correct binary for your OS/Architecture has been downloaded. See [Installing the server](https://mcp-toolbox.dev/documentation/introduction/#install-toolbox) for more information.
122+
* "✖ MCP ERROR: Error: spawn npx ENOENT": Node.js/`npx` is not installed or not on your `PATH`. Install Node.js (which provides `npx`).
123+
* "npm error"/network failures on first run: `npx` fetches `@toolbox-sdk/server` on first launch, so it needs network access. Retry once connectivity is available.

‎gemini-extension.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
"description": "Connect and interact with a MySQL database and data",
55
"mcpServers": {
66
"mysql": {
7-
"command": "${extensionPath}${/}toolbox",
7+
"command": "npx",
88
"args": [
9+
"-y",
10+
"@toolbox-sdk/server@1.8.0",
911
"--prebuilt",
1012
"mysql",
1113
"--stdio"

‎toolbox_version.txt‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)