patchcord 0.6.13 → 0.6.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "patchcord",
3
3
  "description": "Cross-machine agent messaging. Messages from other agents land in the inbox and wake the agent to reply.",
4
- "version": "0.6.13",
4
+ "version": "0.6.14",
5
5
  "author": {
6
6
  "name": "ppravdin"
7
7
  },
package/bin/patchcord.mjs CHANGED
@@ -1172,9 +1172,13 @@ if (cmd === "login" || cmd === "orchestrator" || cmd === "teamlead" || cmd === "
1172
1172
  // default: claude_code. type:"http" is REQUIRED — without it Claude Code
1173
1173
  // defaults to stdio transport and rejects the entry ("command: expected
1174
1174
  // string, received undefined").
1175
+ // Use /mcp/bearer (not /mcp): Claude Code v2.1.113+ follows RFC 9728 OAuth
1176
+ // discovery on /mcp, drops the static bearer header, and stalls on "Needs
1177
+ // authentication". /mcp/bearer serves bearer-only resource metadata — same
1178
+ // path Cursor and Kimi Code already use.
1175
1179
  return writeJson(join(dir, ".mcp.json"), (o) => {
1176
1180
  o.mcpServers = o.mcpServers || {};
1177
- o.mcpServers.patchcord = { type: "http", url: `${baseUrl}/mcp`, headers: hdr };
1181
+ o.mcpServers.patchcord = { type: "http", url: `${baseUrl}/mcp/bearer`, headers: hdr };
1178
1182
  });
1179
1183
  };
1180
1184
 
@@ -1661,6 +1665,23 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
1661
1665
  return out.replace(/,(\s*[}\]])/g, "$1");
1662
1666
  }
1663
1667
 
1668
+ // Claude Code v2.1.113+ OAuth discovery on plain /mcp breaks bearer MCP.
1669
+ // Rewrite legacy project configs to /mcp/bearer (Cursor/Kimi already use it).
1670
+ function _migrateClaudeMcpBearerUrl(mcpPath) {
1671
+ if (!existsSync(mcpPath)) return false;
1672
+ try {
1673
+ const obj = JSON.parse(readFileSync(mcpPath, "utf-8"));
1674
+ const pt = obj?.mcpServers?.patchcord;
1675
+ const url = pt?.url;
1676
+ if (!url || !/\/mcp$/.test(url) || url.endsWith("/mcp/bearer")) return false;
1677
+ pt.url = url.replace(/\/mcp$/, "/mcp/bearer");
1678
+ writeFileSync(mcpPath, JSON.stringify(obj, null, 2) + "\n");
1679
+ return true;
1680
+ } catch {
1681
+ return false;
1682
+ }
1683
+ }
1684
+
1664
1685
  // Read+merge+write a JSON config file. If the file exists but its contents
1665
1686
  // can't be parsed, REFUSE to write — silently overwriting would erase
1666
1687
  // unrelated MCP servers, settings, or hand-edits the user has in there.
@@ -1719,6 +1740,10 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
1719
1740
  const bold = "\x1b[1m";
1720
1741
  const r = "\x1b[0m";
1721
1742
 
1743
+ if (_migrateClaudeMcpBearerUrl(join(process.cwd(), ".mcp.json"))) {
1744
+ console.log(` ${green}✓${r} Claude Code MCP URL migrated to /mcp/bearer`);
1745
+ }
1746
+
1722
1747
  // ── Purge stale npx cache entries ────────────────────────────
1723
1748
  // npx never auto-updates a cached package. Users with an old `npx patchcord`
1724
1749
  // entry get the stale binary indefinitely. On every install we sweep
@@ -3251,7 +3276,7 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
3251
3276
  mcpServers: {
3252
3277
  patchcord: {
3253
3278
  type: "http",
3254
- url: `${serverUrl}/mcp`,
3279
+ url: `${serverUrl}/mcp/bearer`,
3255
3280
  headers: {
3256
3281
  Authorization: `Bearer ${token}`,
3257
3282
  "X-Patchcord-Machine": hostname,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchcord",
3
- "version": "0.6.13",
3
+ "version": "0.6.14",
4
4
  "description": "Cross-machine agent messaging for Claude Code and Codex",
5
5
  "scripts": {
6
6
  "version": "node scripts/sync-plugin-version.mjs && git add .claude-plugin/plugin.json"