MCP server for database schema discovery across PostgreSQL, MySQL, SQL Server, and Salesforce
Project description
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:
--config/-cCLI argumentMCP_SCHEMA_FETCH_CONFIGenvironment variable./config/db_registry.yaml(current directory)~/.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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f3c5d1b52143519a2f1a520a81c198235cde39a575d520aa8fca410e82bcb3e
|
|
| MD5 |
6b4d8f62a944ee80ee8c0b0df9664bda
|
|
| BLAKE2b-256 |
af523b8550a25261b157404abd122c2eddab1a96eebf89341829b5f980e248e8
|
File details
Details for the file mcp_schema_fetch-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_schema_fetch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29ef4383e3ea56638f74cd9f9f11396af6451bda7378101065444416d1336e18
|
|
| MD5 |
8086a77e4b2ef4860f5dd6961e992573
|
|
| BLAKE2b-256 |
b79c72f4edb3881b393e3e6e8450a9291ebb6f964d14c46913f4640a0f2feb94
|