-
Notifications
You must be signed in to change notification settings - Fork 173
chore: add Claude Code plugin configuration #333
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: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! thanks for contributing this. I would like to solve the hardcoded version issue before merging. I'll work on this separately since it'll require a new CI workflow to bump versions I suspect.
The other question I had is around Windows compatibility. The script does handle the Windows OS case but still relies on Cygwin/Git Bash etc, so we would need a separate script for Powershell users, which I don't really want to maintain... I'm curious if there is a nicer solution. It's not a blocker though.
Add SHA256 checksum verification after downloading binary archives to ensure integrity. Downloads checksums.txt from the release and verifies using sha256sum (Linux) or shasum (macOS). Falls back gracefully with a warning if neither tool is available. Addresses feedback from PR grafana#333 review.
Dynamically fetch the latest version from GitHub API and use the /latest/download redirect for downloading binaries and checksums. This eliminates the need to manually update the version in the script. - Fetch latest tag_name from GitHub API - Use /latest/download redirect URLs - Compare against stored version to detect updates - Gracefully handle API failures Resolves the hardcoded version issue mentioned in PR grafana#333 review.
Add Node.js implementation as an alternative to bash script for better cross-platform support, especially for Windows PowerShell users. Changes: - Add install-binary.mjs with full Node.js implementation - Fix checksum file URL to use correct format: mcp-grafana_VERSION_checksums.txt - Improve JSON parsing in bash script (jq preferred, better grep fallback) - Both scripts tested and working correctly Node.js script benefits: - Full cross-platform support (macOS, Linux, Windows) - Uses Node.js built-in APIs (no external dependencies) - SHA256 checksum verification - Dynamic latest release detection Bash script improvements: - Better JSON parsing (supports jq and improved grep) - Correct checksum file URL format Both scripts now properly: 1. Fetch latest version from GitHub API 2. Download binary archives 3. Verify SHA256 checksums 4. Extract and install binaries 5. Track versions for updates Addresses Windows compatibility discussion in PR grafana#333.
Add comprehensive CI testing for both bash and Node.js install scripts across multiple platforms. Tests: - Bash script on Linux and macOS - Node.js script on Linux, macOS, and Windows - Multiple Node.js versions (18, 20, 22) - Checksum verification for both scripts - Version update detection (skip re-download) This ensures: 1. Both scripts work on all supported platforms 2. Checksums are properly verified 3. Version tracking prevents unnecessary downloads 4. Scripts remain compatible with new releases Workflow triggers: - Pull requests affecting .claude-plugin/** - Pushes to main - Manual dispatch
Add support for GITHUB_TOKEN environment variable to avoid API rate limiting in CI environments. Changes: - Bash script: Use Authorization header when GITHUB_TOKEN is available - Node.js script: Use Authorization header when GITHUB_TOKEN is available - CI workflow: Pass GITHUB_TOKEN to all test steps This fixes the 403 errors encountered in GitHub Actions when calling the GitHub API without authentication. The scripts remain backward compatible and work without the token in normal usage.
Capture and display full script output in checksum verification tests to help diagnose failures. This makes it easier to debug issues when tests fail in CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice thanks for the extra changes!
I might be missing something here but how is the mjs script being executed right now? Should we just remove the bash script and always use the JS one instead in plugin.json?
The project uses Apache License 2.0, not AGPL-3.0. Update plugin.json to reflect the correct license.
|
For Windows support, I've implemented Option 2 (Node.js script) as an alternative:
The bash script remains the default, but the Node.js script provides a path forward for better Windows-native experience. Both scripts now:
Let me know your preference on which script to use as the primary implementation! |
Drop Node.js 18 as it reaches EOL in April 2025. Test with currently supported LTS versions (20, 22) and latest stable (24).
|
Thanks so much. I think we can use the Node script as the primary (or even only) implementation, since it's cross platform. |
Remove install-binary.sh in favor of install-binary.mjs for better cross-platform compatibility. Update plugin.json to use Node.js as the command runner and remove all bash-related workflow tests.
|
@sd2k I've migrated the plugin to use Node.js-only installation. |
Summary
Add Claude Code plugin configuration to enable this MCP server as a Claude Code plugin.
Closes #315
Changes
.claude-plugin/plugin.jsonwith plugin metadata.claude-plugin/install-binary.shfor automatic binary installationHow it works
The install script:
Installation
Users can add this plugin via a marketplace:
{ "plugins": [ { "name": "grafana", "description": "A Model Context Protocol (MCP) server for Grafana", "source": { "source": "github", "repo": "grafana/mcp-grafana" } } ] }Then install via:
The plugin will automatically download and configure the mcp-grafana binary on first use.
Platform Support
Testing
The install script has been designed to work with Grafana's release format:
mcp-grafana_${OS}_${ARCH}.tar.gzcontainingmcp-grafanabinarymcp-grafana_${OS}_${ARCH}.zipcontainingmcp-grafana.exebinaryRelated