Db Metadata Extractor Mcp

io.github.Optisol-Business由 GitHub 帳號 Optisol-Business 發布v0.1.6更新於 Oct 24, 2026

Extract database metadata from PostgreSQL, Snowflake, SQL Server, BigQuery, and Oracle.

已驗證STDIO僅桌面資料庫開發者工具

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理從 PostgreSQL、Snowflake、SQL Server、BigQuery 與 Oracle 擷取結構描述中繼資料並存成 JSON,再進行查詢。

可以做什麼
從 PostgreSQL、Snowflake、SQL Server、BigQuery 或 Oracle 擷取完整結構描述中繼資料(資料表、欄位、主鍵、索引、條件約束),可限定某個 schema 或資料表清單,並存成本機 JSON 檔與統計摘要。依資料表名稱或欄位名稱搜尋、篩選已擷取的中繼資料檔,支援大型 schema 的分頁瀏覽。
適用情境
適合讓助理盤點或記錄資料庫結構、比較與瀏覽資料表及欄位定義,或在不依賴雲端服務的情況下產出本機 JSON 中繼資料快照。
執行需求
以 Python 套件(Python 3.8+)或 Docker 映像在本機透過 stdio 執行;需依資料庫安裝驅動程式,例如 psycopg2-binary、snowflake-connector-python、pyodbc/pymssql、google-cloud-bigquery 或 oracledb。需要能連線目標資料庫的網路,以及具備 SELECT、USAGE、CONNECT 權限的資料庫使用者;BigQuery 需 base64 編碼的服務帳戶金鑰。
安裝前請注意
資料庫憑證(使用者名稱、密碼、Snowflake 帳戶/倉儲/角色、BigQuery 服務帳戶金鑰)透過工具參數或環境變數傳入,會出現在助理對話與設定檔中。資料庫使用者應設為唯讀;擷取會把 JSON 檔寫入你指定的路徑。README 另提供 HTTP 傳輸方式,會讓伺服器暴露到本機之外。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Db Metadata Extractor Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

mcp-name: io.github.Optisol-Business/db-metadata-extractor-mcp

Database Metadata Extractor MCP Server

A Model Context Protocol (MCP) server that extracts and queries database schema metadata from PostgreSQL, Snowflake, SQL Server, BigQuery, and Oracle databases.

Features

  • ✅ Multi-database support: PostgreSQL, Snowflake, SQL Server (MSSQL), BigQuery, Oracle
  • ✅ Complete schema extraction: Tables, columns, primary keys, indexes, constraints
  • ✅ Local JSON output: Saves metadata directly to local folder (no cloud required)
  • ✅ Query interface: Search and filter metadata by table/column names
  • ✅ Pagination support: Browse large schemas efficiently
  • ✅ VS Code integration: Works with VS Code Agent Mode
  • ✅ CLI customizable: Transport options (stdio, HTTP)

Installation

From PyPI

bash
pip install db-metadata-extractor-mcp

From Source

bash
git clone https://github.com/Optisol-Business/db-metadata-extractor-mcp.gitcd db-metadata-extractor-mcppip install -e .

Quick Start

1. Start the MCP Server

bash
db-metadata-extractor-mcp

The server starts in stdio mode by default and listens for MCP client connections.

2. Configure in Claude Desktop

Add to ~/.config/Claude/claude_desktop_config.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

json
{  "mcpServers": {    "db-metadata-extractor": {      "command": "db-metadata-extractor-mcp",      "args": [],      "env": {}    }  }}

Restart Claude Desktop.

3. Use in Claude

Tell Claude:

Extract metadata from my PostgreSQL database and save it to /tmp/output

Claude will use the server's tools to extract and query your database schema.

Tools

extract_metadata

Extracts complete schema metadata from a database.

