ODBC Database Connector MCP server

Enables secure, read-only access to any ODBC-compatible database through tools for listing connections, testing connectivity, retrieving schemas, and executing SQL queries for data analysis and business intelligence.
Back to servers
Provider
Tyler Stoltz
Release date
Mar 21, 2025
Language
Python

The ODBC MCP Server provides seamless integration between large language models and databases, allowing tools like Claude Desktop to query databases via ODBC connections while maintaining security through read-only safeguards.

Prerequisites

  • Python 3.10 or higher
  • UV package manager
  • ODBC drivers for your database(s)
  • For Sage 100 Advanced: ProvideX ODBC driver

Installation

git clone https://github.com/tylerstoltz/mcp-odbc.git
cd mcp-odbc
uv venv
.venv\Scripts\activate # On Mac / Linux: source .venv/bin/activate
uv pip install -e .

Configuration

The server can be configured through a config file, environment variables, or Claude Desktop configuration.

General Configuration Setup

Create a configuration file (.ini) with your database connection details:

[SERVER]
default_connection = my_database
max_rows = 1000
timeout = 30

[my_database]
dsn = MyDatabaseDSN
username = your_username
password = your_password
readonly = true

SQLite Configuration

For SQLite databases with ODBC:

[SERVER]
default_connection = sqlite_db
max_rows = 1000
timeout = 30

[sqlite_db]
dsn = SQLite_DSN_Name
readonly = true

Sage 100 ProvideX Configuration

ProvideX requires special configuration:

[SERVER]
default_connection = sage100
max_rows = 1000
timeout = 60

[sage100]
dsn = YOUR_PROVIDEX_DSN
username = your_username
password = your_password
company = YOUR_COMPANY_CODE
readonly = true

Important notes for ProvideX:

  • Use minimal configuration - extra parameters may cause connection issues
  • Always set readonly = true for safety
  • The company parameter is required for Sage 100
  • Avoid changing connection attributes after connection is established

Claude Desktop Integration

To configure the server in Claude Desktop:

  1. Open or create claude_desktop_config.json:

    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  2. Add MCP server configuration:

{
  "mcpServers": {
    "odbc": {
      "command": "uv",
      "args": [
        "--directory",
        "C:\\path\\to\\mcp-odbc",
        "run",
        "odbc-mcp-server",
        "--config", 
        "C:\\path\\to\\mcp-odbc\\config\\your_config.ini"
      ]
    }
  }
}

Usage

Starting the Server Manually

# Start with default configuration
odbc-mcp-server

# Start with a specific config file
odbc-mcp-server --config path/to/config.ini

Using with Claude Desktop

  1. Configure the server in Claude Desktop's config file
  2. Restart Claude Desktop
  3. The ODBC tools will automatically appear in the MCP tools list

Available MCP Tools

The ODBC MCP server provides these tools:

  • list-connections: Lists all configured database connections
  • list-available-dsns: Lists all available DSNs on the system
  • test-connection: Tests a database connection and returns information
  • list-tables: Lists all tables in the database
  • get-table-schema: Gets schema information for a table
  • execute-query: Executes an SQL query and returns results

Example Queries

Try these prompts in Claude Desktop:

  • "Show me all the tables in the database"
  • "What's the schema of the Customer table?"
  • "Run a query to get the first 10 customers"
  • "Find all orders placed in the last 30 days"
  • "Analyze the sales data by region and provide insights"

Troubleshooting

Connection Issues

If you encounter connection problems:

  1. Verify your ODBC drivers are installed correctly
  2. Test your DSN using the ODBC Data Source Administrator
  3. Check connection parameters in your config file
  4. Look for detailed error messages in Claude Desktop logs

ProvideX-Specific Issues

For Sage 100/ProvideX:

  • Use minimal connection configuration (DSN, username, password, company)
  • Make sure the Company parameter is correct
  • Use the special ProvideX configuration template
  • If you encounter Driver not capable errors, check that autocommit is being set

Missing Tables

If tables aren't showing up:

  • Verify user permissions for the database account
  • Check if the company code is correct (for Sage 100)
  • Try using fully qualified table names (schema.table)

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later