Developer Guide: Code Assist MCP with ADO.NET
Build .NET applications faster with AI-assisted development. This guide walks you through using CData Code Assist MCP with an AI coding tool like Cursor to generate production-ready C# code that connects to live data using CData ADO.NET Providers.
Code Assist MCP provides schema-aware context to your AI coding assistant, enabling it to discover tables, columns, and data types from your actual data source. The AI generates accurate ADO.NET code that you can run in production using CData ADO.NET Providers - no guessing, no hallucinated field names.
By the end of this guide, you'll have a working C# console application that:
- Connects to Google Sheets using the CData ADO.NET Provider
- Queries customer data using standard ADO.NET patterns
- Displays results in a formatted table
Architecture Overview
Code Assist MCP bridges AI-assisted development with production-ready data access:
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ │ │ │ │ │
│ Cursor IDE │────>│ Code Assist MCP │────>│ Google Sheets │
│ (Development) │ │ (Schema) │ │ (Live Data) │
│ │<────│ │<────│ │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
│ Generated C# Code
v
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ │ │ │ │ │
│ Your .NET App │────>│ CData ADO.NET │────>│ Google Sheets │
│ (Production) │ │ Provider │ │ (Live Data) │
│ │<────│ │<────│ │
└─────────────────┘ └──────────────────┘ └─────────────────┘
How it works:
- Code Assist MCP connects to your data source and exposes schema information to Cursor
- Cursor's AI uses this context to generate accurate ADO.NET code with correct table and column names
- Your production application uses the CData ADO.NET Provider - same schema, same SQL syntax
Prerequisites
Before you begin, ensure the following are installed:
- .NET 6.0 SDK or later - Download from Microsoft
- Cursor IDE - Download Cursor (or another AI coding tool with MCP support)
- CData Code Assist MCP for Google Sheets - Download
- CData ADO.NET Provider for Google Sheets - Download
- A Google account for accessing Google Sheets
Step 1: Set Up Sample Data in Google Sheets
We'll use a sample Google Sheet containing sample CRM data to demonstrate the workflow.
- Navigate to the sample CRM spreadsheet
- Click File > Make a copy to save it to your Google Drive
- Give it a memorable name (e.g., "demo_organization") - you'll need this later
The spreadsheet contains four sheets:
- account - Company information (Name, Industry, AnnualRevenue, NumberOfEmployees)
- opportunity - Sales pipeline data (StageName, Amount, Probability, CloseDate)
- tickets - Support cases (Subject, Priority, Status, CreatedAt)
- usage - Product usage statistics (PRODUCT_GROUP, S_STANDARDJOBRUNS, S_RECORDSAFFECTED)
Step 2: Install and Configure Code Assist MCP
- Download and install the CData Code Assist MCP for Google Sheets
- Launch the Code Assist MCP configuration wizard after installation
- Create a new configuration and name it (e.g., "cdata-googlesheets")
- Configure your Google Sheets connection:
- Click Connect to authenticate with Google via OAuth
- After authentication, enter your spreadsheet name in the Spreadsheet field (e.g., "demo_organization")
- Click Save & Test to validate the connection
Step 3: Configure Cursor to Use Code Assist MCP
- After saving your connection, click Next in the configuration wizard
- Select Cursor from the AI MCP Tool dropdown
- Follow the instructions to create the MCP configuration:
- Create a .cursor folder in your project directory
- Create a file named mcp.json inside the .cursor folder
- Click Copy JSON and paste the configuration into your mcp.json file
- Restart Cursor to load the new MCP configuration
Verify the MCP Connection
- In Cursor, press Ctrl+Shift+P (or Cmd+Shift+P on macOS) to open the Command Palette
- Type View: Open MCP Settings and select it
- Navigate to Tools & MCP in the settings
- Confirm your Code Assist MCP connection (e.g., "cdata-googlesheets") appears as Running under Installed MCP Servers
Step 4: Install the CData ADO.NET Provider
The ADO.NET Provider will be used at runtime by your generated application.
- Download and install the CData ADO.NET Provider for Google Sheets
- During installation, enter your license key (or use TRIAL for a 30-day evaluation)
- Note the installation path - you'll need to reference the DLL in your project
Step 5: Build the Application with Cursor
- Create a new folder for your project and open it in Cursor
- Open Cursor's AI chat pane (click the chat icon or use the Toggle AI Pane command)
- First, ask Cursor to review the MCP connection instructions:
Review the instructions for my cdata-googlesheets connection
- Once Cursor confirms it has the context, prompt it to build the application:
Build a C# console application that connects to Google Sheets using the CData ADO.NET Provider. Query the "account" sheet and display all accounts with their Name, Industry, and AnnualRevenue in a formatted table. Use the schema from my cdata-googlesheets MCP connection. Store the connection string in an environment variable for security.
- Cursor will generate:
- A .NET project file with the CData ADO.NET Provider reference
- C# code using proper ADO.NET patterns (Connection, Command, DataReader)
- Correct table and column names based on the actual Google Sheets schema
Step 6: Configure and Run the Application
- Set your connection string as an environment variable:
set GOOGLESHEETS_CONN="Spreadsheet=demo_organization;InitiateOAuth=GETANDREFRESH;"On macOS/Linux, use export instead of set
- Copy the CData license file to your project's output directory:
copy "C:\Program Files\CData\CData ADO.NET Provider for Google Sheets\lib\System.Data.CData.GoogleSheets.lic" .\bin\Debug et6.0\Adjust the paths based on your .NET version and installation location. On macOS/Linux, the license file is typically in /Applications/CData/ or /opt/cdata/.
- Build and run the application:
dotnet build dotnet run - The application will authenticate with Google (if needed) and display your account data
Example Output
Name Industry AnnualRevenue ------------------------------------------------------------ Acme Corporation Technology 2500000 Global Industries Manufacturing 15000000 StartupCo Software 500000 Enterprise Inc Finance 50000000
What's Next?
You've built a working .NET application using AI-assisted development. The same pattern works for any of the hundreds of data sources supported by CData ADO.NET Providers.
Try these next steps:
- Add CRUD operations (Create, Update, Delete) to your application
- Query multiple sheets and join data
- Build a web dashboard using ASP.NET with live data
- Connect to a different data source like Salesforce or Jira
Troubleshooting
If you encounter issues, try these common solutions:
- MCP not showing as "Running" in Cursor - Verify the mcp.json file is in the correct location (.cursor folder in your project root). Restart Cursor after adding or modifying the configuration.
- OAuth authentication fails - Ensure pop-ups are enabled in your browser. Try clearing your browser cache or using a private/incognito window for the OAuth flow.
- License file not found error - Confirm the .lic file is copied to your application's output directory (e.g., bin/Debug/net6.0/). The file must be in the same directory as the running executable.
- Connection string errors - Verify the spreadsheet name in your connection string matches exactly (case-sensitive) and that you have access to the spreadsheet in Google Drive.
- AI generates incorrect column names - Ask Cursor to review the MCP connection instructions again before generating code. This refreshes the schema context.
ADO.NET Development with CData
CData Code Assist MCP and CData ADO.NET Providers share the same data model, so the SQL you validate during development works identically in production. This eliminates the disconnect between AI-generated code and real-world data access.
Code Assist MCP works with any AI model supported by your coding tool - it's model agnostic. Whether you're using GPT-4, Claude, or another model in Cursor, the MCP provides the same accurate schema context.
Ready to accelerate your .NET development? Download Code Assist MCP for Google Sheets for free and get a free trial of the CData ADO.NET Provider for Google Sheets to get started.