google-analytics -by-cdata
This read-only MCP Server allows you to connect to Google Analytics data from Claude Desktop through CData JDBC Drivers. For full CRUD support, check out the first managed MCP platform: CData Connect AI (https://www.cdata.com/ai/).
claude mcp add --transport stdio cdatasoftware-google-analytics-mcp-server-by-cdata java -jar /PATH/TO/CDataMCP-jar-with-dependencies.jar /PATH/TO/google-analytics.prp
How to use
This MCP server exposes Google Analytics data through a read-only MCP interface by wrapping the CData JDBC Driver for Google Analytics. It enables large language models and clients to query live analytics data using natural language questions without writing SQL. Tools are exposed to discover available tables and columns, and to run SELECT queries against the underlying data source. The server runs locally (stdio-based), so it is intended for on‑box use with clients running on the same machine.
To use it, configure Claude Desktop (or your MCP client) to load the server by providing a config entry that points to the Java runtime, the MCP server JAR, and the PRP file that defines the JDBC connection. Once configured, you can ask questions like “What is the trend of sessions by day?” or “How many active users do we have this week?” The built-in tools include get_tables, get_columns, and run_query, which map to the underlying data source via the MCP interface.
How to install
Prerequisites:
- Java (JDK) installed on the host machine
- Access to the Google Analytics CData JDBC Driver and a valid license (as described in the README)
- Maven for building the MCP server JAR (optional if you already have the jar)
Steps:
-
Clone the repository and navigate into it: git clone https://github.com/cdatasoftware/google-analytics-mcp-server-by-cdata.git cd google-analytics-mcp-server-by-cdata
-
Build the MCP server jar (if you don’t already have the prebuilt jar): mvn clean install
This should produce CDataMCP-jar-with-dependencies.jar
-
Download and install the CData JDBC Driver for Google Analytics from: https://www.cdata.com/drivers/ganalytics/download/jdbc
-
License the driver as described in the README (run the license command in the appropriate lib folder).
-
Create the google-analytics.prp file with your JDBC connection details, including Prefix, ServerName, ServerVersion, DriverPath, DriverClass, JdbcUrl, and Tables as shown in the README.
-
Run the MCP server: java -jar /PATH/TO/CDataMCP-jar-with-dependencies.jar /PATH/TO/google-analytics.prp
Notes:
- The server uses stdio, so it is intended to be used with clients running on the same machine.
- Ensure your claude_desktop_config.json (or equivalent MCP config) points to the correct jar and prp path.
- If you modify the prp or JDBC settings, restart the MCP server for changes to take effect.
Additional notes
Tips and common issues:
- Ensure the CData JDBC Driver is licensed and accessible in the same environment as the MCP server.
- The MCP server runs in read-only mode by design for this Google Analytics variant; attempts to write or modify data will be blocked by the driver.
- Since the server uses stdio, only clients on the same host can communicate; for remote access, consider using the cloud-based MCP platform if applicable.
- When configuring Claude Desktop, you will typically add an entry under mcpServers with the appropriate paths to the Java executable, the MCP JAR, and the google-analytics.prp file.
- If the MCP server does not appear in Claude Desktop, fully quit and restart the client to refresh the server list.