Parameters:

  • db_type (required): postgresql, snowflake, sqlserver, bigquery, oracle
  • output_path (required): Local directory for JSON output
  • database_name: Database/schema name
  • host: Database host (not needed for BigQuery/Snowflake)
  • port: Database port
  • username: Database user
  • password: Database password
  • schema_name: Specific schema (optional)
  • tables: Array of table names to extract (optional)
  • account: Snowflake account ID
  • warehouse: Snowflake warehouse
  • role_name: Snowflake role
  • project_id: BigQuery project ID
  • service_account_key: BigQuery service account JSON (base64 encoded)

Returns:

  • File path where metadata was saved
  • Summary statistics (table count, column count, etc.)

query_metadata

Query previously extracted metadata.

Parameters:

  • filepath (required): Path to metadata JSON file
  • table_name: Filter by table name (substring match)
  • field_name: Filter by column name (substring match)
  • page: Page number (default: 1)
  • page_size: Results per page (default: 20)

Returns:

  • Paginated table results matching filters

Examples

PostgreSQL

bash
# Via Claude"Extract all tables from my dev PostgreSQL database at localhost:5432"

Parameters Claude will use:

json
{  "db_type": "postgresql",  "host": "localhost",  "port": 5432,  "database_name": "dev_db",  "username": "postgres",  "password": "your_password",  "output_path": "/tmp/db_metadata"}

Snowflake

bash
"Extract schema from Snowflake account XYZ123"

Parameters:

json
{  "db_type": "snowflake",  "account": "XYZ123",  "username": "your_user",  "password": "your_password",  "warehouse": "COMPUTE_WH",  "role_name": "ANALYST",  "database_name": "PRODUCTION",  "output_path": "C:/metadata"}

BigQuery

bash
"Extract metadata from BigQuery project my-project-123"

Parameters:

json
{  "db_type": "bigquery",  "project_id": "my-project-123",  "service_account_key": "base64_encoded_json_key",  "output_path": "/tmp/bq_metadata"}

Advanced Usage

Custom Transport

Start with HTTP transport:

bash
db-metadata-extractor-mcp --transport streamable-http --port 3000

Environment Variables

bash
# Set database credentials via envexport DB_HOST=localhostexport DB_USER=postgresexport DB_PASSWORD=secret
db-metadata-extractor-mcp

Output Format

The extracted metadata is saved as a JSON file with structure:

json
{  "source": {    "db_type": "postgresql",    "extracted_at": "2026-04-09T14:30:00",    "host": "localhost"  },  "schemas": [    {      "schema_name": "public",      "tables": [        {          "table_name": "users",          "columns": [            {              "column_name": "id",              "data_type": "int",              "is_nullable": false,              "is_primary_key": true            },            {              "column_name": "email",              "data_type": "varchar",              "is_nullable": false            }          ],          "indexes": [            {              "index_name": "users_email_idx",              "columns": ["email"]            }          ]        }      ]    }  ]}

Requirements

  • Python 3.8+
  • For PostgreSQL: psycopg2-binary
  • For Snowflake: snowflake-connector-python
  • For SQL Server: pyodbc, pymssql
  • For BigQuery: google-cloud-bigquery
  • For Oracle: oracledb

Troubleshooting

Connection Errors

Problem: "Unable to connect to database"

Solution: Verify credentials and network access:

bash
# Test PostgreSQL connectionpsql -h localhost -U postgres -c "SELECT 1"
# Test Snowflakesnowsql -a XYZ123 -u your_user

Permission Errors

Problem: "Access denied" or "insufficient permissions"

Solution: Ensure database user has:

  • SELECT on tables
  • USAGE on schemas
  • CONNECT on databases

Large Schema Timeouts

Problem: Extraction times out on large databases

Solution: Extract specific schema/tables:

json
{  "schema_name": "public",  "tables": ["users", "orders"]  // Specify subset}

License

MIT License - See LICENSE file

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create feature branch
  3. Submit pull request

Support

Links

來源:README.md,提交 34ce92c

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.6最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。