@yawlabs/postgres-mcp 0.6.17 → 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.
Files changed (3) hide show
  1. package/README.md +4 -4
  2. package/dist/index.js +33 -28
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -7,9 +7,9 @@
7
7
 
8
8
  Built and maintained by [Yaw Labs](https://yaw.sh).
9
9
 
10
- [![Add to mcp.hosting](https://mcp.hosting/install-button.svg)](https://mcp.hosting/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)
10
+ [![Add to Yaw MCP](https://yaw.sh/yaw-mcp-button.svg)](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
- One click adds this to your [mcp.hosting](https://mcp.hosting) account so it syncs to every MCP client you use. Or install manually below.
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
 
14
14
  ## Backstory
15
15
 
@@ -51,7 +51,7 @@ macOS / Linux / WSL:
51
51
  "mcpServers": {
52
52
  "postgres": {
53
53
  "command": "npx",
54
- "args": ["-y", "@yawlabs/postgres-mcp"],
54
+ "args": ["-y", "@yawlabs/postgres-mcp@latest"],
55
55
  "env": {
56
56
  "DATABASE_URL": "postgres://user:password@host:5432/dbname"
57
57
  }
@@ -67,7 +67,7 @@ Windows:
67
67
  "mcpServers": {
68
68
  "postgres": {
69
69
  "command": "cmd",
70
- "args": ["/c", "npx", "-y", "@yawlabs/postgres-mcp"],
70
+ "args": ["/c", "npx", "-y", "@yawlabs/postgres-mcp@latest"],
71
71
  "env": {
72
72
  "DATABASE_URL": "postgres://user:password@host:5432/dbname"
73
73
  }
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.17" : (await null).createRequire(import.meta.url)("../package.json").version;
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
- async (input) => {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yawlabs/postgres-mcp",
3
- "version": "0.6.17",
3
+ "version": "0.6.19",
4
4
  "mcpName": "io.github.YawLabs/postgres-mcp",
5
5
  "description": "PostgreSQL MCP server - query, schema introspection, explain, and health checks for AI assistants",
6
6
  "license": "MIT",