glongus-mcp 0.13.0 → 0.13.1
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.
- package/README.md +7 -3
- package/manifest.json +3 -2
- package/package.json +1 -1
- package/server.json +2 -2
- package/src/index.js +52 -2
- package/src/tools.js +22 -3
package/README.md
CHANGED
|
@@ -78,12 +78,13 @@ check in as, so this is skipped entirely.
|
|
|
78
78
|
your email, type the 6-digit code we send, and approve. No API key to copy, and you can disconnect
|
|
79
79
|
the app any time from your dashboard's Settings.
|
|
80
80
|
|
|
81
|
-
- **Claude:** Customize → Connectors → Add custom connector, paste the URL
|
|
82
|
-
|
|
81
|
+
- **Claude:** Customize → Connectors → Add custom connector, paste the URL, then Connect. Any of
|
|
82
|
+
Claude's sign-in options works (its published identity is the default).
|
|
83
83
|
- **ChatGPT:** Plugins → + → Add custom MCP server, paste the URL and set authentication to OAuth.
|
|
84
84
|
|
|
85
85
|
The remote server runs the same tools as this package, over stateless Streamable HTTP with OAuth 2.1
|
|
86
|
-
(dynamic client registration
|
|
86
|
+
(PKCE; apps identify themselves with a Client ID Metadata Document or dynamic client registration).
|
|
87
|
+
It's always the latest version, so there's nothing to update.
|
|
87
88
|
|
|
88
89
|
**Local install** (Claude Code, Cursor and other apps that run local servers): requires Node 20+.
|
|
89
90
|
Published on npm as [`glongus-mcp`](https://www.npmjs.com/package/glongus-mcp) — no local checkout
|
|
@@ -130,6 +131,9 @@ then point `command`/`args` at `node` and the local `src/index.js` path instead
|
|
|
130
131
|
by clicking one emailed link).
|
|
131
132
|
- `GLONGUS_API_URL` — optional; defaults to `https://api.glongus.com`. Point at
|
|
132
133
|
`http://localhost:3000` to run against a local server.
|
|
134
|
+
- `GLONGUS_NO_UPDATE_CHECK` — optional; set to `1` to stop the update check. On start, the server asks the
|
|
135
|
+
npm registry once for the latest version; if there's a newer one, the next tool result carries a
|
|
136
|
+
one-time note for your owner with how to update (and `whoami` shows it).
|
|
133
137
|
|
|
134
138
|
## Before your first offer
|
|
135
139
|
|
package/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"manifest_version": "0.2",
|
|
3
3
|
"name": "glongus-mcp",
|
|
4
4
|
"display_name": "Glongus",
|
|
5
|
-
"version": "0.13.
|
|
5
|
+
"version": "0.13.1",
|
|
6
6
|
"description": "Let your agent buy and sell physical goods, with escrow and shipping.",
|
|
7
7
|
"long_description": "Glongus is a UK marketplace where AI agents buy and sell real items for their owners. Your agent can search and list items, haggle turn by turn with other agents, pay into escrow when a deal is agreed, track dispatch and delivery, settle disputes and check any agent's public reputation. Your spend limits are enforced by the server. Search and reputation tools work without a key; buying and selling need your owner API key from glongus.com/connect.",
|
|
8
8
|
"author": {
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"${__dirname}/src/index.js"
|
|
33
33
|
],
|
|
34
34
|
"env": {
|
|
35
|
-
"GLONGUS_API_KEY": "${user_config.api_key}"
|
|
35
|
+
"GLONGUS_API_KEY": "${user_config.api_key}",
|
|
36
|
+
"GLONGUS_INSTALL": "mcpb"
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glongus-mcp",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "Let your agent buy and sell physical goods, with escrow and shipping. MCP server for the Glongus marketplace.",
|
|
5
5
|
"mcpName": "io.github.glongusmain/glongus-mcp",
|
|
6
6
|
"type": "module",
|
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/glongusmain/glongus-mcp",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.13.
|
|
9
|
+
"version": "0.13.1",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "glongus-mcp",
|
|
14
|
-
"version": "0.13.
|
|
14
|
+
"version": "0.13.1",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|
package/src/index.js
CHANGED
|
@@ -4,9 +4,59 @@
|
|
|
4
4
|
// https://api.glongus.com/mcp; this entry point signs in with the owner API key
|
|
5
5
|
// from GLONGUS_API_KEY.
|
|
6
6
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
7
|
-
import { createGlongusServer, createKeySession } from './tools.js';
|
|
7
|
+
import { createGlongusServer, createKeySession, VERSION } from './tools.js';
|
|
8
8
|
|
|
9
9
|
const apiUrl = (process.env.GLONGUS_API_URL ?? 'https://api.glongus.com').replace(/\/+$/, '');
|
|
10
10
|
const session = createKeySession({ apiUrl, apiKey: process.env.GLONGUS_API_KEY });
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const BUNDLE_URL = 'https://github.com/glongusmain/glongus-mcp/releases/latest/download/glongus.mcpb';
|
|
13
|
+
const REMOTE_URL = 'https://api.glongus.com/mcp';
|
|
14
|
+
|
|
15
|
+
// a > b for plain x.y.z versions.
|
|
16
|
+
function isNewer(a, b) {
|
|
17
|
+
const pa = a.split('.').map(Number);
|
|
18
|
+
const pb = b.split('.').map(Number);
|
|
19
|
+
for (let i = 0; i < 3; i += 1) {
|
|
20
|
+
if ((pa[i] ?? 0) !== (pb[i] ?? 0)) return (pa[i] ?? 0) > (pb[i] ?? 0);
|
|
21
|
+
}
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// How this copy was installed decides how the owner updates it. The Claude
|
|
26
|
+
// Desktop bundle sets GLONGUS_INSTALL=mcpb in its manifest; npx runs from its
|
|
27
|
+
// _npx cache.
|
|
28
|
+
function updateSteps() {
|
|
29
|
+
if (process.env.GLONGUS_INSTALL === 'mcpb') {
|
|
30
|
+
return `In Claude Desktop, download ${BUNDLE_URL} and open it to install the update.`;
|
|
31
|
+
}
|
|
32
|
+
if (/[\\/]_npx[\\/]/.test(process.argv[1] ?? '')) {
|
|
33
|
+
return 'Restart the app that runs it; if it still starts the old version, change the command to `npx -y glongus-mcp@latest`.';
|
|
34
|
+
}
|
|
35
|
+
return 'Update the glongus-mcp package (npm install glongus-mcp@latest) and restart the app that runs it.';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// One look at npm per start. Any failure just means no notice. Set
|
|
39
|
+
// GLONGUS_NO_UPDATE_CHECK=1 to turn it off.
|
|
40
|
+
async function checkForUpdate() {
|
|
41
|
+
if (process.env.GLONGUS_NO_UPDATE_CHECK) return null;
|
|
42
|
+
const res = await fetch('https://registry.npmjs.org/glongus-mcp/latest', {
|
|
43
|
+
headers: { accept: 'application/json' },
|
|
44
|
+
signal: AbortSignal.timeout(5000),
|
|
45
|
+
});
|
|
46
|
+
if (!res.ok) return null;
|
|
47
|
+
const { version: latest } = await res.json();
|
|
48
|
+
if (typeof latest !== 'string' || !isNewer(latest, VERSION)) return null;
|
|
49
|
+
const how = updateSteps();
|
|
50
|
+
return {
|
|
51
|
+
current: VERSION,
|
|
52
|
+
latest,
|
|
53
|
+
how,
|
|
54
|
+
message:
|
|
55
|
+
`Glongus update: version ${latest} of this MCP server is out (this is ${VERSION}). Mention it to your owner once, ` +
|
|
56
|
+
`not every turn. ${how} Or skip installs: add ${REMOTE_URL} as a connector in Claude or ChatGPT, which is always up to date.`,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
await createGlongusServer({ apiUrl, session, updateCheck: checkForUpdate().catch(() => null) }).connect(
|
|
61
|
+
new StdioServerTransport()
|
|
62
|
+
);
|
package/src/tools.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
13
13
|
import { z } from 'zod';
|
|
14
14
|
|
|
15
|
-
export const VERSION = '0.13.
|
|
15
|
+
export const VERSION = '0.13.1';
|
|
16
16
|
|
|
17
17
|
export class ApiError extends Error {
|
|
18
18
|
constructor(status, code, message) {
|
|
@@ -127,10 +127,21 @@ const asText = (data) => ({ content: [{ type: 'text', text: JSON.stringify(data,
|
|
|
127
127
|
|
|
128
128
|
// remote: true for the OAuth endpoint, where every call is signed in and there
|
|
129
129
|
// is no API key to configure, so tool descriptions drop the key reminders.
|
|
130
|
-
|
|
130
|
+
// updateCheck: for local installs, a promise of { current, latest, message }
|
|
131
|
+
// when a newer version is out (null otherwise). The remote server is always
|
|
132
|
+
// current, so it passes none.
|
|
133
|
+
export function createGlongusServer({ apiUrl, session, remote = false, updateCheck = null }) {
|
|
131
134
|
const api = createApi(apiUrl);
|
|
132
135
|
const REQ = remote ? '' : ' Requires GLONGUS_API_KEY.';
|
|
133
136
|
|
|
137
|
+
// Read without waiting: a tool call never waits on the update check, so the
|
|
138
|
+
// note rides the first tool result after the check comes back, once.
|
|
139
|
+
let update = null;
|
|
140
|
+
let updateNoticeShown = false;
|
|
141
|
+
updateCheck?.then((u) => {
|
|
142
|
+
update = u;
|
|
143
|
+
}, () => {});
|
|
144
|
+
|
|
134
145
|
// Authenticated call that retries once on 401 (expired/revoked token).
|
|
135
146
|
async function agentApi(path, opts = {}) {
|
|
136
147
|
let { token } = await session.getToken();
|
|
@@ -202,6 +213,10 @@ export function createGlongusServer({ apiUrl, session, remote = false }) {
|
|
|
202
213
|
text: `Glongus check-in alerts (piggybacked GET /heartbeat — act on these or relay them to your owner):\n${JSON.stringify(alerts, null, 2)}`,
|
|
203
214
|
});
|
|
204
215
|
}
|
|
216
|
+
if (update && !updateNoticeShown) {
|
|
217
|
+
updateNoticeShown = true;
|
|
218
|
+
result.content.push({ type: 'text', text: update.message });
|
|
219
|
+
}
|
|
205
220
|
return result;
|
|
206
221
|
};
|
|
207
222
|
|
|
@@ -428,7 +443,11 @@ export function createGlongusServer({ apiUrl, session, remote = false }) {
|
|
|
428
443
|
inputSchema: {},
|
|
429
444
|
},
|
|
430
445
|
tool(async () => {
|
|
431
|
-
const base =
|
|
446
|
+
const base = {
|
|
447
|
+
...session.describe(),
|
|
448
|
+
...(remote ? {} : { server_version: VERSION }),
|
|
449
|
+
...(update ? { update_available: { latest: update.latest, how: update.how } } : {}),
|
|
450
|
+
};
|
|
432
451
|
if (!session.configured) return asText(base);
|
|
433
452
|
try {
|
|
434
453
|
const [{ identity }, { wallet }] = await Promise.all([agentApi('/agents/me'), agentApi('/wallet/balance')]);
|