Skip to content

Commit 83341b7

Browse files
bartsdevBartclaude
authored
Improve discovery: MCP keywords on npm and a Claude Desktop extension (.mcpb) on releases (#155)
* chore: add MCP keywords to package.json for npm discovery npm search and MCP directories that index npm (mcp, mcp-server, model-context-protocol keywords) currently miss this package. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci: attach a Claude Desktop extension (.mcpb) to each release manifest.json already describes the extension, but no bundle was ever built, so Claude Desktop users had no one-click install. On each published release this builds the server, packs dist plus production dependencies with @anthropic-ai/mcpb, checks the packed server answers tools/list, and uploads the .mcpb to the release. PRs touching the manifest only build and validate; workflow_dispatch backfills a tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Bart <bart@Barts-MacBook-Pro.local> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent c6f2abe commit 83341b7

2 files changed

Lines changed: 120 additions & 1 deletion

File tree

‎.github/workflows/mcpb.yml‎

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: Claude Desktop extension
2+
3+
# Builds the Claude Desktop extension (.mcpb) from manifest.json and attaches it to the GitHub
4+
# release, so Claude Desktop users can install the server with one click. Pull requests that touch
5+
# the manifest or this workflow only build and validate the bundle. Run it by hand with a tag
6+
# (workflow_dispatch) to attach a bundle to a release that is missing one.
7+
8+
on:
9+
release:
10+
types: [published]
11+
pull_request:
12+
branches: [main]
13+
paths:
14+
- "manifest.json"
15+
- "icon.png"
16+
- ".github/workflows/mcpb.yml"
17+
workflow_dispatch:
18+
inputs:
19+
tag:
20+
description: "Release tag to build and attach the bundle to (for example v0.8.0)"
21+
required: true
22+
23+
permissions:
24+
contents: read
25+
26+
concurrency:
27+
group: mcpb-${{ github.event.release.tag_name || inputs.tag || github.ref }}
28+
cancel-in-progress: false
29+
30+
env:
31+
MCPB_VERSION: "2.1.2"
32+
33+
jobs:
34+
build:
35+
runs-on: ubuntu-26.04
36+
timeout-minutes: 15
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
40+
with:
41+
ref: ${{ github.event.release.tag_name || inputs.tag || github.ref }}
42+
persist-credentials: false
43+
44+
- name: Setup Node.js
45+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
46+
with:
47+
node-version: 22.x
48+
package-manager-cache: false # release builds must not restore a cache a PR could have written
49+
50+
- name: Check that the tag matches manifest.json
51+
if: github.event_name != 'pull_request'
52+
env:
53+
TAG: ${{ github.event.release.tag_name || inputs.tag }}
54+
run: |
55+
set -euo pipefail
56+
v=$(jq -r .version manifest.json)
57+
[ "$TAG" = "v$v" ] || { echo "::error::tag $TAG does not match manifest.json version $v"; exit 1; }
58+
59+
- name: Build
60+
run: |
61+
yarn install --frozen-lockfile
62+
yarn build
63+
64+
# Pack from a staging directory with only what the extension runs: the build output and
65+
# production dependencies, not the source tree, tests or dev dependencies.
66+
- name: Validate and pack the bundle
67+
run: |
68+
set -euo pipefail
69+
v=$(jq -r .version manifest.json)
70+
mkdir stage
71+
cp -r manifest.json icon.png package.json yarn.lock LICENSE README.md dist stage/
72+
(cd stage && yarn install --production --frozen-lockfile --ignore-scripts --non-interactive)
73+
npx -y "@anthropic-ai/mcpb@${MCPB_VERSION}" validate stage/manifest.json
74+
npx -y "@anthropic-ai/mcpb@${MCPB_VERSION}" pack stage "localstack-mcp-server-${v}.mcpb"
75+
echo "MCPB_FILE=localstack-mcp-server-${v}.mcpb" >> "$GITHUB_ENV"
76+
77+
- name: Smoke-test the bundle
78+
run: |
79+
set -euo pipefail
80+
mkdir smoke && unzip -q "$MCPB_FILE" -d smoke
81+
printf '%s\n' \
82+
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"ci","version":"1"}}}' \
83+
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
84+
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
85+
| (cd smoke && timeout 20 node dist/cli.js || true) > smoke.out
86+
tools=$(grep '"id":2' smoke.out | jq '.result.tools | length')
87+
echo "tools/list returned $tools tools"
88+
[ "${tools:-0}" -gt 0 ] || { echo "::error::the packed server did not list any tools"; cat smoke.out; exit 1; }
89+
90+
- name: Upload the bundle as a workflow artifact
91+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
92+
with:
93+
name: mcpb
94+
path: ${{ env.MCPB_FILE }}
95+
if-no-files-found: error
96+
97+
attach:
98+
needs: build
99+
if: github.event_name != 'pull_request'
100+
runs-on: ubuntu-26.04
101+
timeout-minutes: 5
102+
permissions:
103+
contents: write # upload the .mcpb to the release
104+
steps:
105+
- name: Download the bundle
106+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
107+
with:
108+
name: mcpb
109+
110+
- name: Attach the bundle to the release
111+
env:
112+
GH_TOKEN: ${{ github.token }}
113+
GH_REPO: ${{ github.repository }}
114+
TAG: ${{ github.event.release.tag_name || inputs.tag }}
115+
run: gh release upload "$TAG" localstack-mcp-server-*.mcpb --clobber

‎package.json‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070
"localstack",
7171
"aws",
7272
"local-development",
73-
"local-testing"
73+
"local-testing",
74+
"mcp",
75+
"mcp-server",
76+
"model-context-protocol",
77+
"ai-agents"
7478
]
7579
}

0 commit comments

Comments
 (0)