CData Python MCP Server

CData Python MCP Server

Enables LLMs to query live data from over 250+ sources via CData Python Connectors using natural language. Wraps connectors as a Model Context Protocol server.

Category
访问服务器

README

cdata-python-mcp-server

A generic Model Context Protocol (MCP) Server for CData Python Connectors.

Quick Start (Experienced Users)

# Clone and setup
git clone https://github.com/CDataSoftware/cdata-mcp-python.git
cd cdata-mcp-python
uv venv && uv pip install "mcp[cli]"

# Install your connector (from the project directory!)
uv pip install ./your-cdata-connector.whl

# Verify installation
uv pip list | grep cdata

# Test connection
export CONNECTOR_MOD="cdata.{datasource}"
export CONNECTION_STRING="InitiateOAuth=GETANDREFRESH;"  # Or your auth method
uv run python -c "from utils.get_connection import get_connection; print('✅ Connected!' if get_connection() else '❌ Failed')"

# Configure Claude Desktop (add to claude_desktop_config.json)
# Then restart Claude completely

Purpose

We created this MCP Server to allow LLMs (like Claude) to query live data from any of over 250+ sources (listed below) supported by CData Python Connectors (free Community Licenses for personal use).

CData Python Connectors connect to SaaS apps, NoSQL stores, and APIs by exposing them as relational SQL models.

This server wraps those connectors and makes their data available through a simple MCP interface, so LLMs can retrieve live information by asking natural language questions — no SQL required.

Prerequisites

System Requirements

  • Python: 3.12 or higher
  • Operating System: Windows, macOS, or Linux
  • Package Manager: uv (for Python dependency management)

Required Components

  1. UV Package Manager

    Install with pip:

    pip install uv
    
  2. CData Python Connector

    You'll need a CData Python Connector for your specific data source. The connector name format is cdata.{datasource} (e.g., cdata.salesforce, cdata.jira, cdata.mongodb).

  3. Connection Configuration

    Prepare your connection string with authentication details for your data source. Each connector has different requirements.

    <details> <summary><strong>Common Connection String Examples</strong></summary>

    • Salesforce:

      # Full OAuth with domain
      InitiateOAuth=GETANDREFRESH;LoginURL=domain.my.salesforce.com;
      
      # Simplified OAuth (often works without LoginURL)
      InitiateOAuth=GETANDREFRESH;
      
      # Username/Password
      User=email@company.com;Password=yourpass;SecurityToken=token;LoginURL=domain.my.salesforce.com;
      
    • MongoDB:

      Server=localhost;Port=27017;Database=mydb;User=myuser;Password=mypass;
      
    • MySQL:

      Server=myserver.com;Port=3306;Database=mydb;UID=myuser;PWD=mypass;
      
    • REST API:

      Format=JSON;URI=https://api.example.com/data;AuthScheme=OAuth;
      

    Find your connector's specific requirements at: https://cdn.cdata.com/help/{datasource}/pg_connectionprops.htm </details>

Setup Guide

Step 1: Clone the Repository

git clone https://github.com/CDataSoftware/cdata-mcp-python.git
cd cdata-mcp-python

Step 2: Set Up Python Environment

  1. Create the virtual environment:

    uv venv
    

    Note: With uv, you typically don't need to manually activate the virtual environment. The uv pip and uv run commands automatically use the .venv in the current directory.

  2. Install MCP dependencies:

    uv pip install "mcp[cli]"
    
  3. Verify the virtual environment is being used:

    uv pip list  # Should show it's using .venv in the current directory
    

Step 3: Install Your CData Connector

Install the CData Python Connector you downloaded earlier:

Windows:

uv pip install "C:\path\to\cdata_{datasource}_connector-23.0.xxxx-cp312-cp312-win_amd64.whl"

macOS/Linux:

uv pip install /path/to/cdata-{datasource}-connector-23.0.xxxx-py3-none-any.whl

Example for Salesforce:

uv pip install ./cdata_salesforce_connector-23.0.8691-py3-none-any.whl

Important: Always run uv pip commands from the project directory to ensure packages are installed in the correct virtual environment. You can verify the installation with:

