本项目借助 CData 技术,为 Google Drive 构建了一个只读的 MCP 服务器,让大语言模型(LLMs)能以自然语言查询实时数据,无需编写 SQL 语句,极大提升了数据交互的便捷性。
本项目构建的是一个只读的 MCP 服务器。若你需要完整的读、写、更新、删除和操作功能,以及更简化的设置,请查看我们免费的 CData MCP 服务器 for Google Drive(测试版)。
git clone https://github.com/cdatasoftware/google-drive-mcp-server-by-cdata.git
cd google-drive-mcp-server-by-cdata
mvn clean install
此命令将创建 JAR 文件:CDataMCP-jar-with-dependencies.jar。lib 文件夹,通常路径为:
C:\Program Files\CData\CData JDBC Driver for Google Drive\/Applications/CData JDBC Driver for Google Drive/java -jar cdata.jdbc.googledrive.jar --licensejava -jar cdata.jdbc.googledrive.jar 打开连接字符串实用程序。注意:如果数据源使用 OAuth,你需要在浏览器中进行身份验证。
.prp 文件(例如 google-drive.prp),使用以下属性和格式:
Prefix=googledrive
ServerName=CDataGoogleDrive
ServerVersion=1.0
DriverPath=PATH\TO\cdata.jdbc.googledrive.jar
DriverClass=cdata.jdbc.googledrive.GoogleDriveDriver
JdbcUrl=jdbc:googledrive:InitiateOAuth=GETANDREFRESH;
Tables=
mcpServers 中。
{
"mcpServers": {
"{classname_dash}": {
"command": "PATH\\TO\\java.exe",
"args": [
"-jar",
"PATH\\TO\\CDataMCP-jar-with-dependencies.jar",
"PATH\\TO\\google-drive.prp"
]
},
...
}
}
{
"mcpServers": {
"{classname_dash}": {
"command": "/PATH/TO/java",
"args": [
"-jar",
"/PATH/TO/CDataMCP-jar-with-dependencies.jar",
"/PATH/TO/google-drive.prp"
]
},
...
}
}
如果需要,将配置文件复制到适当的目录(以 Claude Desktop 为例)。
cp C:\PATH\TO\claude_desktop_config.json %APPDATA%\Claude\claude_desktop_config.json
cp /PATH/TO/claude_desktop_config.json /Users/{user}/Library/Application\ Support/Claude/claude_desktop_config.json'
注意:你可能需要完全退出或关闭 Claude Desktop 客户端,然后重新打开,MCP 服务器才会显示。
运行以下命令以独立运行 MCP 服务器:
java -jar /PATH/TO/CDataMCP-jar-with-dependencies.jar /PATH/TO/Salesforce.prp
注意:服务器使用
stdio,因此只能与运行在同一台机器上的客户端一起使用。
MCP 服务器配置完成后,AI 客户端将能够使用内置工具对底层数据进行读、写、更新和删除操作。通常,你无需显式调用这些工具,只需让客户端回答有关底层数据系统的问题即可。例如:
在以下定义中,{servername} 指的是配置文件中 MCP 服务器的名称(例如上面的 {classname_dash})。
{servername}_get_tables - 检索数据源中可用的表列表。使用 {servername}_get_columns 工具列出表上的可用列。该工具的输出将以 CSV 格式返回,第一行包含列标题。{servername}_get_columns - 检索表的列列表。使用 {servername}_get_tables 工具获取可用表的列表。该工具的输出将以 CSV 格式返回,第一行包含列标题。{servername}_run_query - 执行 SQL SELECT 查询本服务器基于 CData JDBC 驱动,该驱动将 Google Drive 数据以关系型 SQL 模型的形式呈现。服务器封装了该驱动,并通过简单的 MCP 接口提供 Google Drive 数据,使得 LLMs 可以通过自然语言问题检索实时信息,无需编写 SQL 语句。
此 MCP 服务器采用 MIT 许可证授权。这意味着你可以自由使用、修改和分发该软件,但需遵守 MIT 许可证的条款和条件。有关更多详细信息,请参阅项目仓库中的 LICENSE 文件。
| 数据源 | 数据源 | 数据源 | 数据源 |
|---|---|---|---|
| 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 | ... 更多 |