Skip to main content
Glama
mf-full-mcp

mf-full-mcp

mf-full-mcp

An unofficial MCP server for Money Forward Cloud Accounting. It provides tools with the same names as the official beta MCP (mfc_ca_*), while adding the following three features:

  • Voucher attachment — Upload receipts and invoices to link them to journal entries. As of August 2026, the official remote MCP does not have this feature

  • Simultaneous connection to multiple offices — Holds tokens for multiple entities and can connect to a different office per window/session without re-authentication

  • Complete deletion of journal entries — The official MCP only supports registration and update, not deletion

It is designed for use cases like an accounting firm that moves between the books of dozens of companies on a daily basis.

This is an unofficial project. It has no affiliation with Money Forward, Inc. It is outside the scope of that company's support.


Why I built it

MF access tokens are tied to a single office selected on the authorization screen (evidence: /api/v3/offices returns a single object rather than an array). To handle multiple entities, you need to hold as many tokens as there are entities.

The official remote MCP has two endpoints, each with a different set of circumstances.

Official beta

Official alpha

This server

Simultaneous holding of multiple entities

Not possible (re-auth when switching)

Possible

Possible

Token lifetime

Long

Approx. 1 hour

Auto-refresh (verified to last over a month without use)

Authentication operation

Automatic

Manually copy and paste the auth code

Automatic

Voucher attachment

Not possible

Not possible

Possible

The beta version is easy to authenticate but can only hold one office, while the alpha version can hold multiple offices but the token expires in about an hour and requires manual re-authentication.

**The state of "handling multiple entities separately per window without being bothered by re-authentication" is not achieved by either official endpoint.** This server fills that gap by implementing OAuth itself.


Related MCP server: MF Invoice MCP

Design highlights

1. Implementing OAuth itself (dynamic client registration)

Under RFC 7591 dynamic client registration, a public client is registered for each authentication (token_endpoint_auth_method: "none" + PKCE).

Therefore, no prior app registration is required, and client_secret does not exist in the first place. No secret keys of any kind are placed in this repository or in the user's environment.

2. Saving tokens per office with labels

Tokens for multiple offices are held in ~/.mf-full-mcp/tokens.json (directory 0700 / file 0600), with labels as keys. The idea is: one token = one company, so hold as many as you need.

Expiration is handled by automatic refresh (proactive refresh 60 seconds before expiry + one retry on 401). In practice, refresh tokens remain valid for over a month, so once you authenticate, you can leave it alone for a while.

3. The active office is independent per session

This is the core of this project.

What use_office switches is only the in-process memory; it does not rewrite active in the shared file. The value in the shared file is only read as the initial value for a new process that has not yet switched.

As a result, you can operate Company A in window A and Company B in window B in parallel.

If the shared file were rewritten here, the moment one side switches offices, the other side would fetch data from a different entity. When dealing with books, this is an accident that must never happen. The substance of "simultaneous connection to multiple companies" lies less in being able to hold multiple tokens and more in not sharing the active state.

If you want to fix it at startup, use the environment variable MF_FULL_OFFICE.

4. Callback port is auto-assigned

With server.listen(0), the OS assigns a free port, and the client is registered after building redirect_uri with the confirmed port (RFC 8252 loopback redirect).

With a fixed port, authentication in a second window fails with EADDRINUSE. The order "listen → port confirmed → register → authorize" was necessary to make design 3 work in practice.

For backward compatibility, the fixed port is used only when MF_FULL_CALLBACK_PORT is explicitly set.


Voucher attachment

As of August 2026, the tools provided by the official remote MCP cover journal entries, reports, details, and master data operations, but do not include tools for handling vouchers (receipts and invoices). To link a voucher to a journal entry, the only option was to do it manually in the browser.

This server provides this as a tool. Just pass the absolute path of a local file, and it handles everything from base64 encoding to upload and attachment to the journal entry.

mfc_ca_postVouchers(journal_id: "<仕訳ID>", file_paths: ["/path/to/receipt.pdf"])

To unlink, use mfc_ca_deleteVouchers.

Being able to complete "create a journal entry and attach the corresponding receipt" in a single flow is one of the motivations for building this server.

Note — If journal_id is omitted, the voucher becomes an orphan not linked to any journal entry, and there is no way to link it to a journal entry later. As a rule, always specify it.


Requirements

  • Node.js 20 or later

  • A Money Forward Cloud Accounting account

Installation

git clone https://github.com/kentaroajisaka/mf-full-mcp.git
cd mf-full-mcp
npm install
npm run build

Register it with your MCP client (for Claude Code, ~/.claude.json).

{
  "mcpServers": {
    "mf-full": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/mf-full-mcp/dist/index.js"],
      "env": {}
    }
  }
}

Usage

Authenticate the first office

authenticate(label: "company-a")

Open the returned authUrl in a browser, select the office, and grant permission. When finished, check with auth_status.

Add the second and subsequent offices

Just repeat the same procedure with a different label.

authenticate(label: "company-b")

Switch the connection target

