plaid-mcp
plaid-mcp
一个自托管的 MCP 服务器,让 Claude 能够通过 Plaid 查询您的银行账户、余额和交易。
工具
工具 | 描述 |
| 所有关联的银行账户 |
| 当前/可用余额及信用额度 |
| 指定日期范围内的完整交易记录 |
| 按类别细分的总支出 |
| 按 Plaid PFC 类别筛选交易 |
| 指定日期范围内的所有商户,按总支出排序 |
| 按商户名称筛选交易 |
工作原理
OAuth 2.1 + PKCE,使用 Google 作为身份提供商
电子邮件白名单作为安全边界
Claude.ai 获取一个 30 天的承载令牌(bearer token);您的 Plaid 访问令牌永远不会离开您的服务器
Caddy 部署在 FastAPI 前端,在 443 端口终止 TLS,使用自动配置的 Let's Encrypt 证书,并反向代理到
localhost:8080
要求
一台具有公网 IP 的 Linux 服务器(本指南使用 AWS EC2
t3.micro)指向该服务器的域名(本指南使用免费的 DuckDNS 子域名)
一个拥有生产环境访问权限的 Plaid 开发者账户
一个用于 OAuth 客户端的 Google Cloud 账户
设置
1. Plaid
在 dashboard.plaid.com 创建一个 Plaid 账户
在仪表板中申请 Production access(Plaid 将审核您的申请——这可能需要几天时间)
审核通过后,从 Team Settings → Keys 保存您的
client_id和Production密钥
2. Google OAuth
console.cloud.google.com → 创建一个项目
APIs & Services → OAuth consent screen → 设置一个“外部”应用,将您自己添加为测试用户
APIs & Services → Credentials → Create credentials → OAuth client ID
应用类型:Web application
Authorized redirect URIs:
https://yourdomain.com/auth/google/callback(使用下文第 4 步中的真实域名)保存
Client ID和Client secret
3. 服务器
本指南假设使用 AWS EC2:
启动一个
t3.microUbuntu 24.04 实例安全组:入站 TCP 22(来自您 IP 的 SSH)、80、443
分配一个弹性 IP 并将其关联到该实例
SSH 登录:
ssh -i your-key.pem ubuntu@<elastic-ip>
4. 域名
使用 DuckDNS 的免费选项:
使用 Google/GitHub/Reddit 登录
预留一个子域名(例如
plaid-yourname)将 IP 设置为您的弹性 IP
您的域名现在是
plaid-yourname.duckdns.org
回到第 2.5 步,将重定向 URI 设置为 https://plaid-yourname.duckdns.org/auth/google/callback。
5. 安装
在服务器上:
git clone https://github.com/lukew0824/plaid-mcp.git
cd plaid-mcp
cp .env.example .env
nano .env # fill in everything
./install.sh该脚本:
安装 Python、Caddy 和依赖项
设置 systemd 服务 (
plaid-mcp)将 Caddy 配置为反向代理,并通过 Let's Encrypt 实现自动 HTTPS
6. 在 Claude.ai 中连接
Claude.ai → Settings → Connectors → Add custom connector
URL:
https://yourdomain.com/mcp点击 Connect
使用与
ALLOWED_EMAIL匹配的 Google 账户登录仅首次使用:会出现一个 Plaid Link 弹出窗口 — 连接您的银行
完成。尝试:“我上个月在餐饮上花了多少钱?”
配置
.env 中的值:
键 | 描述 |
|
|
| 来自 Plaid 仪表板 |
| 来自 Plaid 仪表板 |
| 来自 Google Cloud Console |
| 来自 Google Cloud Console |
| 允许进行身份验证的唯一 Google 邮箱 |
| 此服务器的公共 HTTPS URL(末尾不带斜杠) |
|
|
许可证
MIT
Related MCP Connectors
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Hosted remote MCP server for YNAB on Cloudflare Workers with OAuth
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
MCP server for Argo RPG Platform — connects AI assistants to campaign data via OAuth2