pervasive-sql-mcp

janjic-portside/pervasive-sql-mcp

3.2

If you are the rightful owner of pervasive-sql-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A Model Context Protocol (MCP) server for interacting with Pervasive SQL databases via ODBC.

Tools
5
Resources
0
Prompts
0

Pervasive SQL MCP Server

A Model Context Protocol (MCP) server that provides tools for interacting with Pervasive SQL databases via ODBC.

Prerequisites

  1. Pervasive ODBC Driver - Must be installed and configured on your Windows system
  2. DSN Configuration - Create a System or User DSN via ODBC Data Source Administrator
  3. Node.js - Version 18 or later
  4. Visual Studio Build Tools - Required for compiling the odbc native module (C++ workload)

Installation

# Install dependencies
npm install

# Build the project
npm run build

Troubleshooting odbc Installation

If npm install fails with C++/MSBuild errors:

  1. Install Visual Studio Build Tools
  2. Select "Desktop development with C++" workload
  3. Restart your terminal and retry npm install

Usage

Environment Variable (Recommended)

Set a default DSN so you don't need to specify it with every tool call:

$env:PERVASIVE_DSN = "YourPervasiveDsnName"

Running the Server

Development mode:

npm run dev

Production mode:

npm run build
npm start

MCP Host Configuration

For Cursor/Claude Desktop

Add to your MCP settings JSON:

{
  "mcpServers": {
    "pervasive-sql": {
      "command": "node",
      "args": ["C:\\Repos\\pervasive-mcp\\dist\\index.js"],
      "env": {
        "PERVASIVE_DSN": "YourPervasiveDsnName"
      }
    }
  }
}

Or using npx with tsx for development:

{
  "mcpServers": {
    "pervasive-sql": {
      "command": "npx",
      "args": ["tsx", "C:\\Repos\\pervasive-mcp\\src\\index.ts"],
      "env": {
        "PERVASIVE_DSN": "YourPervasiveDsnName"
      }
    }
  }
}

Available Tools

Connection & Testing

ToolDescription
test_connectionVerify database connectivity and return connection info

Querying

ToolDescription
queryExecute arbitrary SQL (SELECT, INSERT, UPDATE, DELETE, etc.)
execute_batchExecute multiple SQL statements in sequence
get_table_sampleGet a quick sample of rows from a table
get_row_countCount rows in a table with optional WHERE clause

Schema Discovery

ToolDescription
list_tablesList tables/views using ODBC metadata
describe_tableGet column details for a table
get_primary_keysGet primary key columns for a table
get_foreign_keysGet foreign key relationships
get_indexesGet index information for a table

Database Metadata

ToolDescription
get_catalogsList available database catalogs
get_schemasList available schemas
get_type_infoGet supported SQL data types
get_table_statisticsGet cardinality and statistics

Stored Procedures

ToolDescription
get_stored_proceduresList stored procedures
get_procedure_columnsGet procedure parameters
execute_procedureExecute a stored procedure

Tool Parameters

All tools accept these optional connection parameters:

  • dsn - ODBC DSN name (falls back to PERVASIVE_DSN env var)
  • username - Database username (if required)
  • password - Database password (if required)

Examples

Test Connection

Use test_connection to verify I can connect to the database

List All Tables

Use list_tables to show me all tables in the database

Describe a Table

Use describe_table with table "CUSTOMERS" to show the column structure

Run a Query

Use query with sql "SELECT TOP 10 * FROM CUSTOMERS WHERE STATUS = 'A'"

Get Row Count

Use get_row_count with table "ORDERS" and where "ORDER_DATE > '2024-01-01'"

Execute Stored Procedure

Use execute_procedure with procedure "sp_GetCustomerOrders" and parameters ["CUST001"]

Security Notes

  • Connection credentials can be passed per-tool-call or via environment variables
  • The server runs locally and communicates via stdio (no network exposure)
  • Be cautious with query and execute_batch tools - they can run any SQL including DELETE/DROP

License

MIT