uv pip list | grep cdata

Step 4: Activate Your Connector License

Note: Some connectors may work without explicit license activation during initial testing. If you encounter license errors, follow the activation steps below.

<details> <summary><strong>License Activation Instructions</strong></summary>

Locate and run the license installer for your connector:

  1. Find the installer location using this Python script:

    import os
    import cdata.{datasource}  # Replace {datasource} with your connector name
    path = os.path.dirname(os.path.abspath(cdata.{datasource}.__file__))
    print(f"License installer location: {path}/installlic_{datasource}/")
    
  2. Navigate to the installer directory and activate:

    Windows:

    cd .venv\Lib\site-packages\cdata\installlic_{datasource}
    .\install-license.exe  # For trial license
    # OR
    .\install-license.exe YOUR-LICENSE-KEY  # For paid license
    

    macOS/Linux:

    cd .venv/lib/python3.12/site-packages/cdata/installlic_{datasource}
    ./install-license.sh  # For trial license
    # OR
    ./install-license.sh YOUR-LICENSE-KEY  # For paid license
    

</details>

Testing Your Setup

<details> <summary><strong>Testing Instructions</strong></summary>

Step 1: Test Your Connector Installation

Before configuring Claude Desktop, verify your connector works correctly:

# test_connector.py
import os
os.environ['CONNECTOR_MOD'] = 'cdata.{datasource}'  # Replace with your connector
os.environ['CONNECTION_STRING'] = 'Your=Connection;String=Here;'

try:
    from utils.get_connection import get_connection
    conn = get_connection()
    cursor = conn.cursor()
    cursor.execute("SELECT * FROM sys_tables")
    tables = cursor.fetchall()
    print(f"Successfully connected! Found {len(tables)} tables.")
    for table in tables[:5]:  # Show first 5 tables
        print(f"  - {table[0]}")
    cursor.close()
    conn.close()
except Exception as e:
    print(f"Connection failed: {e}")

Run the test:

python test_connector.py

Step 2: Test the MCP Server

Run the server directly to ensure it starts without errors:

export CONNECTOR_MOD="cdata.{datasource}"  # Windows: set CONNECTOR_MOD=cdata.{datasource}
export CONNECTION_STRING="Your=Connection;String=Here;"  # Windows: set CONNECTION_STRING=...
uv run --active main.py

You should see:

Starting server

Press Ctrl+C to stop the server. </details>

Using the Server with Claude Desktop

Step 1: Configure Claude Desktop

Create or edit the Claude Desktop configuration file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Add your MCP server configuration:

{
    "mcpServers": {
        "salesforce_server": {
            "command": "uv",
            "args": [
                "--directory",
                "/absolute/path/to/cdata-mcp-python",
                "run",
                "--active",
                "main.py"
            ],
            "env": {
                "CONNECTOR_MOD": "cdata.salesforce",
                "CONNECTION_STRING": "InitiateOAuth=GETANDREFRESH;LoginURL=mycompany.my.salesforce.com;"
            }
        }
    }
}

Important Notes:

  • Replace salesforce_server with a descriptive name for your data source
  • Use the absolute path to your cloned repository directory
  • Replace cdata.salesforce with your actual connector module name
  • Use your actual connection string (keep it secure!)

Step 2: Restart Claude Desktop

  1. Fully quit Claude Desktop (not just close the window):

    • Windows: Right-click system tray icon → Quit
    • macOS: Claude → Quit Claude (Cmd+Q)
    • Linux: Close and ensure process is terminated
  2. Reopen Claude Desktop

  3. Verify the server appears in the MCP servers list (look for the server icon)

Step 3: Test with Claude

Ask Claude questions about your data:

  • "What tables are available in my Salesforce instance?"
  • "Show me the first 5 records from the Account table"
  • "What fields are in the Contact table?"

Usage Details

Once the MCP Server is configured, the AI client will be able to use the built-in tools to read, write, update, and delete the underlying data. In general, you do not need to call the tools explicitly. Simply ask the client to answer questions about the underlying data system. For example:

  • "What is the correlation between my closed won opportunities and the account industry?"
  • "How many open tickets do I have in the SUPPORT project?"
  • "Can you tell me what calendar events I have today?"

