Monexa
io.github.emilijan-koteski由 GitHub 账号 emilijan-koteski 发布v2.0.0更新于 Oct 25, 2026
Track expenses and income, recurring payments and spending trends in Monexa from any AI assistant.
概览
Monexa 是一个远程 MCP 服务器,让 AI 助手读取和管理用户的收支记录、分类、支付方式、周期性支出和消费趋势。
- 可以做什么
- 通过 Monexa API 读取和管理收支记录、分类与支付方式。处理周期性支出和消费趋势报告。读取并调整账户设置。工具按所覆盖的后端路由分组,并通过注解区分只读工具和写入工具。
- 适用场景
- 适合在 Monexa 中记账的用户,让助手查询消费情况、记录或修改账目、查看周期性支出和趋势,而无需切换应用。
- 运行要求
- 通过 Streamable HTTP 连接 monexa.world 的远程端点。认证为 OAuth 且必需:使用登录流程获得的 Monexa OAuth 访问令牌,或在网页应用“设置—已连接应用”中创建的个人访问令牌,以 bearer 方式发送。自托管需要 Node 22、启用 OAuth 的 Monexa 后端,以及文档中列出的环境变量,包括 OAuth 客户端 ID 和密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 Monexa,将其添加到工作区。
- 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
- 为需要使用其工具的对话启用该服务。
Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。
交给智能体安装
把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。
阅读 https://sourceweft.com/mcp/io.github.emilijan-koteski%2Fmonexa/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。其他 MCP 客户端
把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。
{
"mcpServers": {
"monexa": {
"type": "http",
"url": "https://mcp.monexa.world/mcp"
}
}
}README
Monexa MCP server
Remote Model Context Protocol server for Monexa, served over Streamable HTTP at https://mcp.monexa.world/mcp. It lets AI assistants read and manage a user's records, categories, payment methods, recurring expenses, trend reports and settings.
This README is for developers and self-hosters. To connect an assistant, see the user guide. The tools are listed in TOOLS.md. Released under the MIT license.
How it works
- An AI app connects with a Monexa OAuth access token (
mnx_at_…, obtained through the OAuth flow the backend serves) or a personal access token (mnx_pat_…) inAuthorization: Bearer. - The server exchanges the bearer at the backend (RFC 8693,
POST /oauth/token, authenticated as the MCP client) for a short-lived delegated JWT. Successful exchanges are cached in memory, keyed by a hash of the token, for at most 4 minutes, and tokens the backend rejects are answered from memory for 30 seconds. - Each tool call runs with that JWT against the Monexa REST API (
MONEXA_API_URL). The backend only lets delegated tokens reach an allowlist of routes (internal/middlewares/delegated_access.go) and checks themonexa.read/monexa.writescope. - The server advertises the backend as its authorization server through protected resource metadata, so OAuth clients discover where to sign in. It mirrors the backend's metadata document, fetched at startup.
- The server is stateless and keeps no user data. Every request builds its own MCP server instance.
Environment
Set these on the service. The server refuses to start with a clear message when one is missing or malformed.
The backend side of the same setup is OAUTH_ISSUER_URL, MCP_RESOURCE_URL, MCP_CLIENT_ID and MCP_CLIENT_SECRET, optionally OAUTH_ACCESS_TOKEN_TTL (default 1h) and OAUTH_REFRESH_TOKEN_TTL (default 2160h). The backend needs all four or none, and serves no OAuth routes without them. Deployment details are in docs/DEPLOYMENT.md.
Routes
Until the backend's metadata has loaded, every route except /healthz answers 503 with Retry-After. At startup the server fetches ${MONEXA_API_URL}/.well-known/oauth-authorization-server up to 30 times, 2 seconds apart, and exits with code 1 if it never succeeds or if the issuer differs from MONEXA_OAUTH_ISSUER. A backend outage or a rejected client secret reaches clients as 503, never 401, so they do not fall into a re-authentication loop.
Local development
Requires Node 22 and a running backend with OAuth enabled. Start the backend with
in its environment, then run the MCP server with the same client credentials. npm run dev loads mcp-server/.env when it exists (git-ignored), so put them there:
Point the MCP Inspector (npx @modelcontextprotocol/inspector) at http://localhost:3001/mcp and sign in through OAuth, or paste a personal access token created in the web app under Settings, Connected apps.
Scripts
The drift guard
npm run check exits 1 with readable messages unless all of these hold:
- Every route in
../docs/api-routes.json(the backend's route inventory, written bygo run ./cmd/routes -write) is covered by exactly one tool'scoverslist or listed insrc/tools/excluded.tswith a reason, and everycoversor excluded entry exists in the inventory. - Every route a tool covers is marked
"delegated": truein the inventory, which means the backend allowlist ininternal/middlewares/delegated_access.golets connected apps call it. - Tool names are unique snake_case of at most 64 characters, and each tool has a title and the four annotation hints, with
openWorldHint: false. - Tools with
readOnlyHint: truecover onlyGETroutes. TOOLS.mdequals whatnpm run docsgenerates.server.jsonhas the sameversionaspackage.jsonand a description of at most 100 characters.
When the backend gains a route or its delegated allowlist changes, go run ./cmd/routes -check fails first. Run it with -write, then add a tool that covers the route or an entry in excluded.ts, run npm run docs, and commit the results together.
Tools
22 tools cover 24 of the backend's 65 API routes; the other 41 are intentionally excluded, such as sign-in, session and account-security routes, OAuth endpoints, legal documents, data export and trend report editing (see src/tools/excluded.ts and the end of TOOLS.md). Tool names are snake_case, input names are camelCase (for example includeDetails), and inputs are validated with zod before any API call. Every tool declares title, readOnlyHint, destructiveHint, idempotentHint and openWorldHint: false, and returns both structuredContent and a JSON text block.
Operations
- Logging. One JSON line per
/mcprequest with the HTTP and JSON-RPC method, tool name, status, duration in milliseconds and the OAuth client ID. Tokens and tool arguments are never logged. - Shutdown. On
SIGTERMorSIGINTthe server stops accepting connections and lets in-flight requests finish. It exits0when they are done and forces exit1after 8 seconds. - Container. The Dockerfile builds a
node:22-alpineimage that runs as a non-root user and probes/healthz; the start period allows for the metadata retries.
Versioning and releases
The version in package.json follows SemVer; server.json must carry the same version, and npm run check enforces it.
- Major: a tool is removed or renamed, or a tool's schema changes incompatibly.
- Minor: a new tool or a new optional parameter.
- Patch: fixes with no schema change.
Record changes under ## [Unreleased] in CHANGELOG.md (Keep a Changelog) and move them under the new version heading when releasing. Set a new tool's since to the version that introduces it.
To release, bump package.json, server.json and the changelog, merge to master, then push the tag mcp-vX.Y.Z (for example git tag mcp-v2.0.0 && git push origin mcp-v2.0.0). CI pushes the image ghcr.io/emilijan-koteski/monexa-mcp:vX.Y.Z and publishes server.json to the official MCP Registry as io.github.emilijan-koteski/monexa. Merging to master deploys the sha-<short> image to production independently of tags.
Support
Questions and bug reports: [email protected] or an issue on GitHub.
来源:mcp-server/README.md,提交 96d871a
工具
0版本历史
1- v2.0.0最新Oct 18, 2026
评分
已满足适用检查项的 85%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通必需25 分
- 已声明认证方式必需10 分
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分