Google Analytics MCP Server by CData
Um servidor MCP somente leitura para consultar dados ao vivo do Google Analytics usando LLMs. Desenvolvido pela CData.
Documentação
google-analytics-mcp-server-by-cdata
CData's Model Context Protocol (MCP) Server for Google Analytics
:heavy_exclamation_mark: Este projeto cria um servidor MCP local e somente leitura. Para acesso MCP totalmente remoto, conheça a primeira plataforma MCP gerenciada: CData Connect AI. Para recursos completos de leitura, gravação, atualização, exclusão e ações hospedados localmente, além de uma configuração simplificada, consulte nosso CData MCP Server for Google Analytics.
Propósito
Criamos este servidor MCP somente leitura para permitir que LLMs (como o Claude Desktop) consultem dados ao vivo do Google Analytics suportados pelo CData JDBC Driver for Google Analytics.
O CData JDBC Driver conecta-se ao Google Analytics expondo-os como modelos SQL relacionais.
Este servidor encapsula esse driver e disponibiliza os dados do Google Analytics por meio de uma interface MCP simples, para que LLMs possam recuperar informações ao vivo fazendo perguntas em linguagem natural — sem necessidade de SQL.
Guia de Configuração
- Clone o repositório:
git clone https://github.com/cdatasoftware/google-analytics-mcp-server-by-cdata.git cd google-analytics-mcp-server-by-cdata - Compile o servidor:
Isso cria o arquivo JAR: CDataMCP-jar-with-dependencies.jarmvn clean install - Baixe e instale o CData JDBC Driver for {source}: https://www.cdata.com/drivers/ganalytics/download/jdbc
- Licencie o CData JDBC Driver:
- Navegue até a pasta
libno diretório de instalação, normalmente:- (Windows)
C:\Program Files\CData\CData JDBC Driver for Google Analytics\ - (Mac/Linux)
/Applications/CData JDBC Driver for Google Analytics/
- (Windows)
- Execute o comando
java -jar cdata.jdbc.googleanalytics.jar --license - Digite seu nome, e-mail e "TRIAL" (ou sua chave de licença).
- Navegue até a pasta
- Configure sua conexão com a fonte de dados (Salesforce como exemplo):
-
Execute o comando
java -jar cdata.jdbc.googleanalytics.jarpara abrir o utilitário de Connection String. -
Configure a connection string e clique em "Test Connection"
Nota: Se a fonte de dados usa OAuth, você precisará autenticar no seu navegador.
-
Após o sucesso, copie a connection string para uso posterior.
-
- Crie um arquivo
.prppara sua conexão JDBC (ex.:google-analytics.prp) usando as seguintes propriedades e formato:- Prefix - um prefixo a ser usado para as ferramentas expostas
- ServerName - um nome para o seu servidor
- ServerVersion - uma versão para o seu servidor
- DriverPath - o caminho completo para o arquivo JAR do seu driver JDBC
- DriverClass - o nome da classe do JDBC Driver (ex.: cdata.jdbc.googleanalytics.GoogleAnalyticsDriver)
- JdbcUrl - a connection string JDBC a ser usada com o CData JDBC Driver para conectar-se aos seus dados (copiada acima)
- Tables - deixe em branco para acessar todos os dados; caso contrário, você pode declarar explicitamente as tabelas para as quais deseja criar acesso
Prefix=googleanalytics ServerName=CDataGoogleAnalytics ServerVersion=1.0 DriverPath=PATH\TO\cdata.jdbc.googleanalytics.jar DriverClass=cdata.jdbc.googleanalytics.GoogleAnalyticsDriver JdbcUrl=jdbc:googleanalytics:InitiateOAuth=GETANDREFRESH; Tables=
Usando o Servidor com o Claude Desktop
-
Crie o arquivo de configuração para o Claude Desktop (claude_desktop_config.json) para adicionar o novo servidor MCP, usando o formato abaixo. Se o arquivo já existir, adicione a entrada em
mcpServersno arquivo de configuração.Windows
{ "mcpServers": { "{classname_dash}": { "command": "PATH\\TO\\java.exe", "args": [ "-jar", "PATH\\TO\\CDataMCP-jar-with-dependencies.jar", "PATH\\TO\\google-analytics.prp" ] }, ... } }Linux/Mac
{ "mcpServers": { "{classname_dash}": { "command": "/PATH/TO/java", "args": [ "-jar", "/PATH/TO/CDataMCP-jar-with-dependencies.jar", "/PATH/TO/google-analytics.prp" ] }, ... } }Se necessário, copie o arquivo de configuração para o diretório apropriado (Claude Desktop como exemplo). Windows
cp C:\PATH\TO\claude_desktop_config.json %APPDATA%\Claude\claude_desktop_config.jsonLinux/Mac
cp /PATH/TO/claude_desktop_config.json /Users/{user}/Library/Application\ Support/Claude/claude_desktop_config.json' -
Execute ou atualize seu cliente (Claude Desktop).
Nota: Talvez seja necessário sair ou fechar completamente o cliente Claude Desktop e reabri-lo para que os Servidores MCP apareçam.
Executando o Servidor
- Execute o seguinte comando para rodar o MCP Server isoladamente
java -jar /PATH/TO/CDataMCP-jar-with-dependencies.jar /PATH/TO/Salesforce.prp
Note: The server uses
stdioso can only be used with clients that run on the same machine as the server.
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:
Tools & Descriptions
In the definitions below, {servername} refers to the name of the MCP Server in the config file (e.g. {classname_dash} above).
{servername}_get_tables- Retrieves a list of tables available in the data source. Use the{servername}_get_columnstool to list available columns on a table. The output of the tool will be returned in CSV format, with the first line containing column headers.{servername}_get_columns- Retrieves a list of columns for a table. Use the{servername}_get_tablestool to get a list of available tables. The output of the tool will be returned in CSV format, with the first line containing column headers.{servername}_run_query- Execute a SQL SELECT query
JSON-RPC Request Examples
If you are scripting out the requests sent to the MCP Server instead of using an AI Client (e.g. Claude), then you can refer to the JSON payload examples below – following the JSON-RPC 2.0 specification - when calling the available tools.
google_analytics_get_tables
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "google_analytics_get_tables",
"arguments": {}
}
}
google_analytics_get_columns
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "google_analytics_get_columns",
"arguments": {
"table": "Account"
}
}
}
google_analytics_run_query
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "google_analytics_run_query",
"arguments": {
"sql": "SELECT * FROM [Account] WHERE [IsDeleted] = true"
}
}
}
Solução de Problemas
- Se você não conseguir ver seu CData MCP Server no Claude Desktop, certifique-se de que fechou completamente o Claude Desktop (Windows: use o Gerenciador de Tarefas; Mac: use o Monitor de Atividades).
- Se o Claude Desktop não conseguir recuperar dados, certifique-se de que configurou sua conexão corretamente. Use o construtor de Connection String para criar a connection string (veja acima) e copie-a para o arquivo de propriedades (.prp).
- Se estiver tendo problemas para se conectar à sua fonte de dados, entre em contato com a Equipe de Suporte da CData.
- Se estiver tendo problemas ao usar o servidor MCP, ou tiver outros comentários, participe da Comunidade CData.
Licença
Este servidor MCP é licenciado sob a Licença MIT. Isso significa que você é livre para usar, modificar e distribuir o software, sujeito aos termos e condições da Licença MIT. Para mais detalhes, consulte o arquivo LICENSE no repositório do projeto.
Todas as fontes suportadas
| Access | Act CRM | Act-On | Active Directory |
| ActiveCampaign | Acumatica | Adobe Analytics | Adobe Commerce |
| ADP | Airtable | AlloyDB | Amazon Athena |
| Amazon DynamoDB | Amazon Marketplace | Amazon S3 | Asana |
| Authorize.Net | Avalara AvaTax | Avro | Azure Active Directory |
| Azure Analysis Services | Azure Data Catalog | Azure Data Lake Storage | Azure DevOps |
| Azure Synapse | Azure Table | Basecamp | BigCommerce |
| BigQuery | Bing Ads | Bing Search | Bitbucket |
| Blackbaud FE NXT | Box | Bullhorn CRM | Cassandra |
| Certinia | Cloudant | CockroachDB | Confluence |
| Cosmos DB | Couchbase | CouchDB | CSV |
| Cvent | Databricks | DB2 | DocuSign |
| Dropbox | Dynamics 365 | Dynamics 365 Business Central | Dynamics CRM |
| Dynamics GP | Dynamics NAV | eBay | eBay Analytics |
| Elasticsearch | EnterpriseDB | Epicor Kinetic | |
| Exact Online | Excel | Excel Online | |
| Facebook Ads | FHIR | Freshdesk | FTP |
| GitHub | Gmail | Google Ad Manager | Google Ads |
| Google Analytics | Google Calendar | Google Campaign Manager 360 | Google Cloud Storage |
| Google Contacts | Google Data Catalog | Google Directory | Google Drive |
| Google Search | Google Sheets | Google Spanner | GraphQL |
| Greenhouse | Greenplum | HarperDB | HBase |
| HCL Domino | HDFS | Highrise | Hive |
| HubDB | HubSpot | IBM Cloud Data Engine | IBM Cloud Object Storage |
| IBM Informix | Impala | JDBC-ODBC Bridge | |
| Jira | Jira Assets | Jira Service Management | JSON |
| Kafka | Kintone | LDAP | |
| LinkedIn Ads | MailChimp | MariaDB | Marketo |
| MarkLogic | Microsoft Dataverse | Microsoft Entra ID | Microsoft Exchange |
| Microsoft OneDrive | Microsoft Planner | Microsoft Project | Microsoft Teams |
| Monday.com | MongoDB | MYOB AccountRight | MySQL |
| nCino | Neo4J | NetSuite | OData |
| Odoo | Office 365 | Okta | OneNote |
| Oracle | Oracle Eloqua | Oracle Financials Cloud | Oracle HCM Cloud |
| Oracle Sales | Oracle SCM | Oracle Service Cloud | Outreach.io |
| Parquet | Paylocity | PayPal | Phoenix |
| PingOne | Pipedrive | PostgreSQL | |
| Power BI XMLA | Presto | Quickbase | QuickBooks |
| QuickBooks Online | QuickBooks Time | Raisers Edge NXT | Reckon |
| Reckon Accounts Hosted | Redis | Redshift | REST |
| RSS | Sage 200 | Sage 300 | Sage 50 UK |
| Sage Cloud Accounting | Sage Intacct | Salesforce | Salesforce Data Cloud |
| Salesforce Financial Service Cloud | Salesforce Marketing | Salesforce Marketing Cloud Account Engagement | Salesforce Pardot |
| Salesloft | SAP | SAP Ariba Procurement | SAP Ariba Source |
| SAP Business One | SAP BusinessObjects BI | SAP ByDesign | SAP Concur |
| SAP Fieldglass | SAP HANA | SAP HANA XS Advanced | SAP Hybris C4C |
| SAP Netweaver Gateway | SAP SuccessFactors | SAS Data Sets | SAS xpt |
| SendGrid | ServiceNow | SFTP | SharePoint |
| SharePoint Excel Services | ShipStation | Shopify | SingleStore |
| Slack | Smartsheet | Snapchat Ads | Snowflake |
| Spark | Splunk | SQL Analysis Services | SQL Server |
| Square | Stripe | Sugar CRM | SuiteCRM |
| SurveyMonkey | Sybase | Sybase IQ | Tableau CRM Analytics |
| Tally | TaxJar | Teradata | Tier1 |
| TigerGraph | Trello | Trino | Twilio |
| Twitter Ads | Veeva CRM | Veeva Vault | |
| Wave Financial | WooCommerce | WordPress | Workday |
| xBase | Xero | XML | YouTube Analytics |
| Zendesk | Zoho Books | Zoho Creator | Zoho CRM |
| Zoho Inventory | Zoho Projects | Zuora | ... Dezenas de outros |