The list of tools available and their descriptions follow:

Available Tools

The MCP server provides these tools to Claude for interacting with your data:

Tool Description Example Use
get_tables Lists all available tables/views "What tables are available?"
get_columns Shows fields for a specific table "What fields are in the Account table?"
get_procedures Lists available stored procedures "What actions can I perform?"
get_procedure_params Shows parameters for a procedure "What parameters does CreateInvoice need?"
run_query Executes SELECT queries "Show me all contacts from California"
run_nonquery Executes INSERT/UPDATE/DELETE "Update the phone number for contact ID 123"
call_procedure Calls stored procedures "Execute the RefreshToken procedure"

Troubleshooting

<details> <summary><strong>Common Issues and Solutions</strong></summary>

MCP Server Not Appearing in Claude Desktop

Problem: The server doesn't show up in Claude's MCP servers list.

Solutions:

  1. Fully quit Claude Desktop (not just minimize):

    • Windows: Check Task Manager and end all Claude processes
    • macOS: Use Activity Monitor to ensure Claude is not running
    • Linux: Use ps aux | grep -i claude to check for running processes
  2. Verify configuration file:

    # Check if config file exists and is valid JSON
    cat ~/Library/Application\ Support/Claude/claude_desktop_config.json | python -m json.tool
    
  3. Check for syntax errors in your configuration (missing commas, quotes, etc.)

Connection Errors

Problem: "Connection failed" or authentication errors.

Solutions:

  1. Test connection string using the test script provided in the Testing section
  2. Verify credentials and authentication method for your data source
  3. Check network access to your data source (VPN, firewall, etc.)
  4. OAuth connections: Ensure redirect URLs are properly configured

License Activation Issues

Problem: "License not found" or "Invalid license" errors.

Solutions:

  1. Verify license installation:

    import cdata.{datasource}
    print(cdata.{datasource}.__version__)  # Should show version if properly licensed
    
  2. Re-run license installer with correct permissions (may need sudo on Linux/Mac)

  3. Check license expiration for trial licenses (30 days)

Module Import Errors

Problem: "ModuleNotFoundError: No module named 'cdata.{datasource}'"

Solutions:

  1. Ensure virtual environment is activated:

    which python  # Should show .venv/bin/python path
    
  2. Reinstall connector in the virtual environment:

    uv pip install --force-reinstall /path/to/connector.whl
    
  3. Verify CONNECTOR_MOD environment variable matches installed module name

Performance Issues

Problem: Queries are slow or timing out.

Solutions:

  1. Limit query results:

    SELECT TOP 100 * FROM TableName  -- SQL Server syntax
    SELECT * FROM TableName LIMIT 100  -- MySQL/PostgreSQL syntax
    
  2. Add query filters to reduce data transfer

  3. Check data source performance directly

  4. Increase timeout values in connection string if supported </details>

<details> <summary><strong>Debug Mode</strong></summary>

