Sign In

@marcelo-ochoa/server-postgres

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@marcelo-ochoa/server-postgres - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+19
-1
dist/server.js
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { CallToolRequestSchema, ListResourcesRequestSchema, ListResourceTemplatesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
import { z } from "zod";
import { initializePool } from "./db.js";

@@ -9,3 +10,3 @@ import { listResourcesHandler, readResourceHandler, callToolHandler } from "./handlers.js";

name: "postgres-server",
version: "1.0.0",
version: "1.0.1",
}, {

@@ -15,4 +16,21 @@ capabilities: {

tools: {},
prompts: {}, // Add this line to indicate support for prompts
},
});
const prompts = [
{ id: 1, text: "pg-query select * from test" },
{ id: 2, text: "pg-explain select * from test" },
{ id: 3, text: "pg-stats test" },
{ id: 4, text: "pg-connect to PostgreSQL using a connection string like host.docker.internal:5432/dbname with user name and password" },
{ id: 5, text: "pg-awr to generate a PostgreSQL performance report (requires pg_stat_statements extension)" }
];
const PromptsListRequestSchema = z.object({
method: z.literal("prompts/list"),
params: z.object({}),
});
server.setRequestHandler(PromptsListRequestSchema, async () => {
return {
prompts,
};
});
server.setRequestHandler(ListResourceTemplatesRequestSchema, async () => {

@@ -19,0 +37,0 @@ return {

+2
-2
{
"name": "@marcelo-ochoa/server-postgres",
"mcpName": "io.github.marcelo-ochoa/postgres",
"version": "1.0.0",
"version": "1.0.1",
"description": "MCP server for interacting with PostgreSQL databases",

@@ -30,3 +30,3 @@ "keywords": [

"dependencies": {
"@modelcontextprotocol/sdk": "1.0.1",
"@modelcontextprotocol/sdk": "^1.24.2",
"@toon-format/toon": "^1.0.0",

@@ -33,0 +33,0 @@ "pg": "^8.13.0"

@@ -43,3 +43,3 @@ # PostgreSQL

See [Change Log](CHANGELOG.md) for the history of changes.
See [Change Log](https://github.com/marcelo-ochoa/servers/blob/main/src/postgres/CHANGELOG.md) for the history of changes.

@@ -217,3 +217,3 @@ ## Configuration

See [PostgreSQL AWR in action](AWR_example.md) for an example of a performance report generated by the `pg-awr` tool for a production Moodle database, highlighting critical performance issues and optimization opportunities.
See [PostgreSQL AWR in action](https://github.com/marcelo-ochoa/servers/blob/main/src/postgres/AWR_example.md) for an example of a performance report generated by the `pg-awr` tool for a production Moodle database, highlighting critical performance issues and optimization opportunities.

@@ -220,0 +220,0 @@ ## Building