Skip to main content

mcp-schema-fetch

MCP server for database schema discovery across PostgreSQL, MySQL, SQL Server, and Salesforce.

Installation

pip install mcp-schema-fetch

All database drivers (PostgreSQL, MySQL, SQL Server, Salesforce) are included.

Usage with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "schema-fetch": {
      "command": "mcp-schema-fetch",
      "args": ["--config", "/path/to/db_registry.yaml"]
    }
  }
}

Or use uvx to run without installing:

{
  "mcpServers": {
    "schema-fetch": {
      "command": "uvx",
      "args": ["mcp-schema-fetch", "--config", "/path/to/db_registry.yaml"]
    }
  }
}

Configuration

Create a db_registry.yaml file:

databases:
  my_postgres:
    type: postgresql
    host: ${PG_HOST:-localhost}
    port: 5432
    database: mydb
    username: ${PG_USER}
    password: ${PG_PASSWORD}
    schema: public

  salesforce:
    type: salesforce
    host: "login.salesforce.com"
    port: 443
    database: "production"
    username: ${SF_USER}
    password: ${SF_PASSWORD}
    security_token: ${SF_TOKEN}

Environment variables in ${VAR} or ${VAR:-default} format are automatically resolved.

Setup

Config File Discovery

The server looks for db_registry.yaml in this order:

  1. --config / -c CLI argument
  2. MCP_SCHEMA_FETCH_CONFIG environment variable
  3. ./config/db_registry.yaml (current directory)
  4. ~/.config/mcp-schema-fetch/db_registry.yaml (user config)

Tools

The recommended workflow is: list_databases -> list_tables -> get_table_schema.

list_databases

List all configured database connections.

Returns: { databases: [{ name, type }], count }

list_tables

List all tables in a database. For Salesforce, returns queryable SObjects.

Args: db_name
Returns: { database, tables: [string], count }

get_table_schema

Fetch column schema for a database table. Column types are normalized across vendors (e.g., VARCHAR, NVARCHAR, TEXT all become varchar).

Args: db_name, table_name
Returns: { database, table, schema, columns: [{ name, type, nullable }], column_count }

Development

git clone https://github.com/nickpeterson92/mcp-schema-fetch
cd mcp-schema-fetch
pip install -e ".[all,dev]"
pytest

Metadata

Release files for mcp-schema-fetch 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-schema-fetch 0.1.0
File Size Uploaded Provenance
mcp_schema_fetch-0.1.0.tar.gz 11.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-schema-fetch 0.1.0
File Interpreter ABI Platform
mcp_schema_fetch-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.8 kB

Release files / mcp_schema_fetch-0.1.0.tar.gz

Download URL mcp_schema_fetch-0.1.0.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6f3c5d1b52143519a2f1a520a81c198235cde39a575d520aa8fca410e82bcb3e
BLAKE2b-256 checksum
How to use checksums
af523b8550a25261b157404abd122c2eddab1a96eebf89341829b5f980e248e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / mcp_schema_fetch-0.1.0-py3-none-any.whl

Download URL mcp_schema_fetch-0.1.0-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29ef4383e3ea56638f74cd9f9f11396af6451bda7378101065444416d1336e18
BLAKE2b-256 checksum
How to use checksums
b79c72f4edb3881b393e3e6e8450a9291ebb6f964d14c46913f4640a0f2feb94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for mcp-schema-fetch 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page