list_offices          保存済み事業者の一覧
use_office            このセッションの接続先を切り替える
mfc_ca_currentOffice  いまどの事業者に繋がっているか確認する

use_office does not affect other sessions. We recommend checking the target entity with mfc_ca_currentOffice before fetching data.

Tool list

Authentication and office management

Tool

Description

authenticate

Starts OAuth authentication (additional scopes such as payroll can also be requested via extra_scopes)

auth_status

Checks the status of an ongoing authentication flow

list_offices

Shows saved offices and the current connection target

use_office

Switches the connection target for this session

remove_office

Deletes a saved token

mf_full_info

Shows settings such as requested scopes and callback port

Official MCP compatibility (mfc_ca_*)

Offices and accounting periods, account items, sub account items, sections, tax categories, partners, linked services, journal entry retrieval/registration/update, trial balance (BS/PL), transition table (BS/PL), detail retrieval/creation/journalization.

What the official MCP does not provide

Tool

Description

mfc_ca_postVouchers

Uploads a voucher and attaches it to a journal entry (pass a local file path and it is automatically base64-encoded)

mfc_ca_deleteVouchers

Unlinks a journal entry and a voucher (the voucher itself remains behind as an orphan)

mfc_ca_deleteJournals

Completely deletes journal entries

Environment variables

Variable

Default

Description

MF_FULL_OFFICE

None

Fixes the session's connection target office at startup

MF_FULL_CALLBACK_PORT

Auto-assigned

Fixes the OAuth callback port

MF_FULL_SCOPES

16 accounting scopes

Overrides the requested scopes

MF_FULL_CLIENT_NAME

mf-full-mcp

Client name used for dynamic client registration


Known caveats

The MF API has several pitfalls that are easy to step into.

  • ID encoding — MF IDs are Base64-derived and contain characters such as %2F. If you embed them in a URL path without re-encoding, the path breaks and returns 403. This server already handles this, but please pass returned IDs as-is, without modification.

  • putJournals is a full replacement — Partial updates are not possible. Keep a copy of the original journal entry before updating.

  • Handling of write tools — Journal entry registration/update, voucher attachment/unlinking, and detail journalization rewrite the books. When using them from an AI agent, always include human approval before execution.

Security

Where tokens are stored

The official remote MCP completes authentication on the server side. Authorization and token exchange are provided as MCP tools, and there is no situation where the user directly handles access_token. In other words, MF tokens are never placed on the user's device.

This server, by contrast, holds tokens on your own device. They are stored in plaintext in ~/.mf-full-mcp/tokens.json (directory 0700 / file 0600).

This is a trade-off. Being able to hold multiple entities without re-authentication, and being able to leave it unattended with automatic expiration refresh, both work precisely because the refresh token is at hand. Conversely, if this file leaks, the books of every saved office can be accessed.

With that said, the following operational practices are assumed:

  • Use it on a personal device with disk encryption. Do not use it on shared devices.

  • Delete offices that are no longer needed with remove_office.

  • Saving to the OS keychain is a future task.

client_secret does not exist

With dynamic client registration, the design requires no secret key to be stored. client_secret is not placed in this repository or in the user's environment.

Disclaimer

This software is unofficial and has no relationship with Money Forward, Inc.

Some of the scopes requested by this server **may become unusable without notice due to specification changes on the MF side.** In that case, some features, such as those related to vouchers, will stop working.

Given the nature of accounting books, please note the following points when using it:

  • The author accepts no responsibility for the results of write operations

  • Verify that it works with a test office before using it on production books

  • Check Money Forward's terms of service yourself before use

It is provided under the MIT license. See LICENSE for details.

Available Tools

29 tools
authenticateA

MFへのOAuth認証を開始する。返ってきたauthUrlをユーザーがブラウザで開き、事業者を選択して許可すると自動でトークンが保存される。完了確認はauth_status。

Inputs: label, extra_scopes.

auth_statusA

進行中の認証フローの状態を確認する(waiting/exchanging/done/error)。

Inputs: no named parameters.

list_officesA

保存済みトークン(事業者)の一覧とアクティブな接続先を表示する。

Inputs: no named parameters.

mfc_ca_currentOfficeB

事業者情報と会計期間を取得します。

Inputs: no named parameters.

mfc_ca_deleteJournalsA

仕訳を完全削除します(公式MCP未提供・帳簿書き込み。要ユーザー承認)。

Inputs: id (required).

mfc_ca_deleteVouchersA

仕訳と証憑の紐付けを解除します(証憑自体は孤立して残る。公式MCP未提供・要ユーザー承認)。

Inputs: journal_id (required), voucher_file_id (required).

mfc_ca_getAccountsC

勘定科目を取得します。

Inputs: available.

mfc_ca_getConnectedAccountsB

連携サービス(自動連携・手動管理とも)を取得します。

Inputs: no named parameters.

mfc_ca_getDepartmentsB

部門を取得します。

Inputs: available.

mfc_ca_getJournalByIdB

仕訳を1件取得します。

