logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

cdata-analytics-mcp-adapter-for-google

Facilitates querying live Google Analytics metrics via a read-only Model Context Protocol (MCP) server, leveraging the CData JDBC Driver to map analytics data into a structured, relational format accessible to LLMs through natural language commands.

Author

cdata-analytics-mcp-adapter-for-google logo

CDataSoftware

MIT License

Quick Info

GitHub GitHub Stars 0
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

cdatasoftwarejdbcanalyticscdata jdbctools cdatasoftwarecdatasoftware google

CData Google Analytics Bridge for Model Context Protocol (MCP)

This repository details the construction of a dedicated, strictly read-only MCP server endpoint designed to interface with Google Analytics data streams. This capability is powered entirely by the CData JDBC Driver for Google Analytics.

:warning: Important Note on Functionality: This specific implementation is restricted to read-only operations. For comprehensive data manipulation (Create, Read, Update, Delete, and Actions), users are strongly encouraged to explore the full-featured, simplified CData MCP Server for Google Analytics (currently in beta): CData Google Analytics MCP Server (Beta Link).

Core Objective

The primary goal is to enable Large Language Models (LLMs), such as those found in Claude Desktop environments, to interrogate live datasets residing within Google Analytics. The foundation relies on the CData JDBC Driver for Google Analytics, which translates proprietary Google Analytics structures into standard, queryable SQL-like relational schemas.

This server acts as a wrapper, exposing these relational views via the MCP specification, thereby allowing AI agents to retrieve current insights using conversational queries instead of requiring explicit SQL programming.

Deployment Procedure

Follow these steps to compile and configure the server component:

  1. Source Retrieval: bash git clone https://github.com/cdatasoftware/google-analytics-mcp-server-by-cdata.git cd google-analytics-mcp-server-by-cdata

  2. Compilation: Execute the Maven build process to generate the necessary runtime artifact. bash mvn clean install

    The resulting runnable file will be named: CDataMCP-jar-with-dependencies.jar 3. Driver Acquisition: Obtain and install the dedicated CData JDBC Driver for Google Analytics from: Download JDBC Driver 4. Driver Licensing: Activate the installed driver component. * Locate the driver's installation directory (e.g., Windows: C:\Program Files\CData\CData JDBC Driver for Google Analytics\ or Mac/Linux: /Applications/CData JDBC Driver for Google Analytics/). * Execute the licensing utility: bash java -jar cdata.jdbc.googleanalytics.jar --license

    • Provide the required identification details and use "TRIAL" or your valid license key when prompted.
    • Data Source Configuration (Connection String Definition):
    • Invoke the connection utility via the command line: bash java -jar cdata.jdbc.googleanalytics.jar

    • Within the utility window, define the necessary parameters for your Google Analytics account (including OAuth initiation if required) and perform a connection validation test.

    • Once connectivity is verified, meticulously copy the generated JDBC connection string.
    • Parameter File Creation: Generate a configuration file (e.g., google-analytics.prp) utilizing the following structure and inputting the values obtained above:
    • Prefix: Identifier used for tool naming.
    • ServerName: Friendly name for the service endpoint.
    • ServerVersion: Version string for the adapter.
    • DriverPath: Absolute path to the downloaded CData JDBC JAR file.
    • DriverClass: Fully qualified class name of the JDBC driver.
    • JdbcUrl: The verified connection string captured in Step 5.
    • Tables: Specify table names for restricted access, or leave empty () to expose all available entities. env Prefix=ga_access ServerName=GA_Live_Adapter ServerVersion=2.1 DriverPath=ABSOLUTE/PATH/TO/cdata.jdbc.googleanalytics.jar DriverClass=cdata.jdbc.googleanalytics.GoogleAnalyticsDriver JdbcUrl=jdbc:googleanalytics:ServiceAccount=...; Tables=

Integrating with AI Clients (e.g., Claude Desktop)

