diff --git a/docs/github-workflows/ci.yml b/.github/workflows/ci.yml similarity index 100% rename from docs/github-workflows/ci.yml rename to .github/workflows/ci.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5941cdb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +name: Release + +# Cut a release by pushing a version tag, e.g.: +# npm version patch && git push --follow-tags +# +# This builds the .mcpb desktop-extension bundle, creates the GitHub Release +# with the bundle attached, and publishes the package to npm. +# +# Requires an NPM_TOKEN repository secret (an npm automation token) for the +# publish step. +on: + push: + tags: ["v*"] + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write # create the GitHub Release and upload assets + id-token: write # npm publish provenance + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + registry-url: https://registry.npmjs.org + cache: npm + - run: npm ci + - run: npm test + - run: npm run typecheck + - name: Build the .mcpb bundle + run: npm run pack:mcpb + - name: Create the GitHub Release + env: + GH_TOKEN: ${{ github.token }} + run: | + version="${GITHUB_REF_NAME#v}" + mv openmart-mcp-server.mcpb "openmart-mcp-server-${version}.mcpb" + gh release create "$GITHUB_REF_NAME" \ + --title "$GITHUB_REF_NAME" \ + --generate-notes \ + "openmart-mcp-server-${version}.mcpb" + - name: Publish to npm + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index 5463295..e90e5b2 100644 --- a/README.md +++ b/README.md @@ -185,10 +185,14 @@ The package exposes two binaries: ## CI Workflows -The CI, npm-publish, and Render-deploy workflow files are parked under -`docs/github-workflows/`. To activate them as real GitHub Actions, move them -into `.github/workflows/` and push from a credential that holds the GitHub -`workflow` OAuth scope (`gh auth refresh -s workflow`). +Two GitHub Actions workflows (`.github/workflows/`): + +- `ci.yml` — runs tests, typecheck, and build on every push and pull request. +- `release.yml` — on a `v*` tag, builds the `.mcpb` bundle, creates the GitHub + Release with it attached, and publishes the package to npm. + +`release.yml` needs an `NPM_TOKEN` repository secret (an npm automation token) +for the publish step. ## Shared Project Config @@ -309,3 +313,10 @@ claude mcp add openmart -- env OPENMART_API_KEY="YOUR_OPENMART_API_KEY" node "$( ``` Then ask Claude, for example: `find 3 coffee shops in San Francisco with valid websites and get their owner emails`. + +## Privacy + +This server holds no data of its own. It forwards the search and enrichment +parameters you pass to the Openmart API, authenticated with your own API key, +and returns the response. Data handling is governed by the +[Openmart privacy policy](https://www.openmart.com/privacy-policy). diff --git a/docs/github-workflows/deploy-render.yml b/docs/github-workflows/deploy-render.yml deleted file mode 100644 index 5f5738f..0000000 --- a/docs/github-workflows/deploy-render.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Deploy Render - -on: - workflow_dispatch: - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: Trigger Render deploy hook - run: curl -fsS -X POST "$RENDER_DEPLOY_HOOK_URL" - env: - RENDER_DEPLOY_HOOK_URL: ${{ secrets.RENDER_DEPLOY_HOOK_URL }} diff --git a/docs/github-workflows/publish-npm.yml b/docs/github-workflows/publish-npm.yml deleted file mode 100644 index 5433972..0000000 --- a/docs/github-workflows/publish-npm.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Publish npm - -on: - workflow_dispatch: - -jobs: - publish: - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 22 - registry-url: https://registry.npmjs.org - cache: npm - - run: npm ci - - run: npm test - - run: npm run typecheck - - run: npm run build - - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..74a941d Binary files /dev/null and b/icon.png differ diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..560a7ea --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/manifest.json b/manifest.json index dbfaf48..dd18f1f 100644 --- a/manifest.json +++ b/manifest.json @@ -6,6 +6,15 @@ "author": { "name": "Openmart" }, + "homepage": "https://www.openmart.com", + "documentation": "https://github.com/OpenmartAI/openmart-mcp-server#readme", + "support": "https://github.com/OpenmartAI/openmart-mcp-server/issues", + "repository": { + "type": "git", + "url": "https://github.com/OpenmartAI/openmart-mcp-server" + }, + "icon": "icon.png", + "privacy_policies": ["https://www.openmart.com/privacy-policy"], "server": { "type": "node", "entry_point": "server/index.mjs", diff --git a/package.json b/package.json index ee5a7d8..61eceac 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "test": "tsx --test test/**/*.test.ts", "typecheck": "tsc --noEmit", "pack:mcpb": "npm run build && node scripts/build-mcpb.mjs", + "version": "node scripts/sync-manifest-version.mjs && git add manifest.json", "prepublishOnly": "npm test && npm run typecheck && npm run build" }, "keywords": [ diff --git a/scripts/build-mcpb.mjs b/scripts/build-mcpb.mjs index f960618..a3e0e08 100644 --- a/scripts/build-mcpb.mjs +++ b/scripts/build-mcpb.mjs @@ -26,6 +26,7 @@ await build({ }); copyFileSync("manifest.json", `${STAGE}/manifest.json`); +copyFileSync("icon.png", `${STAGE}/icon.png`); execFileSync("npx", ["mcpb", "pack", STAGE, OUTPUT], { stdio: "inherit" }); diff --git a/scripts/sync-manifest-version.mjs b/scripts/sync-manifest-version.mjs new file mode 100644 index 0000000..ffb1d73 --- /dev/null +++ b/scripts/sync-manifest-version.mjs @@ -0,0 +1,18 @@ +// Keeps manifest.json's version in sync with package.json. +// +// Wired as the npm `version` lifecycle script, so `npm version ` updates +// both files and stages manifest.json into the same release commit. Without +// this, a release would ship a .mcpb whose manifest version lags package.json. +import { readFileSync, writeFileSync } from "node:fs"; + +const VERSION_FIELD = /("version":\s*")[^"]*(")/; + +const { version } = JSON.parse(readFileSync("package.json", "utf8")); +const manifest = readFileSync("manifest.json", "utf8"); + +if (!VERSION_FIELD.test(manifest)) { + throw new Error("sync-manifest-version: no version field found in manifest.json"); +} + +writeFileSync("manifest.json", manifest.replace(VERSION_FIELD, `$1${version}$2`)); +console.log(`manifest.json version -> ${version}`);