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
- Pervasive ODBC Driver - Must be installed and configured on your Windows system
- DSN Configuration - Create a System or User DSN via ODBC Data Source Administrator
- Node.js - Version 18 or later
- Visual Studio Build Tools - Required for compiling the
odbcnative 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:
- Install Visual Studio Build Tools
- Select "Desktop development with C++" workload
- 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
| Tool | Description |
|---|---|
test_connection | Verify database connectivity and return connection info |
Querying
| Tool | Description |
|---|---|
query | Execute arbitrary SQL (SELECT, INSERT, UPDATE, DELETE, etc.) |
execute_batch | Execute multiple SQL statements in sequence |
get_table_sample | Get a quick sample of rows from a table |
get_row_count | Count rows in a table with optional WHERE clause |
Schema Discovery
| Tool | Description |
|---|---|
list_tables | List tables/views using ODBC metadata |
describe_table | Get column details for a table |
get_primary_keys | Get primary key columns for a table |
get_foreign_keys | Get foreign key relationships |
get_indexes | Get index information for a table |
Database Metadata
| Tool | Description |
|---|---|
get_catalogs | List available database catalogs |
get_schemas | List available schemas |
get_type_info | Get supported SQL data types |
get_table_statistics | Get cardinality and statistics |
Stored Procedures
| Tool | Description |
|---|---|
get_stored_procedures | List stored procedures |
get_procedure_columns | Get procedure parameters |
execute_procedure | Execute a stored procedure |
Tool Parameters
All tools accept these optional connection parameters:
dsn- ODBC DSN name (falls back toPERVASIVE_DSNenv 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
queryandexecute_batchtools - they can run any SQL including DELETE/DROP
License
MIT