🚀 Google Drive MCP 服務器(由 CData 提供)
CData 的 Google Drive 模型上下文協議(MCP)服務器,可讓大語言模型(LLMs)通過自然語言查詢 Google Drive 中的實時數據。
⚠️ 重要提示
此項目構建的是隻讀 MCP 服務器。若需要完整的讀、寫、更新、刪除和操作功能,以及更簡化的設置,請查看我們免費的 CData Google Drive MCP 服務器(測試版)。
🚀 快速開始
本項目旨在創建一個只讀的 MCP 服務器,允許大語言模型(如 Claude Desktop)查詢由 CData Google Drive JDBC 驅動程序 支持的 Google Drive 實時數據。CData JDBC 驅動程序通過將 Google Drive 數據以關係型 SQL 模型的形式呈現,實現與 Google Drive 的連接。該服務器封裝了此驅動程序,並通過簡單的 MCP 接口提供 Google Drive 數據,使得大語言模型可以通過自然語言問題檢索實時信息,無需使用 SQL。
✨ 主要特性
- 支持大語言模型(如 Claude Desktop)通過自然語言查詢 Google Drive 實時數據。
- 封裝 CData JDBC 驅動程序,提供簡單的 MCP 接口。
- 支持多種數據源,可通過配置連接不同的數據源。
📦 安裝指南
- 克隆倉庫:
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。
- 下載並安裝 CData JDBC 驅動程序:https://www.cdata.com/drivers/googledrive/download/jdbc
- 為 CData JDBC 驅動程序授權:
- 導航到安裝目錄下的
lib 文件夾,通常為:
- (Windows)
C:\Program Files\CData\CData JDBC Driver for Google Drive\
- (Mac/Linux)
/Applications/CData JDBC Driver for Google Drive/
- 運行命令
java -jar cdata.jdbc.googledrive.jar --license
- 輸入您的姓名、電子郵件和 “TRIAL”(或您的許可證密鑰)。
- 配置數據源連接(以 Salesforce 為例):
- 運行命令
java -jar cdata.jdbc.googledrive.jar 打開連接字符串實用程序。
- 配置連接字符串並點擊 “測試連接”。
注意:如果數據源使用 OAuth,您需要在瀏覽器中進行身份驗證。
- 連接成功後,複製連接字符串以備後續使用。
- 創建 JDBC 連接的
.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=
💻 使用示例
在 Claude Desktop 中使用服務器
- 創建 Claude Desktop 配置文件(claude_desktop_config.json):
{
"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"
]
}
}
}
如果文件已存在,請將條目添加到配置文件的 mcpServers 中。如有需要,將配置文件複製到相應目錄(以 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):
注意:您可能需要完全退出並重新打開 Claude Desktop 客戶端,才能看到 MCP 服務器。
單獨運行服務器
java -jar /PATH/TO/CDataMCP-jar-with-dependencies.jar /PATH/TO/Salesforce.prp
注意:服務器使用 stdio,因此只能與運行在同一臺機器上的客戶端一起使用。
📚 詳細文檔
工具使用詳情
MCP 服務器配置完成後,AI 客戶端可以使用內置工具對底層數據進行讀、寫、更新和刪除操作。通常,您無需顯式調用這些工具,只需讓客戶端回答有關底層數據系統的問題即可。例如:
- “我的成交機會與客戶行業之間的相關性如何?”
- “我的 SUPPORT 項目中有多少未解決的工單?”
- “能告訴我今天有哪些日曆事件嗎?”
可用工具及描述
在以下定義中,{servername} 指的是配置文件中 MCP 服務器的名稱(例如上面的 {classname_dash})。
{servername}_get_tables - 檢索數據源中可用的表列表。使用 {servername}_get_columns 工具列出表中的可用列。該工具的輸出將以 CSV 格式返回,第一行包含列標題。
{servername}_get_columns - 檢索表中的列列表。使用 {servername}_get_tables 工具獲取可用表的列表。該工具的輸出將以 CSV 格式返回,第一行包含列標題。
{servername}_run_query - 執行 SQL SELECT 查詢
🔧 技術細節
此 MCP 服務器基於 CData JDBC 驅動程序構建,通過封裝該驅動程序,將 Google Drive 數據以關係型 SQL 模型的形式呈現,並通過簡單的 MCP 接口提供給大語言模型。服務器使用 stdio 進行通信,因此只能與運行在同一臺機器上的客戶端一起使用。
🛠️ 故障排除
- 在 Claude Desktop 中看不到 CData MCP 服務器:確保您已完全退出 Claude Desktop(Windows:使用任務管理器,Mac:使用活動監視器)。
- Claude Desktop 無法檢索數據:確保您已正確配置連接。使用連接字符串構建器創建連接字符串(見上文),並將連接字符串複製到屬性(.prp)文件中。
- 連接數據源時遇到問題:請聯繫 CData 支持團隊。
- 使用 MCP 服務器時遇到問題或有其他反饋:加入 CData 社區。
📄 許可證
此 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 |
Email |
EnterpriseDB |
Epicor Kinetic |
| Exact Online |
Excel |
Excel Online |
Facebook |
| 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 |
Instagram |
JDBC - ODBC Bridge |
| Jira |
Jira Assets |
Jira Service Management |
JSON |
| Kafka |
Kintone |
LDAP |
LinkedIn |
| 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 |
Pinterest |
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 |
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 |
... 更多 |