@yawlabs/postgres-mcp 0.6.18 → 0.6.19
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/dist/index.js +33 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
Built and maintained by [Yaw Labs](https://yaw.sh).
|
|
9
9
|
|
|
10
|
-
[](yaw
|
|
10
|
+
[](https://yaw.sh/mcp/install?name=Postgres&command=npx&args=-y%2C%40yawlabs%2Fpostgres-mcp&description=Query%20PostgreSQL%20-%20schema%20introspection%2C%20EXPLAIN%20plans%2C%20health%20diagnostics%2C%20read-only%20by%20default&source=https%3A%2F%2Fgithub.com%2FYawLabs%2Fpostgres-mcp)
|
|
11
11
|
|
|
12
12
|
One click adds this to your local Yaw MCP config so it's available in every Yaw Terminal session. Or install manually below.
|
|
13
13
|
|
package/dist/index.js
CHANGED
|
@@ -36349,6 +36349,37 @@ async function shutdown() {
|
|
|
36349
36349
|
}
|
|
36350
36350
|
}
|
|
36351
36351
|
|
|
36352
|
+
// src/mcp-wrapper.ts
|
|
36353
|
+
function wrapToolHandler(handler) {
|
|
36354
|
+
return async (input) => {
|
|
36355
|
+
try {
|
|
36356
|
+
const result = await handler(input);
|
|
36357
|
+
const response = result;
|
|
36358
|
+
if (!response.ok) {
|
|
36359
|
+
return {
|
|
36360
|
+
content: [
|
|
36361
|
+
{
|
|
36362
|
+
type: "text",
|
|
36363
|
+
text: `Error: ${response.error || "Unknown error"}`
|
|
36364
|
+
}
|
|
36365
|
+
],
|
|
36366
|
+
isError: true
|
|
36367
|
+
};
|
|
36368
|
+
}
|
|
36369
|
+
const text = JSON.stringify(response.data ?? { success: true }, null, 2);
|
|
36370
|
+
return {
|
|
36371
|
+
content: [{ type: "text", text }]
|
|
36372
|
+
};
|
|
36373
|
+
} catch (err) {
|
|
36374
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
36375
|
+
return {
|
|
36376
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
36377
|
+
isError: true
|
|
36378
|
+
};
|
|
36379
|
+
}
|
|
36380
|
+
};
|
|
36381
|
+
}
|
|
36382
|
+
|
|
36352
36383
|
// src/tools/params.ts
|
|
36353
36384
|
var paramValue = external_exports.lazy(
|
|
36354
36385
|
() => external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean(), external_exports.null(), external_exports.array(paramValue), external_exports.record(external_exports.string(), paramValue)])
|
|
@@ -37610,7 +37641,7 @@ function compareVersions(a, b) {
|
|
|
37610
37641
|
}
|
|
37611
37642
|
|
|
37612
37643
|
// src/index.ts
|
|
37613
|
-
var version2 = true ? "0.6.
|
|
37644
|
+
var version2 = true ? "0.6.19" : (await null).createRequire(import.meta.url)("../package.json").version;
|
|
37614
37645
|
var subcommand = process.argv[2];
|
|
37615
37646
|
if (subcommand === "version" || subcommand === "--version") {
|
|
37616
37647
|
console.log(version2);
|
|
@@ -37627,33 +37658,7 @@ for (const tool of allTools) {
|
|
|
37627
37658
|
tool.description,
|
|
37628
37659
|
tool.inputSchema.shape,
|
|
37629
37660
|
tool.annotations,
|
|
37630
|
-
|
|
37631
|
-
try {
|
|
37632
|
-
const result = await tool.handler(input);
|
|
37633
|
-
const response = result;
|
|
37634
|
-
if (!response.ok) {
|
|
37635
|
-
return {
|
|
37636
|
-
content: [
|
|
37637
|
-
{
|
|
37638
|
-
type: "text",
|
|
37639
|
-
text: `Error: ${response.error || "Unknown error"}`
|
|
37640
|
-
}
|
|
37641
|
-
],
|
|
37642
|
-
isError: true
|
|
37643
|
-
};
|
|
37644
|
-
}
|
|
37645
|
-
const text = JSON.stringify(response.data ?? { success: true }, null, 2);
|
|
37646
|
-
return {
|
|
37647
|
-
content: [{ type: "text", text }]
|
|
37648
|
-
};
|
|
37649
|
-
} catch (err) {
|
|
37650
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
37651
|
-
return {
|
|
37652
|
-
content: [{ type: "text", text: `Error: ${message}` }],
|
|
37653
|
-
isError: true
|
|
37654
|
-
};
|
|
37655
|
-
}
|
|
37656
|
-
}
|
|
37661
|
+
wrapToolHandler(tool.handler)
|
|
37657
37662
|
);
|
|
37658
37663
|
}
|
|
37659
37664
|
var transport = new StdioServerTransport();
|
package/package.json
CHANGED