To make this data source available to the conversational client, modify its configuration file (claude_desktop_config.json).

  1. Configuration Addition: Append the following block to the mcpServers section of your client configuration file. Adjust PATH\TO placeholders based on your operating system:

    Windows Deployment Structure:

    { "mcpServers": { "ga_adapter_instance": { "command": "PATH\TO\java.exe", "args": [ "-jar", "PATH\TO\CDataMCP-jar-with-dependencies.jar", "PATH\TO\google-analytics.prp" ] }, ... } }

    Linux/Mac Deployment Structure:

    { "mcpServers": { "ga_adapter_instance": { "command": "/PATH/TO/java", "args": [ "-jar", "/PATH/TO/CDataMCP-jar-with-dependencies.jar", "/PATH/TO/google-analytics.prp" ] }, ... } }

  2. Configuration File Relocation (if necessary): Ensure the modified configuration file resides in the client's expected directory (e.g., for Windows: %APPDATA%\Claude\claude_desktop_config.json).

  3. Client Refresh: Restart or reload the AI client application to initialize the newly defined MCP data provider.

Executing the Server Standalone

This server can be launched independently for direct testing over standard input/output pipes:

  bash
  java -jar /ABSOLUTE/PATH/TO/CDataMCP-jar-with-dependencies.jar /ABSOLUTE/PATH/TO/google-analytics.prp

Limitation: Due to the stdio communication protocol utilized, the standalone server must execute on the same host where the client is actively running.

Operational Guidance

Once successfully integrated, the AI client gains access to the underlying data structures. Users interact by posing questions related to their Google Analytics statistics, rather than writing database queries. Examples of expected interaction:

  • "What was the session duration trend across the last quarter in the EMEA region?"
  • "Compare the bounce rate for mobile versus desktop users this month."
  • "Display the top 10 landing pages by conversion rate."

Available Methods & Descriptions

Tools are dynamically named using the prefix defined in the .prp file (e.g., ga_access from the example above).

  • {prefix}_get_tables: Fetches the metadata listing all accessible tables/entities within the Google Analytics schema. Use {prefix}_get_columns next to inspect entity structure.
  • {prefix}_get_columns: Retrieves the schema definition (field names, types) for a specified table. Requires a table argument.
  • {prefix}_run_query: Executes a raw SQL SELECT statement against the data source. Requires a sql argument containing the query text.

Communication Protocol Examples (JSON-RPC 2.0)

For direct scripting or deep inspection, here are example payloads conforming to JSON-RPC 2.0 standards for invoking the methods:

Retrieving Schema Entities (ga_access_get_tables)

{ "jsonrpc": "2.0", "id": 101, "method": "tools/call", "params": { "name": "ga_access_get_tables", "arguments": {} } }

Querying Column Details (ga_access_get_columns)

{ "jsonrpc": "2.0", "id": 102, "method": "tools/call", "params": { "name": "ga_access_get_columns", "arguments": { "table": "WebPageViews" } } }

Executing a Custom Selection (ga_access_run_query)

{ "jsonrpc": "2.0", "id": 103, "method": "tools/call", "params": { "name": "ga_access_run_query", "arguments": { "sql": "SELECT Sessions, BounceRate FROM [WebPageViews] WHERE Date = '2024-01-01'" } } }

Support and Licensing

This adapter software is distributed under the permissive MIT License. Full details are available in the accompanying LICENSE file.

For technical assistance with connection issues, consult CData Support. For community feedback on the MCP server functionality, engage with the CData Developer Community.

Supported Data Ecosystems

(A comprehensive list of all data sources supported by the underlying CData JDBC technology, illustrating its broad integration capabilities, is omitted here for brevity, but the primary source supported by this specific build is Google Analytics.)


WIKIPEDIA CONTEXT: Business Management Tools

Business management tools encompass the methodologies, applications, and control mechanisms employed by enterprises to maintain market relevance, optimize operations, and enhance overall organizational output against dynamic commercial environments. These solutions are traditionally segmented by functional area, addressing aspects like operational process governance, record-keeping, personnel management, and strategic forecasting.

The evolution of these tools has been profoundly shaped by technological advancements, shifting from initial Management Information Systems (MIS) through complex Enterprise Resource Planning (ERP) suites, and now residing heavily within cloud-based platforms. Success hinges not just on adopting modern software, but critically on the efficacy of its implementation and its tailored fit to specific corporate requirements. Key strategic priorities often reflected in tool selection include optimizing customer interaction cycles and ensuring product delivery aligns precisely with customer expectations.

See Also

`