Enable verbose logging to diagnose issues:

  1. Create a debug wrapper script:

    # debug_server.py
    import os
    import sys
    import logging
    
    logging.basicConfig(level=logging.DEBUG, 
                       format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    
    # Import and run your main server
    from main import *
    
  2. Run with debug output:

    uv run --active debug_server.py
    

</details>

<details> <summary><strong>Success Indicators</strong></summary>

Know when each step is working correctly:

After Connector Installation

uv pip list | grep cdata
# ✅ Should show: cdata-{datasource}-connector

After Connection Test

# ✅ Successful connection shows:
Successfully connected! Found X tables.
  - TableName1
  - TableName2
  ...

After Server Test

uv run --active main.py
# ✅ Should show: Starting server
# (Server will wait for connections - this is normal)

In Claude Desktop

  • ✅ Small plug icon appears next to your server name
  • ✅ First query returns data without errors
  • ✅ Example: "What tables are available?" returns a list </details>

Getting Help

If you're still having issues:

  1. Check connector documentation: https://cdn.cdata.com/help/{datasource}/
  2. Join CData Community: https://community.cdata.com
  3. Report MCP server issues: Create an issue in this repository
  4. Contact CData support: For connector-specific problems

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

Supported Sources

<details> <summary><strong>250+ Supported Data Sources</strong></summary>

<table> <tr><td>Access</td><td>Act CRM</td><td>Act-On</td><td>Active Directory</td></tr> <tr><td>ActiveCampaign</td><td>Acumatica</td><td>Adobe Analytics</td><td>Adobe Commerce</td></tr> <tr><td>ADP</td><td>Airtable</td><td>AlloyDB</td><td>Amazon Athena</td></tr> <tr><td>Amazon DynamoDB</td><td>Amazon Marketplace</td><td>Amazon S3</td><td>Asana</td></tr> <tr><td>Authorize.Net</td><td>Avalara AvaTax</td><td>Avro</td><td>Azure Active Directory</td></tr> <tr><td>Azure Analysis Services</td><td>Azure Data Catalog</td><td>Azure Data Lake Storage</td><td>Azure DevOps</td></tr> <tr><td>Azure Synapse</td><td>Azure Table</td><td>Basecamp</td><td>BigCommerce</td></tr> <tr><td>BigQuery</td><td>Bing Ads</td><td>Bing Search</td><td>Bitbucket</td></tr> <tr><td>Blackbaud FE NXT</td><td>Box</td><td>Bullhorn CRM</td><td>Cassandra</td></tr> <tr><td>Certinia</td><td>Cloudant</td><td>CockroachDB</td><td>Confluence</td></tr> <tr><td>Cosmos DB</td><td>Couchbase</td><td>CouchDB</td><td>CSV</td></tr> <tr><td>Cvent</td><td>Databricks</td><td>DB2</td><td>DocuSign</td></tr> <tr><td>Dropbox</td><td>Dynamics 365</td><td>Dynamics 365 Business Central</td><td>Dynamics CRM</td></tr> <tr><td>Dynamics GP</td><td>Dynamics NAV</td><td>eBay</td><td>eBay Analytics</td></tr> <tr><td>Elasticsearch</td><td>Email</td><td>EnterpriseDB</td><td>Epicor Kinetic</td></tr> <tr><td>Exact Online</td><td>Excel</td><td>Excel Online</td><td>Facebook</td></tr> <tr><td>Facebook Ads</td><td>FHIR</td><td>Freshdesk</td><td>FTP</td></tr> <tr><td>GitHub</td><td>Gmail</td><td>Google Ad Manager</td><td>Google Ads</td></tr> <tr><td>Google Analytics</td><td>Google Calendar</td><td>Google Campaign Manager 360</td><td>Google Cloud Storage</td></tr> <tr><td>Google Contacts</td><td>Google Data Catalog</td><td>Google Directory</td><td>Google Drive</td></tr> <tr><td>Google Search</td><td>Google Sheets</td><td>Google Spanner</td><td>GraphQL</td></tr> <tr><td>Greenhouse</td><td>Greenplum</td><td>HarperDB</td><td>HBase</td></tr> <tr><td>HCL Domino</td><td>HDFS</td><td>Highrise</td><td>Hive</td></tr> <tr><td>HubDB</td><td>HubSpot</td><td>IBM Cloud Data Engine</td><td>IBM Cloud Object Storage</td></tr> <tr><td>IBM Informix</td><td>Impala</td><td>Instagram</td><td>JDBC-ODBC Bridge</td></tr> <tr><td>Jira</td><td>Jira Assets</td><td>Jira Service Management</td><td>JSON</td></tr> <tr><td>Kafka</td><td>Kintone</td><td>LDAP</td><td>LinkedIn</td></tr> <tr><td>LinkedIn Ads</td><td>MailChimp</td><td>MariaDB</td><td>Marketo</td></tr> <tr><td>MarkLogic</td><td>Microsoft Dataverse</td><td>Microsoft Entra ID</td><td>Microsoft Exchange</td></tr> <tr><td>Microsoft OneDrive</td><td>Microsoft Planner</td><td>Microsoft Project</td><td>Microsoft Teams</td></tr> <tr><td>Monday.com</td><td>MongoDB</td><td>MYOB AccountRight</td><td>MySQL</td></tr> <tr><td>nCino</td><td>Neo4J</td><td>NetSuite</td><td>OData</td></tr> <tr><td>Odoo</td><td>Office 365</td><td>Okta</td><td>OneNote</td></tr> <tr><td>Oracle</td><td>Oracle Eloqua</td><td>Oracle Financials Cloud</td><td>Oracle HCM Cloud</td></tr> <tr><td>Oracle Sales</td><td>Oracle SCM</td><td>Oracle Service Cloud</td><td>Outreach.io</td></tr> <tr><td>Parquet</td><td>Paylocity</td><td>PayPal</td><td>Phoenix</td></tr> <tr><td>PingOne</td><td>Pinterest</td><td>Pipedrive</td><td>PostgreSQL</td></tr> <tr><td>Power BI XMLA</td><td>Presto</td><td>Quickbase</td><td>QuickBooks</td></tr> <tr><td>QuickBooks Online</td><td>QuickBooks Time</td><td>Raisers Edge NXT</td><td>Reckon</td></tr> <tr><td>Reckon Accounts Hosted</td><td>Redis</td><td>Redshift</td><td>REST</td></tr> <tr><td>RSS</td><td>Sage 200</td><td>Sage 300</td><td>Sage 50 UK</td></tr> <tr><td>Sage Cloud Accounting</td><td>Sage Intacct</td><td>Salesforce</td><td>Salesforce Data Cloud</td></tr> <tr><td>Salesforce Financial Service Cloud</td><td>Salesforce Marketing</td><td>Salesforce Marketing Cloud Account Engagement</td><td>Salesforce Pardot</td></tr> <tr><td>Salesloft</td><td>SAP</td><td>SAP Ariba Procurement</td><td>SAP Ariba Source</td></tr> <tr><td>SAP Business One</td><td>SAP BusinessObjects BI</td><td>SAP ByDesign</td><td>SAP Concur</td></tr> <tr><td>SAP Fieldglass</td><td>SAP HANA</td><td>SAP HANA XS Advanced</td><td>SAP Hybris C4C</td></tr> <tr><td>SAP Netweaver Gateway</td><td>SAP SuccessFactors</td><td>SAS Data Sets</td><td>SAS xpt</td></tr> <tr><td>SendGrid</td><td>ServiceNow</td><td>SFTP</td><td>SharePoint</td></tr> <tr><td>SharePoint Excel Services</td><td>ShipStation</td><td>Shopify</td><td>SingleStore</td></tr> <tr><td>Slack</td><td>Smartsheet</td><td>Snapchat Ads</td><td>Snowflake</td></tr> <tr><td>Spark</td><td>Splunk</td><td>SQL Analysis Services</td><td>SQL Server</td></tr> <tr><td>Square</td><td>Stripe</td><td>Sugar CRM</td><td>SuiteCRM</td></tr> <tr><td>SurveyMonkey</td><td>Sybase</td><td>Sybase IQ</td><td>Tableau CRM Analytics</td></tr> <tr><td>Tally</td><td>TaxJar</td><td>Teradata</td><td>Tier1</td></tr> <tr><td>TigerGraph</td><td>Trello</td><td>Trino</td><td>Twilio</td></tr> <tr><td>Twitter</td><td>Twitter Ads</td><td>Veeva CRM</td><td>Veeva Vault</td></tr> <tr><td>Wave Financial</td><td>WooCommerce</td><td>WordPress</td><td>Workday</td></tr> <tr><td>xBase</td><td>Xero</td><td>XML</td><td>YouTube Analytics</td></tr> <tr><td>Zendesk</td><td>Zoho Books</td><td>Zoho Creator</td><td>Zoho CRM</td></tr> <tr><td>Zoho Inventory</td><td>Zoho Projects</td><td>Zuora</td><td>... Dozens More</td></tr> </table> </details>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选