Skip to main content
Glama
sahaniaditya

Expense MCP

by sahaniaditya

Expense MCP

开源支出追踪器,包含两个部分:

  1. 一个 FastMCP 服务器,将支出存储在 Postgres(Supabase)中。

  2. 一个作为 MCP 主机的 Expo Android 应用。你可以语音输入或键入一笔支出;Claude 会为你调用 MCP 工具。

实时 MCP 端点:

https://indirect-olive-catshark.fastmcp.app/mcp

仓库:github.com/sahaniaditya/expense-mcp

功能

  • add_expense — 保存金额、类别、日期和可选描述

  • get_expenses — 列出日期范围内的支出

  • data://categories — 食品杂货、交通、教育、娱乐、健康、其他

  • Android 上的语音输入(“我在食品杂货上花了 250”)

  • 用于远程服务器的 Horizon / FastMCP Cloud OAuth

  • 构建独立 APK 的 GitHub Actions 工作流

Related MCP server: Expense Tracker MCP

架构

Android app (MCP host)
  → Claude (Anthropic API)
    → FastMCP Cloud / local MCP server
      → Supabase Postgres

手机应用不直接与数据库通信。Claude 决定调用哪个工具;应用针对 MCP 服务器执行该工具。

MCP 服务器

要求

  • Python 3.14+

  • uv

  • 一个 Postgres 数据库(Supabase 可用)

数据库

创建一个 expenses 表:

create table if not exists expenses (
  id uuid primary key,
  price integer not null,
  category text not null,
  date timestamptz not null,
  description text
);

环境

.env.example 复制为 .env 并设置你的连接字符串:

SUPABASE_URL=postgresql://postgres:YOUR_PASSWORD@db.YOUR_PROJECT.supabase.co:5432/postgres

切勿提交 .env

本地运行

uv sync
uv run python main.py

HTTP MCP 端点是 http://127.0.0.1:8000/mcp

检查器:

uv run fastmcp dev inspector main.py

部署

将此仓库推送到 GitHub,然后在 Prefect Horizon / FastMCP Cloud 上创建一个项目,入口点为 main.py:mcp。在部署设置中将 SUPABASE_URL 添加为密钥。

客户端连接到:

https://YOUR-PROJECT.fastmcp.app/mcp

Horizon 认证默认开启。使用 Horizon API 密钥(fmcp_...)或从客户端完成 OAuth 登录。

Android 应用

源代码位于 mobile/

使用 Expo Go 试用(开发)

Play Store 的 Expo Go 必须匹配 SDK 54

cd mobile
npm install
npx expo start

你仍然需要一台运行 Metro 的电脑。如需仅手机安装,请使用 APK。

应用设置

  1. 打开 连接

  2. 确认 FastMCP Cloud URL(已为托管服务器预填)。

  3. 粘贴一个 Anthropic API 密钥

  4. 点击 登录并连接 并完成 Horizon 登录(或粘贴一个 fmcp_ API 密钥)。

  5. 使用 语音输入添加

应用会存储会话,并在下次启动时重新连接。

构建 APK

GitHub Actions 会生成发布版 APK(包含 JS bundle,无需 Metro):

  1. 推送到 mainapk-github-actions,或从 Actions 标签页运行 Android APK 工作流。

  2. 下载 expense-mcp-apk 构件。

  3. 解压并安装 app-release.apk

  4. 先卸载之前的任何调试版本。

本地 EAS(可选,需要 Expo 账户):

cd mobile
npx eas-cli login
npx eas-cli build -p android --profile preview

项目结构

main.py              MCP tools and resource
connection.py        Supabase / Postgres connection
mobile/              Expo SDK 54 Android client
.github/workflows/   APK build

许可证

MIT。参见 LICENSE

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    C
    quality
    D
    maintenance
    Enables AI assistants to manage personal finances by storing, analyzing, and exporting expense data using a persistent PostgreSQL database. Supports adding/editing expenses, generating spending summaries, detecting top categories, and creating monthly reports.
    12
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables management of expenses via SQLite database, including adding, listing, updating, deleting, filtering, and summing expenses through natural language.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables natural language management of personal expenses, including adding, listing, and summarizing expenses with local SQLite storage.
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    Persistent expense tracker backed by Neon Postgres with SQL tools for adding, editing, deleting, and analyzing expenses via natural language.
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sahaniaditya/expense-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server