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.

已驗證Streamable HTTP可網頁執行效率與工作流金融

概覽

AI 產生的概覽

Monexa 是遠端 MCP 伺服器,讓 AI 助理讀取與管理使用者的收支紀錄、分類、付款方式、週期性支出和消費趨勢。

可以做什麼
透過 Monexa API 讀取與管理收支紀錄、分類和付款方式。處理週期性支出與消費趨勢報告。讀取並調整帳戶設定。工具依所涵蓋的後端路由分組,並以標註區分唯讀工具和寫入工具。
適用情境
適合在 Monexa 記帳的使用者,讓助理查詢消費情形、記錄或修改帳目、檢視週期性支出與趨勢,而不必切換應用程式。
執行需求
透過 Streamable HTTP 連線至 monexa.world 的遠端端點。驗證為 OAuth 且為必要:使用登入流程取得的 Monexa OAuth 存取權杖,或在網頁應用程式「設定—已連結應用程式」建立的個人存取權杖,以 bearer 方式送出。自架需要 Node 22、啟用 OAuth 的 Monexa 後端,以及文件中列出的環境變數,包括 OAuth 用戶端 ID 和密鑰。
安裝前請注意
此伺服器操作真實的財務紀錄:部分工具可建立、修改或刪除收支、分類、付款方式和週期性支出,核准寫入操作前應仔細確認。存取受 monexa.read 和 monexa.write 權限範圍限制。自架者需提供至少 32 個字元的 OAuth 用戶端密鑰,並與後端保持一致。權杖會與 Monexa 後端交換,後端可見相關請求。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Monexa,將其新增到工作區。
  2. 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

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

  1. 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_…) in Authorization: Bearer.
  2. 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.
  3. 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 the monexa.read / monexa.write scope.
  4. 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.
  5. 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.

VariableRequiredMust match backendDescription
PORTNoListen port, default 8080.
MCP_PUBLIC_URLYesMCP_RESOURCE_URL (this value plus /mcp)Public origin of this server, for example https://mcp.monexa.world. No path. http is only accepted for localhost, 127.0.0.1 and [::1].
MONEXA_OAUTH_ISSUERYesOAUTH_ISSUER_URLPublic OAuth issuer, for example https://api.monexa.world. A bare origin without trailing slash; it is compared verbatim with the issuer in the backend's metadata.
MONEXA_API_URLYesBackend base URL reachable from this service, for example http://backend:8080. Not necessarily public.
MCP_CLIENT_IDYesMCP_CLIENT_IDThe OAuth client the backend recognizes for token exchange.
MCP_CLIENT_SECRETYesMCP_CLIENT_SECRETAt least 32 characters. Generate it with openssl rand -hex 32.
ALLOWED_HOSTSIn productionComma-separated hostnames accepted in the Host header; must include the MCP_PUBLIC_URL host. Defaults to localhost,127.0.0.1 outside production (NODE_ENV=production makes it required).
OPENAI_APPS_CHALLENGE_TOKENNoServed as plain text at /.well-known/openai-apps-challenge for OpenAI domain verification; the route is absent when unset.

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

RouteDescription
POST /mcpThe MCP endpoint. A bearer token is required.
GET /.well-known/oauth-protected-resource/mcpProtected resource metadata.
GET /.well-known/oauth-authorization-serverMirror of the backend's authorization server metadata.
GET /.well-known/openai-apps-challengeOpenAI domain verification token, when configured.
GET /healthz200 {"status":"ok","version":…} once the backend's metadata has loaded, 503 before. It is not subject to host validation, so container probes on 127.0.0.1 work.
GET /icon.svg, GET /icon.pngThe Monexa icon advertised in serverInfo.icons.

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

bash
OAUTH_ISSUER_URL=http://localhost:9000MCP_RESOURCE_URL=http://localhost:3001/mcpMCP_CLIENT_ID=monexa-mcpMCP_CLIENT_SECRET=<at least 32 characters>

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:

bash
PORT=3001MCP_PUBLIC_URL=http://localhost:3001MONEXA_OAUTH_ISSUER=http://localhost:9000MONEXA_API_URL=http://localhost:9000MCP_CLIENT_ID=monexa-mcpMCP_CLIENT_SECRET=<same secret as the backend>
bash
cd mcp-servernpm installnpm run dev

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

ScriptWhat it does
npm run devRuns src/index.ts with tsx watch.
npm run buildCompiles src to dist/ with tsc -p tsconfig.build.json.
npm startRuns the compiled server, node dist/index.js.
npm run typechecktsc --noEmit over src, scripts and test.
npm run checkThe drift guard, described below.
npm run docsRegenerates TOOLS.md from the tool registry.
npm testRuns the vitest suite in test/. Tests are local-only by project policy: they are never committed and CI does not run them.

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 by go run ./cmd/routes -write) is covered by exactly one tool's covers list or listed in src/tools/excluded.ts with a reason, and every covers or excluded entry exists in the inventory.
  • Every route a tool covers is marked "delegated": true in the inventory, which means the backend allowlist in internal/middlewares/delegated_access.go lets 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: true cover only GET routes.
  • TOOLS.md equals what npm run docs generates.
  • server.json has the same version as package.json and 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 /mcp request 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 SIGTERM or SIGINT the server stops accepting connections and lets in-flight requests finish. It exits 0 when they are done and forces exit 1 after 8 seconds.
  • Container. The Dockerfile builds a node:22-alpine image 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
該伺服器需要登入,因此 SourceWeft 無法在沒有帳號的情況下讀取其工具,也未收錄。已連接帳號所能看到的內容可能因帳號及其權限而異。

版本歷史

1
  1. v2.0.0最新Oct 18, 2026

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分