Inputs: id (required).

mfc_ca_getJournalsB

仕訳一覧を取得します。start_date または end_date のいずれかが必要。

Inputs: page, end_date, per_page, account_id, +3 more.

mfc_ca_getReportsTransitionBalanceSheetB

貸借対照表の推移表(月別)を取得します。

Inputs: type (required), end_month, fiscal_year, include_tax, +2 more.

mfc_ca_getReportsTransitionProfitLossC

損益計算書の推移表(月別)を取得します。

Inputs: type (required), end_month, fiscal_year, include_tax, +2 more.

mfc_ca_getReportsTrialBalanceBalanceSheetB

貸借対照表の試算表(累計)を取得します。

Inputs: end_date, end_month, start_date, fiscal_year, +4 more.

mfc_ca_getReportsTrialBalanceProfitLossC

損益計算書の試算表(累計)を取得します。

Inputs: end_date, end_month, start_date, fiscal_year, +4 more.

mfc_ca_getSubAccountsC

補助科目を取得します。

Inputs: available.

mfc_ca_getTaxesC

税区分を取得します。

Inputs: available.

mfc_ca_getTermSettingsA

会計年度設定(税込/税抜・課税方式等)を取得します。

Inputs: no named parameters.

mfc_ca_getTradePartnersC

取引先を取得します。

Inputs: available.

mfc_ca_getTransactionsB

連携サービスで収集された明細一覧を取得します(自動連携・手動とも)。

Inputs: end_date (required), start_date (required), page, side, +9 more.

mfc_ca_postJournalsB

仕訳を作成します(帳簿書き込み。要ユーザー承認)。

Inputs: journal (required).

mfc_ca_postTradePartnersB

取引先を作成します。

Inputs: trade_partner (required).

mfc_ca_postTransactionJournalizeA

明細から仕訳を作成します(帳簿書き込み。要ユーザー承認)。相手科目account_idのみ必須。貸借方向・口座側科目・税区分・invoice_kindはMFが自動補完。

Inputs: account_id (required), transaction_id (required), memo, tags, +7 more.

mfc_ca_postTransactionsA

手動管理の連携サービスに明細を作成します(要ユーザー承認)。

Inputs: transactions (required), connected_account_id (required).

mfc_ca_postVouchersA

証憑をアップロードし仕訳に添付します(公式MCP未提供・要ユーザー承認)。file_paths を渡せばローカルファイルを自動でbase64化する。journal_id 省略時は孤立証憑になる(後から仕訳に紐づける手段はない)ので原則指定すること。

Inputs: file_paths, journal_id, voucher_files.

mfc_ca_putJournalsA

仕訳を更新します(全置換API・帳簿書き込み。要ユーザー承認)。

Inputs: id (required), journal (required).

mf_full_infoB

このサーバーの設定情報(要求スコープ・コールバックポート等)を表示する。

Inputs: no named parameters.

remove_officeC

保存済みトークンを削除する。

Inputs: label (required).

use_officeA

このセッションのアクティブな接続先事業者を切り替える(プロセス内メモリのみ。他セッション/他ウィンドウには影響しない)。

Inputs: label (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 29 tools

    Disambiguation4/5

    Most tools have clear resource/action separation: journals, transactions, reports, master data, auth, and office management each have distinct targets. A few pairs like currentOffice vs list_offices or postJournals vs postTransactionJournalize have some boundary overlap, but the descriptions are precise enough to resolve most ambiguity.

    Naming Consistency3/5

    The dominant mfc_ca_get/post/put/delete + Resource pattern is readable and consistent within the core accounting tools. However, the server mixes styles: verbless mfc_ca_currentOffice, un-prefixed snake_case names like remove_office and list_offices, and bare verbs like authenticate.

    Tool Count2/5

    29 tools is a heavy surface and exceeds the 25+ threshold. Although the tools are grouped into clear subdomains such as journals, reports, master data, and auth, the high number of parallel getters and report variants creates meaningful selection overhead for agents.

    Completeness3/5

    Core workflows are well covered: authentication, office switching, journal CRUD, report retrieval, and master data reads are all present. Obvious gaps remain, however: trade partners have no update/delete, transactions have no update/delete, and vouchers lack list/get or an attach-orphan recovery path.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      An MCP server and Claude plugin that enables interaction with freee APIs for accounting, human resources, invoicing, and more. It provides secure OAuth 2.0 authentication and integrates detailed API reference skills to support tasks like creating invoices and managing company data through natural language.
      18,608 npm
      521
      Apache 2.0
    • A
      license
      B
      quality
      D
      maintenance
      An MCP server that integrates with MoneyForward Cloud Invoice API v3 to automate the creation and management of quotes and invoices. It supports Japanese invoice system compliance, allowing users to handle partners, items, and billing through natural language.
      22
      1
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      An unofficial MCP server that integrates with the hokan Insurance CRM API v2 to manage customer data, schedules, and tasks. It also features specialized tools for Japanese insurance law compliance, including intent confirmation and regulatory check generation.
      -