nuuly-postgres-mcp-server


Namenuuly-postgres-mcp-server JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryMCP server for accessing Nuuly PostgreSQL database resources
upload_time2025-07-16 20:33:05
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseProprietary
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Nuuly Postgres MCP Server

MCP server for accessing Nuuly PostgreSQL database resources through Claude Desktop and other AI assistants.

## Contents
- `src/nuuly_postgres_mcp_server/`: Package source code
  - `__init__.py`: Package initialization
  - `__main__.py`: Entry point for running as a module
  - `server.py`: Main server implementation
- `pyproject.toml`: Package configuration
- `.env.example`: Example environment variables

## Purpose
This MCP server provides PostgreSQL database connectivity functionality for the broader MCP platform. It connects to CloudSQL Postgres non-prod databases and enables AI code editors to:

1. Understand all tables and schemas
2. Run queries against the non-prod database
3. List available databases and their aliases

---

## Installation

### Option 1: Install from PyPI

```bash
pip install nuuly-postgres-mcp-server
```

### Option 2: Install from Source

1. Clone the repository:
```bash
git clone <REPO_URL>
cd r15-mcp/mcp_servers/postgres-mcp
```

2. Install the package in development mode:
```bash
pip install -e .
```

## Local Development

### Prerequisites
- Python 3.8 or higher
- pip package manager

### Setup

1. Clone the repository:
```bash
git clone <REPO_URL>
cd r15-mcp/mcp_servers/postgres-mcp
```

2. Create and activate a virtual environment (optional but recommended):
```bash
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
```

3. Install development dependencies:
```bash
pip install -e .
```

4. Set up environment variables:
```bash
cp .env.example .env
# Edit .env with your actual values
```

## Environment Variables

The following environment variables can be set to customize the behavior of the MCP server:

- `POSTGRES_MCP_SERVER_URL`: URL of the Cloud Run DB Proxy (default: "https://postgres-mcp-toolbox-186512416539.us-east4.run.app")
- `DB_PROXY_API_KEY`: API key for authenticating with the Cloud Run DB Proxy (required)
- `LOG_LEVEL`: Logging level (default: INFO)

## Usage

### For Claude Desktop

Add this configuration to your Claude Desktop settings:

```json
{
  "Nuuly Postgres MCP": {
    "command": "nuuly-postgres-mcp",
    "env": {
      "PYTHONUNBUFFERED": "1",
      "POSTGRES_MCP_SERVER_URL": "https://postgres-mcp-toolbox-186512416539.us-east4.run.app",
      "DB_PROXY_API_KEY": "YOUR_API_KEY_HERE"
    }
  }
}
```

### Command Line Usage

```bash
nuuly-postgres-mcp
```

## Deployment

### As a GCP Cloud Function

This MCP server is designed to be deployed as a GCP Cloud Function with the following parameters:

- Project: `rental-dev`
- Region: `us-east4`
- Serverless VPC Connector: `rental-vpc-connector`
- Entry point: `main.py`

The function connects to CloudSQL PostgreSQL using private IP (10.171.208.52) and uses environment variables for DB credentials.

```yaml
environment_variables:
  POSTGRES_MCP_SERVER_URL: "https://postgres-mcp-toolbox-186512416539.us-east4.run.app"
  DB_PROXY_API_KEY: "${DB_PROXY_API_KEY}"
  LOG_LEVEL: "INFO"
```

### Building and Publishing the Package

To build and publish the package to PyPI:

```bash
python -m build
python -m twine upload dist/*
```

## Available Tools

This MCP server provides the following tools to AI assistants:

- `run_query`: Execute SQL queries against the database
- `get_schema`: Get database schema information
- `list_databases`: List available databases

## Troubleshooting

### Connection Issues with Claude Desktop

If you experience connection issues with Claude Desktop (client transport closing), ensure that:

1. The server is running with the correct URL for the Cloud Run DB Proxy
2. The API key is correctly set and properly escaped in any curl commands (use single quotes)
3. The server is properly handling heartbeat and shutdown messages
4. The JSON-RPC initialization response includes `keepAlive: true` and `supportsHeartbeats: true`

