vibeshield-mcp 0.1.0 → 0.1.1-canary.0
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/index.mjs +22 -3
- package/package.json +2 -2
- package/vibeshield-mcp-0.1.0.tgz +0 -0
package/index.mjs
CHANGED
|
@@ -75,20 +75,39 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
75
75
|
|
|
76
76
|
const raw = await response.text();
|
|
77
77
|
if (!response.ok) {
|
|
78
|
+
let errorMessage = null;
|
|
79
|
+
try {
|
|
80
|
+
const json = JSON.parse(raw);
|
|
81
|
+
if (json && typeof json.message === "string") {
|
|
82
|
+
errorMessage = json.message;
|
|
83
|
+
}
|
|
84
|
+
} catch (e) {
|
|
85
|
+
// ignore JSON parse errors, stick to raw or generic
|
|
86
|
+
}
|
|
87
|
+
|
|
78
88
|
if (response.status === 401 || response.status === 403) {
|
|
79
89
|
return {
|
|
80
|
-
content: [{
|
|
90
|
+
content: [{
|
|
91
|
+
type: "text",
|
|
92
|
+
text: errorMessage || "VibeShield token is invalid or revoked. Rotate it in the dashboard."
|
|
93
|
+
}],
|
|
81
94
|
isError: true
|
|
82
95
|
};
|
|
83
96
|
}
|
|
84
97
|
if (response.status === 429) {
|
|
85
98
|
return {
|
|
86
|
-
content: [{
|
|
99
|
+
content: [{
|
|
100
|
+
type: "text",
|
|
101
|
+
text: errorMessage || "VibeShield rate limit exceeded. Try again later."
|
|
102
|
+
}],
|
|
87
103
|
isError: true
|
|
88
104
|
};
|
|
89
105
|
}
|
|
90
106
|
return {
|
|
91
|
-
content: [{
|
|
107
|
+
content: [{
|
|
108
|
+
type: "text",
|
|
109
|
+
text: errorMessage ? `VibeShield gateway error: ${errorMessage}` : `VibeShield gateway error ${response.status}: ${raw}`
|
|
110
|
+
}],
|
|
92
111
|
isError: true,
|
|
93
112
|
};
|
|
94
113
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibeshield-mcp",
|
|
3
|
-
"version": "0.1.0",
|
|
3
|
+
"version": "0.1.1-canary.0",
|
|
4
4
|
"description": "VibeShield MCP shim (stdio)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
14
14
|
}
|
|
15
|
-
}
|
|
15
|
+
}
|
package/vibeshield-mcp-0.1.0.tgz
DELETED
|
Binary file
|