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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_schema_fetch-0.1.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_schema_fetch-0.1.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file mcp_schema_fetch-0.1.0.tar.gz.

File metadata

  • Download URL: mcp_schema_fetch-0.1.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for mcp_schema_fetch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6f3c5d1b52143519a2f1a520a81c198235cde39a575d520aa8fca410e82bcb3e
MD5 6b4d8f62a944ee80ee8c0b0df9664bda
BLAKE2b-256 af523b8550a25261b157404abd122c2eddab1a96eebf89341829b5f980e248e8

See more details on using hashes here.

File details

Details for the file mcp_schema_fetch-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_schema_fetch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29ef4383e3ea56638f74cd9f9f11396af6451bda7378101065444416d1336e18
MD5 8086a77e4b2ef4860f5dd6961e992573
BLAKE2b-256 b79c72f4edb3881b393e3e6e8450a9291ebb6f964d14c46913f4640a0f2feb94

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page