Example curl command to test the API:
```bash
curl -X GET "https://postgres-mcp-toolbox-186512416539.us-east4.run.app/databases" -H 'X-API-KEY: YOUR_API_KEY_HERE'
```

### Common Issues

- **Missing API Key**: Ensure the `DB_PROXY_API_KEY` environment variable is set
- **Permission Errors**: Verify that your API key has the necessary permissions
- **Timeout Errors**: Check network latency or increase the timeout settings in the code
- **Heartbeat Issues**: Ensure the MCP server properly implements heartbeat handlers

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "nuuly-postgres-mcp-server",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Nuuly Engineering <engineering@nuuly.com>",
    "download_url": "https://files.pythonhosted.org/packages/be/bf/0b177eeb254c0d0126fd356f277d35877e88068caf175d0f29f9f5ae7680/nuuly_postgres_mcp_server-1.0.1.tar.gz",
    "platform": null,
    "description": "# Nuuly Postgres MCP Server\n\nMCP server for accessing Nuuly PostgreSQL database resources through Claude Desktop and other AI assistants.\n\n## Contents\n- `src/nuuly_postgres_mcp_server/`: Package source code\n  - `__init__.py`: Package initialization\n  - `__main__.py`: Entry point for running as a module\n  - `server.py`: Main server implementation\n- `pyproject.toml`: Package configuration\n- `.env.example`: Example environment variables\n\n## Purpose\nThis MCP server provides PostgreSQL database connectivity functionality for the broader MCP platform. It connects to CloudSQL Postgres non-prod databases and enables AI code editors to:\n\n1. Understand all tables and schemas\n2. Run queries against the non-prod database\n3. List available databases and their aliases\n\n---\n\n## Installation\n\n### Option 1: Install from PyPI\n\n```bash\npip install nuuly-postgres-mcp-server\n```\n\n### Option 2: Install from Source\n\n1. Clone the repository:\n```bash\ngit clone <REPO_URL>\ncd r15-mcp/mcp_servers/postgres-mcp\n```\n\n2. Install the package in development mode:\n```bash\npip install -e .\n```\n\n## Local Development\n\n### Prerequisites\n- Python 3.8 or higher\n- pip package manager\n\n### Setup\n\n1. Clone the repository:\n```bash\ngit clone <REPO_URL>\ncd r15-mcp/mcp_servers/postgres-mcp\n```\n\n2. Create and activate a virtual environment (optional but recommended):\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n```\n\n3. Install development dependencies:\n```bash\npip install -e .\n```\n\n4. Set up environment variables:\n```bash\ncp .env.example .env\n# Edit .env with your actual values\n```\n\n## Environment Variables\n\nThe following environment variables can be set to customize the behavior of the MCP server:\n\n- `POSTGRES_MCP_SERVER_URL`: URL of the Cloud Run DB Proxy (default: \"https://postgres-mcp-toolbox-186512416539.us-east4.run.app\")\n- `DB_PROXY_API_KEY`: API key for authenticating with the Cloud Run DB Proxy (required)\n- `LOG_LEVEL`: Logging level (default: INFO)\n\n## Usage\n\n### For Claude Desktop\n\nAdd this configuration to your Claude Desktop settings:\n\n```json\n{\n  \"Nuuly Postgres MCP\": {\n    \"command\": \"nuuly-postgres-mcp\",\n    \"env\": {\n      \"PYTHONUNBUFFERED\": \"1\",\n      \"POSTGRES_MCP_SERVER_URL\": \"https://postgres-mcp-toolbox-186512416539.us-east4.run.app\",\n      \"DB_PROXY_API_KEY\": \"YOUR_API_KEY_HERE\"\n    }\n  }\n}\n```\n\n### Command Line Usage\n\n```bash\nnuuly-postgres-mcp\n```\n\n## Deployment\n\n### As a GCP Cloud Function\n\nThis MCP server is designed to be deployed as a GCP Cloud Function with the following parameters:\n\n- Project: `rental-dev`\n- Region: `us-east4`\n- Serverless VPC Connector: `rental-vpc-connector`\n- Entry point: `main.py`\n\nThe function connects to CloudSQL PostgreSQL using private IP (10.171.208.52) and uses environment variables for DB credentials.\n\n```yaml\nenvironment_variables:\n  POSTGRES_MCP_SERVER_URL: \"https://postgres-mcp-toolbox-186512416539.us-east4.run.app\"\n  DB_PROXY_API_KEY: \"${DB_PROXY_API_KEY}\"\n  LOG_LEVEL: \"INFO\"\n```\n\n### Building and Publishing the Package\n\nTo build and publish the package to PyPI:\n\n```bash\npython -m build\npython -m twine upload dist/*\n```\n\n## Available Tools\n\nThis MCP server provides the following tools to AI assistants:\n\n- `run_query`: Execute SQL queries against the database\n- `get_schema`: Get database schema information\n- `list_databases`: List available databases\n\n## Troubleshooting\n\n### Connection Issues with Claude Desktop\n\nIf you experience connection issues with Claude Desktop (client transport closing), ensure that:\n\n1. The server is running with the correct URL for the Cloud Run DB Proxy\n2. The API key is correctly set and properly escaped in any curl commands (use single quotes)\n3. The server is properly handling heartbeat and shutdown messages\n4. The JSON-RPC initialization response includes `keepAlive: true` and `supportsHeartbeats: true`\n\nExample curl command to test the API:\n```bash\ncurl -X GET \"https://postgres-mcp-toolbox-186512416539.us-east4.run.app/databases\" -H 'X-API-KEY: YOUR_API_KEY_HERE'\n```\n\n### Common Issues\n\n- **Missing API Key**: Ensure the `DB_PROXY_API_KEY` environment variable is set\n- **Permission Errors**: Verify that your API key has the necessary permissions\n- **Timeout Errors**: Check network latency or increase the timeout settings in the code\n- **Heartbeat Issues**: Ensure the MCP server properly implements heartbeat handlers\n",
    "bugtrack_url": null,
    "license": "Proprietary",
    "summary": "MCP server for accessing Nuuly PostgreSQL database resources",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/urbn/r15-mcp",
        "Repository": "https://github.com/urbn/r15-mcp"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3ef82d4e36feb59310b841f43e505148f515e55adb937c83355330136fd630ed",
                "md5": "9b1961721884d6a6834746bfb3d0368a",
                "sha256": "4d62ef1cf4ba8a883bcec333332c82244be78c6be787ee39a30942ec80ccbc2c"
            },
            "downloads": -1,
            "filename": "nuuly_postgres_mcp_server-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9b1961721884d6a6834746bfb3d0368a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5912,
            "upload_time": "2025-07-16T20:33:04",
            "upload_time_iso_8601": "2025-07-16T20:33:04.411010Z",
            "url": "https://files.pythonhosted.org/packages/3e/f8/2d4e36feb59310b841f43e505148f515e55adb937c83355330136fd630ed/nuuly_postgres_mcp_server-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "bebf0b177eeb254c0d0126fd356f277d35877e88068caf175d0f29f9f5ae7680",
                "md5": "acc164b6c57bcc5ecdeda877282d5089",
                "sha256": "12d256be4fa9c9f0f3a29f03efbccc5984fdb7ea569491cf0be40c7681eaf8ee"
            },
            "downloads": -1,
            "filename": "nuuly_postgres_mcp_server-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "acc164b6c57bcc5ecdeda877282d5089",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5047,
            "upload_time": "2025-07-16T20:33:05",
            "upload_time_iso_8601": "2025-07-16T20:33:05.801085Z",
            "url": "https://files.pythonhosted.org/packages/be/bf/0b177eeb254c0d0126fd356f277d35877e88068caf175d0f29f9f5ae7680/nuuly_postgres_mcp_server-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-16 20:33:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "urbn",
    "github_project": "r15-mcp",
    "github_not_found": true,
    "lcname": "nuuly-postgres-mcp-server"
}
        
Elapsed time: 1.62079s