mcp-odbc mcp

v1.1.0 · MCP Tool · database · registry.pascalai.org

Generic ODBC access via FireDAC. Connects to any database with an ODBC driver: Snowflake, IBM DB2, Teradata, SAP HANA, MS Access, Excel, etc. Auth via dSN (pre-configured DSN name) or oDBCDriver + host/database. Operations: query, execute, execute_tx, list_tables, describe, list_databases.

odbcdatabasesqlsnowflakedb2teradatahanaaccessfiredacgeneric

Input Parameters

ParameterTypeDescription
operationrequired string Operation to perform. One of: query, execute, execute_tx, list_tables, describe, list_databases.
dSNoptional string ODBC Data Source Name configured in ODBC Data Source Administrator (e.g. 'Northwind', 'SnowflakeDSN'). Use this or oDBCDriver, not both.
oDBCDriveroptional string ODBC driver name in curly braces (e.g. '{ODBC Driver 17 for SQL Server}', '{Snowflake}', '{IBM DB2 ODBC DRIVER}'). Used when no pre-configured DSN exists.
hostoptional string Server host or IP. Required when using oDBCDriver.
portoptional integer Server port. Optional, depends on driver.
databaseoptional string Database or schema name. Required when using oDBCDriver.
usernameoptional string Username for authentication.
passwordoptional string Password for authentication.
sQLoptional string SQL statement. Required for query and execute operations.
sQLListoptional string JSON array string of SQL statements for execute_tx. All executed in a single transaction.
tableoptional string Table name. Required for describe operation.
schemaoptional string Schema/owner filter for list_tables and describe.
maxRowsoptional integer Maximum rows to return for query. Default: 100. Default: 100.
timeoutoptional integer Query timeout in seconds. Default: 30. Default: 30.

Output Fields

FieldTypeDescription
ok boolean
rows array[object]
affected integer
tables array[object]
columns array[object]
databases array[string]
error string

Examples

Query via pre-configured DSN

// Input
{
  "operation": "query",
  "dSN": "NorthwindDSN",
  "username": "sa",
  "password": "secret",
  "sQL": "SELECT TOP 10 OrderID, CustomerID FROM Orders",
  "maxRows": 10
}

// Output
{
  "ok": true,
  "rows": [
    {
      "OrderID": 10248,
      "CustomerID": "VINET"
    }
  ]
}

Connect to Snowflake without DSN

// Input
{
  "operation": "query",
  "oDBCDriver": "{SnowflakeDSIIDriver}",
  "host": "account.snowflakecomputing.com",
  "database": "ANALYTICS",
  "username": "analyst",
  "password": "secret",
  "sQL": "SELECT TOP 100 * FROM SALES.ORDERS WHERE order_date >= '2024-01-01'"
}

// Output
{
  "ok": true,
  "rows": []
}

Connect to IBM DB2

// Input
{
  "operation": "list_tables",
  "oDBCDriver": "{IBM DB2 ODBC DRIVER}",
  "host": "db2server",
  "port": 50000,
  "database": "SAMPLE",
  "username": "db2inst1",
  "password": "secret",
  "schema": "DB2INST1"
}

// Output
{
  "ok": true,
  "tables": [
    {
      "TABLE_NAME": "EMPLOYEE"
    }
  ]
}

Execute a statement

// Input
{
  "operation": "execute",
  "dSN": "HanaDSN",
  "username": "SYSTEM",
  "password": "secret",
  "sQL": "UPDATE SALES.ORDERS SET STATUS = 'CLOSED' WHERE ORDER_ID = 1001"
}

// Output
{
  "ok": true,
  "affected": 1
}

Install & Discovery

Install

ppm install mcp-odbc

Get JSON Schema

GET /v1/packages/mcp-odbc/1.1.0/schema

Discover by keyword

GET /v1/mcp/discover?q=odbc
Discovery hint: Install with ppm install mcp-odbc or invoke remotely via POST /v1/invoke/mcp-odbc on the MCP Service.