@robosystems/mcp 0.3.10 → 0.3.11
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 +1 -1
- package/index.js +49 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ Add to your MCP servers configuration:
|
|
|
24
24
|
"mcpServers": {
|
|
25
25
|
"robosystems": {
|
|
26
26
|
"command": "npx",
|
|
27
|
-
"args": ["-y", "@robosystems/mcp"],
|
|
27
|
+
"args": ["-y", "@robosystems/mcp@latest"],
|
|
28
28
|
"env": {
|
|
29
29
|
"ROBOSYSTEMS_API_URL": "https://api.robosystems.ai",
|
|
30
30
|
"ROBOSYSTEMS_API_KEY": "rfs...",
|
package/index.js
CHANGED
|
@@ -30,6 +30,54 @@ const __dirname = dirname(__filename)
|
|
|
30
30
|
const packageJson = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf8'))
|
|
31
31
|
const PACKAGE_VERSION = packageJson.version
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Numeric semver compare for the three core components ("1.2.3").
|
|
35
|
+
* Pre-release tags are ignored — good enough for a stale-version warning.
|
|
36
|
+
*/
|
|
37
|
+
function _isNewerVersion(latest, current) {
|
|
38
|
+
const a = String(latest)
|
|
39
|
+
.split('.')
|
|
40
|
+
.map((n) => parseInt(n, 10) || 0)
|
|
41
|
+
const b = String(current)
|
|
42
|
+
.split('.')
|
|
43
|
+
.map((n) => parseInt(n, 10) || 0)
|
|
44
|
+
for (let i = 0; i < 3; i++) {
|
|
45
|
+
if (a[i] > b[i]) return true
|
|
46
|
+
if (a[i] < b[i]) return false
|
|
47
|
+
}
|
|
48
|
+
return false
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Best-effort check for a newer published version. Runs once at startup, never
|
|
53
|
+
* blocks, and only logs to stderr. Surfaces the silent stale-install problem: a
|
|
54
|
+
* global `npm i -g @robosystems/mcp` can shadow `npx -y` and pin an old version
|
|
55
|
+
* without any error, so a published update never reaches the user.
|
|
56
|
+
*/
|
|
57
|
+
async function checkForUpdate() {
|
|
58
|
+
try {
|
|
59
|
+
const controller = new AbortController()
|
|
60
|
+
const timer = setTimeout(() => controller.abort(), 2500)
|
|
61
|
+
const response = await fetch('https://registry.npmjs.org/@robosystems/mcp/latest', {
|
|
62
|
+
signal: controller.signal,
|
|
63
|
+
})
|
|
64
|
+
clearTimeout(timer)
|
|
65
|
+
if (!response.ok) return
|
|
66
|
+
const data = await response.json()
|
|
67
|
+
const latest = data?.version
|
|
68
|
+
if (latest && _isNewerVersion(latest, PACKAGE_VERSION)) {
|
|
69
|
+
console.error(
|
|
70
|
+
`⚠️ @robosystems/mcp ${latest} is available — you are running ${PACKAGE_VERSION}.`
|
|
71
|
+
)
|
|
72
|
+
console.error(' A global install can shadow `npx -y` and pin an old version. Update with:')
|
|
73
|
+
console.error(' npm i -g @robosystems/mcp@latest')
|
|
74
|
+
console.error(' or pin "@robosystems/mcp@latest" in your MCP config args.')
|
|
75
|
+
}
|
|
76
|
+
} catch {
|
|
77
|
+
// Best-effort only — never block or fail startup on the update check.
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
33
81
|
/**
|
|
34
82
|
* Simple SSE Connection Pool
|
|
35
83
|
* Reuses connections for better performance
|
|
@@ -1174,6 +1222,7 @@ async function main() {
|
|
|
1174
1222
|
}
|
|
1175
1223
|
|
|
1176
1224
|
console.error(`RoboSystems MCP Client v${PACKAGE_VERSION}`)
|
|
1225
|
+
void checkForUpdate() // fire-and-forget stale-version warning (stderr only)
|
|
1177
1226
|
console.error(`Connecting to ${baseUrl}`)
|
|
1178
1227
|
console.error(`Primary graph: ${graphId}`)
|
|
1179
1228
|
console.error(`API Key: ${apiKey.substring(0, 10)}...`)
|
package/package.json
CHANGED