使用说明
GDrive MCP HTTP包装器
这个小项目公开了一个可流式HTTP MCP端点,该端点使用保存的OAuth凭据连接到Google Drive。
感兴趣的文件
index.js--Express包装器实现/mcp使用SDK流式HTTP传输进行POST/GET/DELETE。Dockerfile--用于部署的容器映像。
环境变量
GOOGLE_APPLICATION_CREDENTIALS--OAuth客户端JSON的路径(默认为../gdrive-mcp-server/credentials/gcp-oauth.keys.json).MCP_GDRIVE_CREDENTIALS--保存的用户令牌的路径(默认为../gdrive-mcp-server/credentials/.gdrive-server-credentials.json).AUTH_BEARER_TOKEN--可选的承载令牌,用于保护端点。如果设置,请包括Authorization: Bearer <token>在FlyerGPT标头中。PORT--监听端口(默认3000)。
在本地运行(PowerShell)
cd workspace\gdrive-mcp-server-http
npm install
$env:GOOGLE_APPLICATION_CREDENTIALS = (Resolve-Path ..\gdrive-mcp-server\credentials\gcp-oauth.keys.json)
$env:MCP_GDRIVE_CREDENTIALS = (Resolve-Path ..\gdrive-mcp-server\credentials\.gdrive-server-credentials.json)
$env:AUTH_BEARER_TOKEN = 'choose-a-secret'
npm start
使用Docker运行
docker build -t gdrive-mcp-http .
docker run -p 3000:3000 -e GOOGLE_APPLICATION_CREDENTIALS=/credentials/gcp-oauth.keys.json -e MCP_GDRIVE_CREDENTIALS=/credentials/.gdrive-server-credentials.json -e AUTH_BEARER_TOKEN=choose-a-secret -v C:\path\to\credentials:/credentials gdrive-mcp-http
连接FlyerGPT
- 网址:
https://your-domain.example.com/mcp(确保您的反向代理将TLS转发到正在运行的应用程序) - 标题:
Authorization: Bearer choose-a-secret(如果你设置AUTH_BEARER_TOKEN)
备注
- 您必须运行一次felores身份验证流(在笔记本电脑或服务器上)以生成保存的凭据文件(
.gdrive-server-credentials.json).把它放在下面gdrive-mcp-server/credentials或点MCP_GDRIVE_CREDENTIALS在它。 - 此包装器使用官方MCP SDK Streamable HTTP传输;不需要额外的付费服务。
