|
| 1 | +# Zotero MCP Plugin Auto-Update Guide |
| 2 | + |
| 3 | +## 🔄 Auto-Update Configuration |
| 4 | + |
| 5 | +The Zotero MCP plugin is configured for automatic updates through GitHub releases. Here's how it works: |
| 6 | + |
| 7 | +### Update URL Configuration |
| 8 | + |
| 9 | +The plugin's `manifest.json` contains: |
| 10 | +```json |
| 11 | +{ |
| 12 | + "applications": { |
| 13 | + "zotero": { |
| 14 | + "id": "zotero-mcp-plugin@autoagent.my", |
| 15 | + "update_url": "https://github.com/cookjohn/zotero-mcp/releases/latest/download/update.json" |
| 16 | + } |
| 17 | + } |
| 18 | +} |
| 19 | +``` |
| 20 | + |
| 21 | +### Update Manifest (`update.json`) |
| 22 | + |
| 23 | +The update manifest follows Zotero's update format: |
| 24 | +```json |
| 25 | +{ |
| 26 | + "addons": { |
| 27 | + "zotero-mcp-plugin@autoagent.my": { |
| 28 | + "updates": [ |
| 29 | + { |
| 30 | + "version": "1.2.0", |
| 31 | + "update_link": "https://github.com/cookjohn/zotero-mcp/releases/download/v1.2.0/zotero-mcp-plugin-1.2.0.xpi", |
| 32 | + "applications": { |
| 33 | + "zotero": { |
| 34 | + "strict_min_version": "6.999", |
| 35 | + "strict_max_version": "8.*" |
| 36 | + } |
| 37 | + } |
| 38 | + } |
| 39 | + ] |
| 40 | + } |
| 41 | + } |
| 42 | +} |
| 43 | +``` |
| 44 | + |
| 45 | +## 📋 How Auto-Update Works |
| 46 | + |
| 47 | +1. **Version Check**: Zotero periodically checks the `update_url` for version updates |
| 48 | +2. **Comparison**: Compares the version in `update.json` with the installed version |
| 49 | +3. **Download**: If a newer version is found, downloads the `.xpi` from `update_link` |
| 50 | +4. **Installation**: Prompts user to install the update or installs automatically (based on Zotero settings) |
| 51 | + |
| 52 | +## 🚀 Release Process for Auto-Update |
| 53 | + |
| 54 | +### 1. Version Update |
| 55 | +```bash |
| 56 | +# Update version in package.json |
| 57 | +npm version patch # or minor/major |
| 58 | +``` |
| 59 | + |
| 60 | +### 2. GitHub Actions Release |
| 61 | +The GitHub Actions workflow automatically: |
| 62 | +- Builds the plugin |
| 63 | +- Generates `update.json` with correct version and download links |
| 64 | +- Creates a GitHub release with assets |
| 65 | +- Uploads both `.xpi` and `update.json` files |
| 66 | + |
| 67 | +### 3. Update URL Resolution |
| 68 | +- Plugin checks: `https://github.com/cookjohn/zotero-mcp/releases/latest/download/update.json` |
| 69 | +- GitHub redirects `latest` to the most recent release |
| 70 | +- Users get the newest version automatically |
| 71 | + |
| 72 | +## 🧪 Testing Auto-Update |
| 73 | + |
| 74 | +### Method 1: Version Downgrade Test |
| 75 | +1. Install an older version of the plugin |
| 76 | +2. Wait for Zotero's automatic update check (or restart Zotero) |
| 77 | +3. Check if update notification appears |
| 78 | + |
| 79 | +### Method 2: Manual Update Check |
| 80 | +1. In Zotero: `Tools → Add-ons` |
| 81 | +2. Click gear icon → "Check for Updates" |
| 82 | +3. Should detect if newer version is available |
| 83 | + |
| 84 | +### Method 3: URL Verification |
| 85 | +Test the update URL manually: |
| 86 | +```bash |
| 87 | +curl -L "https://github.com/cookjohn/zotero-mcp/releases/latest/download/update.json" |
| 88 | +``` |
| 89 | + |
| 90 | +Should return the latest version information. |
| 91 | + |
| 92 | +## 🔧 Troubleshooting |
| 93 | + |
| 94 | +### Common Issues |
| 95 | + |
| 96 | +1. **Update not detected** |
| 97 | + - Check Zotero's update frequency settings |
| 98 | + - Verify `update.json` is accessible at the URL |
| 99 | + - Ensure version number format is correct (semantic versioning) |
| 100 | + |
| 101 | +2. **Download fails** |
| 102 | + - Verify `.xpi` file exists in the GitHub release |
| 103 | + - Check file permissions and accessibility |
| 104 | + - Ensure release is not marked as "draft" |
| 105 | + |
| 106 | +3. **Version comparison issues** |
| 107 | + - Ensure version numbers follow semantic versioning (x.y.z) |
| 108 | + - Check that new version is actually higher than installed version |
| 109 | + |
| 110 | +### Debug Steps |
| 111 | + |
| 112 | +1. **Check plugin manifest**: |
| 113 | + ```bash |
| 114 | + # Extract and check manifest from installed .xpi |
| 115 | + unzip -p zotero-mcp-plugin-1.2.0.xpi manifest.json | jq |
| 116 | + ``` |
| 117 | + |
| 118 | +2. **Verify update URL**: |
| 119 | + ```bash |
| 120 | + curl -I "https://github.com/cookjohn/zotero-mcp/releases/latest/download/update.json" |
| 121 | + ``` |
| 122 | + |
| 123 | +3. **Test download link**: |
| 124 | + ```bash |
| 125 | + curl -I "https://github.com/cookjohn/zotero-mcp/releases/download/v1.2.0/zotero-mcp-plugin-1.2.0.xpi" |
| 126 | + ``` |
| 127 | + |
| 128 | +## 📝 Update Check Frequency |
| 129 | + |
| 130 | +Zotero checks for add-on updates: |
| 131 | +- Every 24 hours by default |
| 132 | +- On startup if last check was >24 hours ago |
| 133 | +- When manually triggered via "Check for Updates" |
| 134 | + |
| 135 | +## 🔒 Security Considerations |
| 136 | + |
| 137 | +- Updates are served over HTTPS |
| 138 | +- GitHub provides file integrity and authenticity |
| 139 | +- Zotero validates plugin signatures (if signed) |
| 140 | +- Users can disable automatic updates in Zotero preferences |
| 141 | + |
| 142 | +## 📚 References |
| 143 | + |
| 144 | +- [Zotero Plugin Development](https://www.zotero.org/support/dev/client_coding/plugin_development) |
| 145 | +- [WebExtension Update Manifest](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Updates) |
| 146 | +- [GitHub Releases API](https://docs.github.com/en/rest/releases/releases) |
0 commit comments