mcp-server-postgres-multi-schema

mcp-server-postgres-multi-schema

3

The PostgreSQL Multi-Schema MCP Server is an MCP-based solution providing read-only access to PostgreSQL databases with enhanced support for multiple schemas. It allows the inspection and querying of database schemas across namespaces while ensuring schema isolation and metadata security.

PostgreSQL Multi-Schema MCP Server

A Model Context Protocol server that provides read-only access to PostgreSQL databases with enhanced multi-schema support. This server enables inspection of database schemas across multiple namespaces and allows execution of read-only queries while maintaining schema isolation.

Key Features

  • Multi-Schema Support: Specify schemas to expose via command-line configuration
  • Schema Isolation: Access control to authorized schemas
  • Cross-Schema Discovery: Unified view of tables across schemas
  • Metadata Security: Filters system catalogs to expose user-defined tables

Components

Tools

  • query
    • Execute read-only SQL queries

Resources

  • Table Schemas
    • JSON schema information including column names and data types

Usage

  • Requires a database URL and a list of schemas:
    • npx -y mcp-server-postgres-multi-schema <database-url> [schemas]
    • Defaults to 'public' schema if not specified

License

Licensed under the MIT License.