Skip to content

Commit ee6298a

Browse files
gui-wfclaude
andcommitted
chore: Prepare v2.0.0-rc2 release with npm package improvements
- Add bin field to package.json for npx support - Add preferGlobal: false to indicate npx-first usage - Update version to 2.0.0-rc2 across package.json and flake.nix - Update flake.nix to use --omit=dev instead of deprecated --production - Update README with prominent npx and Nix usage examples - Simplify GitHub Actions npm publish workflow - Remove duplicate npm-publish.yml workflow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 998ec73 commit ee6298a

File tree

6 files changed

+52
-166
lines changed

6 files changed

+52
-166
lines changed

.github/workflows/npm-publish.yml

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

.github/workflows/publish-npm.yml

Lines changed: 6 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -4,92 +4,17 @@ on:
44
push:
55
tags:
66
- 'v*'
7-
- '[0-9]+.[0-9]+.[0-9]+*'
87

98
jobs:
109
publish:
1110
runs-on: ubuntu-latest
1211
permissions:
13-
contents: write
14-
pull-requests: write
12+
contents: read
13+
id-token: write
1514

1615
steps:
1716
- name: Checkout repository
1817
uses: actions/checkout@v4
19-
with:
20-
fetch-depth: 0
21-
22-
- name: Install Nix
23-
uses: cachix/install-nix-action@v24
24-
with:
25-
nix_path: nixpkgs=channel:nixos-unstable
26-
27-
- name: Extract version from tag
28-
id: version
29-
run: |
30-
# Remove 'v' prefix if present
31-
VERSION="${GITHUB_REF#refs/tags/}"
32-
VERSION="${VERSION#v}"
33-
echo "version=$VERSION" >> $GITHUB_OUTPUT
34-
echo "📌 Target version: $VERSION"
35-
36-
- name: Update version in files
37-
id: update
38-
run: |
39-
echo "🔄 Running version update script..."
40-
nix run .#update-version -- -y "${{ steps.version.outputs.version }}" > version-output.txt 2>&1
41-
42-
# Check if changes were made
43-
if grep -q "No changes needed" version-output.txt; then
44-
echo "changes_needed=false" >> $GITHUB_OUTPUT
45-
echo "ℹ️ No version updates needed"
46-
else
47-
echo "changes_needed=true" >> $GITHUB_OUTPUT
48-
echo "✅ Version files updated"
49-
fi
50-
51-
# Save output for PR body
52-
cat version-output.txt
53-
54-
- name: Create Pull Request
55-
if: steps.update.outputs.changes_needed == 'true'
56-
uses: peter-evans/create-pull-request@v5
57-
with:
58-
token: ${{ secrets.GITHUB_TOKEN }}
59-
commit-message: |
60-
chore: Update version to ${{ steps.version.outputs.version }}
61-
62-
Automated version sync for tag ${{ github.ref_name }}
63-
title: 'chore: Sync version to ${{ steps.version.outputs.version }}'
64-
body: |
65-
## Version Sync Required
66-
67-
Latest version was changed to `${{ steps.version.outputs.version }}`, and the following files need updating to sync with the tagged version:
68-
69-
**Changed files:**
70-
- `package.json`
71-
- `flake.nix`
72-
73-
### Diff
74-
75-
```diff
76-
$(cat version-output.txt)
77-
```
78-
79-
---
80-
81-
🤖 This PR was created automatically by the **Publish to npm** workflow.
82-
83-
**Next steps:**
84-
1. Review the changes
85-
2. Merge this PR
86-
3. The npm publish will proceed after merge
87-
branch: automated/version-sync-${{ steps.version.outputs.version }}
88-
delete-branch: true
89-
draft: false
90-
labels: |
91-
automated
92-
version-sync
9318

9419
- name: Setup Node.js
9520
uses: actions/setup-node@v4
@@ -107,28 +32,15 @@ jobs:
10732
run: npm run test:mock
10833

10934
- name: Publish to npm
110-
if: steps.update.outputs.changes_needed == 'false'
111-
run: npm publish
35+
run: npm publish --provenance --access public
11236
env:
113-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
11438

11539
- name: Publish summary
116-
if: steps.update.outputs.changes_needed == 'false'
11740
run: |
41+
VERSION="${GITHUB_REF#refs/tags/v}"
11842
echo "## ✅ Published to npm" >> $GITHUB_STEP_SUMMARY
11943
echo "" >> $GITHUB_STEP_SUMMARY
120-
echo "- **Version**: ${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
44+
echo "- **Version**: $VERSION" >> $GITHUB_STEP_SUMMARY
12145
echo "- **Package**: [purelymail-mcp-server](https://www.npmjs.com/package/purelymail-mcp-server)" >> $GITHUB_STEP_SUMMARY
12246
echo "- **Tag**: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
123-
124-
- name: Waiting for version sync
125-
if: steps.update.outputs.changes_needed == 'true'
126-
run: |
127-
echo "## ⏳ Waiting for Version Sync" >> $GITHUB_STEP_SUMMARY
128-
echo "" >> $GITHUB_STEP_SUMMARY
129-
echo "A pull request has been created to sync version files." >> $GITHUB_STEP_SUMMARY
130-
echo "npm publish will proceed after the PR is merged and the tag is re-pushed." >> $GITHUB_STEP_SUMMARY
131-
echo "" >> $GITHUB_STEP_SUMMARY
132-
echo "**Action required:**" >> $GITHUB_STEP_SUMMARY
133-
echo "1. Review and merge the version sync PR" >> $GITHUB_STEP_SUMMARY
134-
echo "2. Re-tag: \`git tag -f ${{ github.ref_name }} && git push -f origin ${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY

.mcp.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
"mcpServers": {
33
"purelymail": {
44
"command": "npx",
5-
"args": [
6-
"tsx",
7-
"/home/guibaeta/Projects/purelymail-mcp-server/src/index.ts"
8-
],
5+
"args": ["-y", "purelymail-mcp-server"],
96
"env": {
107
"PURELYMAIL_API_KEY": "${PURELYMAIL_API_KEY}",
118
"MOCK_MODE": "false"

README.md

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,36 @@
22

33
A Model Context Protocol (MCP) server that provides AI assistants with access to PurelyMail's email management API.
44

5+
## Usage
6+
7+
**Run with npx (no installation needed):**
8+
9+
```bash
10+
npx -y purelymail-mcp-server
11+
```
12+
13+
**Or use Nix (via GitHub flake):**
14+
15+
```bash
16+
nix run github:gui-wf/purelymail-mcp-server
17+
```
18+
19+
**Configure in your MCP client:**
20+
21+
```json
22+
{
23+
"mcpServers": {
24+
"purelymail": {
25+
"command": "npx",
26+
"args": ["-y", "purelymail-mcp-server"],
27+
"env": {
28+
"PURELYMAIL_API_KEY": "your-api-key-here"
29+
}
30+
}
31+
}
32+
}
33+
```
34+
535
## Features
636

737
- **Type-Safe API Integration**: Generated TypeScript client from PurelyMail's swagger specification
@@ -48,14 +78,14 @@ node dist/index.js
4878

4979
Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json`):
5080

51-
#### When installed via npm:
81+
#### Using npx (recommended - no installation):
5282

5383
```json
5484
{
5585
"mcpServers": {
5686
"purelymail": {
5787
"command": "npx",
58-
"args": ["purelymail-mcp-server"],
88+
"args": ["-y", "purelymail-mcp-server"],
5989
"env": {
6090
"PURELYMAIL_API_KEY": "your-api-key-here"
6191
}
@@ -64,7 +94,7 @@ Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/
6494
}
6595
```
6696

67-
#### Using Nix flake from GitHub:
97+
#### Using Nix from GitHub:
6898

6999
```json
70100
{
@@ -121,7 +151,7 @@ For Claude Code, create a `.mcp.json` file in your project root:
121151
"mcpServers": {
122152
"purelymail": {
123153
"command": "npx",
124-
"args": ["purelymail-mcp-server"],
154+
"args": ["-y", "purelymail-mcp-server"],
125155
"env": {
126156
"PURELYMAIL_API_KEY": "${PURELYMAIL_API_KEY}"
127157
}
@@ -177,14 +207,14 @@ The server provides 19 individual tools, each corresponding to a specific Purely
177207

178208
## Installation
179209

180-
### Via npm (Recommended)
210+
### Via npx (Recommended - No Installation)
181211
```bash
182-
npm install -g purelymail-mcp-server
212+
npx -y purelymail-mcp-server
183213
```
184214

185-
### Via npx (No Installation)
215+
### Via Nix (GitHub Flake)
186216
```bash
187-
npx purelymail-mcp-server
217+
nix run github:gui-wf/purelymail-mcp-server
188218
```
189219

190220
### From Source

flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@
7070
packages.default = pkgs.stdenv.mkDerivation {
7171
pname = "purelymail-mcp-server";
7272
# AIDEV-TODO: Make version update dynamic and based on whats defined in package.json - to not have to edit many files
73-
version = "2.0.0-rc1";
73+
version = "2.0.0-rc2";
7474
src = ./.;
7575

7676
buildInputs = [ pkgs.nodejs_20 ];
7777

7878
buildPhase = ''
7979
# Install dependencies (production only)
80-
npm ci --production
80+
npm ci --omit=dev
8181
8282
# Generate types if spec exists (no network calls during build)
8383
if [ -f purelymail-api-spec.json ]; then

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "purelymail-mcp-server",
3-
"version": "2.0.0-rc1",
3+
"version": "2.0.0-rc2",
44
"description": "MCP server for PurelyMail email service management",
55
"keywords": [
66
"mcp",
@@ -21,6 +21,9 @@
2121
"license": "SEE LICENSE IN LICENSE",
2222
"author": "Guilherme Fontes <[email protected]> (https://gui.wf)",
2323
"main": "dist/index.js",
24+
"bin": {
25+
"purelymail-mcp-server": "dist/index.js"
26+
},
2427
"files": [
2528
"dist/",
2629
"src/types/",
@@ -31,6 +34,7 @@
3134
"publishConfig": {
3235
"access": "public"
3336
},
37+
"preferGlobal": false,
3438
"type": "module",
3539
"scripts": {
3640
"fetch:swagger": "node scripts/fetch-swagger.js",

0 commit comments

Comments
 (0)