Skip to content

Conversation

amondnet
Copy link

Summary

Add Claude Code plugin configuration to enable this MCP server as a Claude Code plugin.

Closes #315

Changes

  • Add .claude-plugin/plugin.json with plugin metadata
  • Add .claude-plugin/install-binary.sh for automatic binary installation
  • Plugin automatically downloads and extracts the correct binary for user's OS/architecture
  • Supports Linux (x86_64, arm64, i386), macOS (x86_64, arm64), and Windows (x86_64, arm64, i386)
  • Version pinned to v0.7.6

How it works

The install script:

  1. Detects user's OS (Darwin/Linux/Windows) and architecture (x86_64/arm64/i386)
  2. Downloads the appropriate archive (tar.gz or zip) from GitHub releases
  3. Extracts the binary to the plugin directory
  4. Caches the binary and only re-downloads if version changes

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:

/plugin install grafana@your-marketplace

The plugin will automatically download and configure the mcp-grafana binary on first use.

Platform Support

Platform Architectures
Linux x86_64, arm64, i386
macOS x86_64 (Intel), arm64 (Apple Silicon)
Windows x86_64, arm64, i386

Testing

The install script has been designed to work with Grafana's release format:

  • macOS/Linux: mcp-grafana_${OS}_${ARCH}.tar.gz containing mcp-grafana binary
  • Windows: mcp-grafana_${OS}_${ARCH}.zip containing mcp-grafana.exe binary

Related

@amondnet amondnet requested a review from a team as a code owner October 15, 2025 14:29
@CLAassistant
Copy link

CLAassistant commented Oct 15, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@sd2k sd2k left a 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.

Comment on lines +57 to +80
VERSION_FILE="${PLUGIN_ROOT}/.mcp-grafana-version"
if [ ! -f "${BINARY_PATH}" ] || [ ! -f "${VERSION_FILE}" ] || [ "$(cat ${VERSION_FILE})" != "${VERSION}" ]; then
echo "Downloading mcp-grafana ${VERSION} for ${OS}-${ARCH}..." >&2

TEMP_DIR=$(mktemp -d)
trap "rm -rf ${TEMP_DIR}" EXIT

ARCHIVE_PATH="${TEMP_DIR}/${ARCHIVE_NAME}"
curl -fsSL "${DOWNLOAD_URL}" -o "${ARCHIVE_PATH}"

# Extract archive
if [ "${EXT}" = "tar.gz" ]; then
tar -xzf "${ARCHIVE_PATH}" -C "${TEMP_DIR}"
else
unzip -q "${ARCHIVE_PATH}" -d "${TEMP_DIR}"
fi

# Move binary to plugin root
mv "${TEMP_DIR}/${BINARY_NAME}" "${BINARY_PATH}"
chmod +x "${BINARY_PATH}"
echo "${VERSION}" > "${VERSION_FILE}"

echo "Successfully installed mcp-grafana ${VERSION}" >&2
fi
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should verify checksums after downloading, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Claude Code Plugin / Marketplace

3 participants