Skip to content

Deployment: Dockerfile and Smithery config #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use Node.js 18 for compatibility with project requirements
FROM node:18-alpine AS builder

# Set the working directory
WORKDIR /app

# Copy package.json and package-lock.json to install dependencies
COPY package.json package-lock.json ./

# Install dependencies
RUN npm install

# Copy the entire source code
COPY . .

# Build the project using TypeScript
RUN npm run build

# Create a new stage for the release image
FROM node:18-alpine AS release

# Set the working directory
WORKDIR /app

# Copy built files and necessary configs from the builder stage
COPY --from=builder /app/build /app/build
COPY --from=builder /app/package.json /app/package.json
COPY --from=builder /app/package-lock.json /app/package-lock.json

# Install only production dependencies
RUN npm ci --omit=dev

# Set the command to run the server
ENTRYPOINT ["node", "build/index.js"]
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# PostgreSQL MCP Server

[![smithery badge](https://smithery.ai/badge/@nahmanmate/postgresql-mcp-server)](https://smithery.ai/server/@nahmanmate/postgresql-mcp-server)

A Model Context Protocol (MCP) server that provides PostgreSQL database management capabilities. This server assists with analyzing existing PostgreSQL setups, providing implementation guidance, and debugging database issues.

## Features
Expand Down Expand Up @@ -59,6 +61,15 @@ Debug common PostgreSQL issues:

## Installation

### Installing via Smithery

To install PostgreSQL MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@nahmanmate/postgresql-mcp-server):

```bash
npx -y @smithery/cli install @nahmanmate/postgresql-mcp-server --client claude
```

### Manual Installation
1. Clone the repository
2. Install dependencies:
```bash
Expand Down
17 changes: 17 additions & 0 deletions smithery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml

startCommand:
type: stdio
configSchema:
# JSON Schema defining the configuration options for the MCP.
type: object
required:
- connectionString
properties:
connectionString:
type: string
description: PostgreSQL connection string required for server operations.
commandFunction:
# A function that produces the CLI command to start the MCP on stdio.
|-
(config) => ({command: 'node', args: ['build/index.js'], env: {}})