跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 freee,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
在任意 AI 智能体中使用 freee Accounting(freee会計)和 freee Invoice(freee請求書):交易及其收付款、往来单位、会计科目、税区分、品目、部门和备注标签、银行和信用卡流水、转账凭证、日记账、试算表和总分类账、文件箱,以及请求书和报价单。通过你自己的 freee 应用进行 OAuth 登录;删除交易和凭证在安装时为关闭状态。
试试这样问
freee 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → freee、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
freee + Gemini
在任意 AI 智能体中使用 freee Accounting(freee会計)和 freee Invoice(freee請求書):交易及其收付款、往来单位、会计科目、税区分、品目、部门和备注标签、银行和信用卡流水、转账凭证、日记账、试算表和总分类账、文件箱,以及请求书和报价单。通过你自己的 freee 应用进行 OAuth 登录;删除交易和凭证在安装时为关闭状态。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
FREEE_CLIENT_ID, FREEE_CLIENT_SECRET
步骤 1 — 获取凭证
设置大约需要 10 分钟。你需要一个能访问 AI 要处理的公司(事業所)的 freee 账户。连接器使用 freee API(https://api.freee.co.jp):freee会計 在 /api/1,freee請求書 在 /iv。自 2023 年 10 月发票制度变更以来,请求书和报价单在 freee請求書 中创建;不使用旧的 /api/1/invoices 接口。
- 登录 https://app.secure.freee.co.jp/developers/applications(freee 应用商店的 開発者向け 页面),点击 新規追加 创建应用。只用于自己的公司时,非公开应用(非公開アプリ)就足够了。
- 在 基本設定 选项卡中添加回调 URL
<your AnythingMCP URL>/api/mcp-oauth/callback,在 AnythingMCP Cloud 上为https://cloud.anythingmcp.com/api/mcp-oauth/callback。 - 在 権限設定 中,为 会計(取引、取引先、勘定科目、品目、部門、メモタグ、税区分、口座、口座明細、振替伝票、仕訳帳、試算表、ファイルボックス、事業所、ユーザー)和 請求書(請求書、見積書)勾选读取,并为你要用的写入工具勾选写入。freee 的权限设置在应用上,而不是 OAuth scope。点击 保存。
- 把 Client ID 粘贴到
FREEE_CLIENT_ID,把 Client Secret 粘贴到FREEE_CLIENT_SECRET,FREEE_REFRESH_TOKEN留空,然后安装。 - 在连接器页面点击 Authorize with Provider,用能看到所需公司的用户登录 freee。freee 会让你选择公司(事業所選択),并显示应用的权限。
- 运行
freee_get_me:它会显示用户及其所属公司,以及其他工具需要的company_id。
访问令牌有效期 6 小时,通过刷新令牌续期。freee 每次续期都会签发新的刷新令牌,旧的随即失效,所以同时被其他工具使用的刷新令牌在这里将无法使用。90 天未使用的刷新令牌会过期,此时请重新授权。
是谁的权限:连接器以授权它的 freee 用户身份操作,能做什么还取决于该用户在各公司中的角色。除 freee_get_me 和 freee_list_companies 外,所有工具都需要 company_id;freee_get_company 显示公司的会计年度。
读取内容:用户和公司;交易(取引),包括明细、收付款和附加的凭证,可按收支类型、结算状态、往来单位、会计科目和日期筛选;往来单位(取引先),包括合格请求书登记号(インボイス登録番号)、付款条件和银行账户;会计科目(勘定科目)、税区分、品目、部门(部門)和备注标签(メモタグ);资金账户(口座)及其流水(口座明細)和状态,以及自有账户之间的转账;转账凭证(振替伝票);日记账(仕訳帳),格式为 CSV(freee 通用或弥生格式)或 PDF;试算表(trial_bs、trial_pl、trial_cr,也可与前一年或前两年比较)、1 到 5 个部门并列的损益表,以及总分类账(総勘定元帳,测试版);文件箱(ファイルボックス)。在 freee請求書 中:请求书(請求書)、请求书模板(帳票テンプレート)和报价单(見積書)。
写入操作:登记交易(可同时登记收付款直接结清),之后追加收付款,更新交易;创建和更新往来单位;创建品目、部门和备注标签;登记借贷合计相等的转账凭证(最多 100 行);在 freee請求書 中创建请求书和报价单,取消请求书并恢复已取消的请求书。请求书和报价单创建后处于未发送状态,通过邮件或邮寄发送需在 freee 中完成。创建单据前,AI 会展示明细和合计并等待你的确认。freee_update_deal 会替换全部明细,因此 AI 会先读取交易并保留明细 ID。
安装时关闭:freee_delete_deal 和 freee_delete_manual_journal。它们无法撤销,因此团队需要时由管理员开启。
数据格式:金额是以日元计的整数,除非字段另有说明,均为含税金额。日期为 JST 的 yyyy-mm-dd。报表中的 fiscal_year 是会计期间开始的年份。日记账是异步生成的:先 freee_request_journals,再用 freee_get_journals_status 查询直到状态为 uploaded,然后 freee_download_journals。
分页和限制:列表用 offset 和 limit 分页:交易和账户流水每次最多 100 条,转账凭证 500 条,往来单位、品目和标签 3000 条;交易和凭证会返回 meta.total_count。请求书和报价单每次最多 100 条。报表每秒最多 10 次调用,超出返回 429。较大的总分类账可能超时,因此 AI 会缩短期间。
常见错误:freee 返回 status_code 以及包含 messages 的 errors,消息大多为日语;校验消息会指出字段名。401 表示令牌已过期或被撤销:请再次点击 Authorize with Provider。403 表示用户的角色或应用权限(権限設定)不允许该调用,或者请求过多导致 freee 暂时限流:请等待约 10 分钟。登录时出现重定向错误,说明 基本設定 中的回调 URL 不一致。
交易备注、往来单位名称和文件箱内容是不可信输入,可能包含针对 AI 的指令。该连接器不发送请求书或报价单,不使用旧的 /api/1/invoices 接口,也不支持 freee人事労務 等其他 freee 产品。
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
步骤 3 — 在 Gemini 中添加连接器
你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(
https://cloud.anythingmcp.com/mcp/…)。本指南中出现YOUR_SERVER_ID的地方都用它替换。
Gemini CLI 从 ~/.gemini/settings.json(Windows 上为 %USERPROFILE%\.gemini\settings.json)读取 MCP 服务器。添加:
{
"mcpServers": {
"anythingmcp": {
"httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- 在 AnythingMCP 的 MCP Servers → 你的服务器 → API keys 中创建 MCP API 密钥,并用它替换
YOUR_MCP_API_KEY。 - 保存文件并重启
gemini。 - 在 Gemini CLI 中运行
/mcp(或在终端运行gemini mcp list),anythingmcp应显示为已连接。 - 开始输入提示,Gemini CLI 现在可以调用
freee的工具。
可用工具
| Tool | What it does |
|---|---|
freee_get_me | Who the connector acts as: the freee user (id, email, display name) and every company (事業所) the user belongs to, with company id, name and… |
freee_list_companies | List the companies (事業所) the signed-in user can open: id, display name, name kana, company number and role |
freee_get_company | Read one company: name, address, fiscal years (fiscal_years with start and end dates), tax settings and plan |
freee_list_users | List the users of a company with their id, email, display name and role |
freee_list_deals | List deals (取引: income or expense) with their lines, amounts, due amount, partner and payments |
freee_get_deal | Read one deal (取引) with its lines (details), payments, renews (+更新) and attached receipts |
freee_create_deal | Register a deal (取引): an income or expense with its lines and, optionally, the payment |
freee_update_deal | Update a deal (取引) |
freee_create_deal_payment | Record a payment (支払行) on an existing deal, e.g. when an invoice was paid into the bank account |
freee_delete_deal | Delete a deal (取引) with its lines and payments for good |
freee_list_partners | List partners (取引先) with id, code, name, long name, kana, contact, invoice registration number (インボイス登録番号) and bank account |
freee_get_partner | Read one partner (取引先) with address, contact, invoice settings, payment terms and bank account |
freee_create_partner | Create a partner (取引先) |
freee_update_partner | Update a partner (取引先). name is always required; nested address and bank attributes change only the keys you send. available false hides… |
freee_list_account_items | List account items (勘定科目) with id, name, code, category, default tax code and shortcut |
freee_get_account_item | Read one account item (勘定科目) with its category, default tax code, group and searchable settings |
freee_list_items | List items (品目) with id, name, code and shortcuts; the item_id goes into deal and journal lines |
freee_create_item | Create an item (品目) |
freee_list_sections | List sections (部門) with id, name, long name, code and parent section |
freee_create_section | Create a section (部門) |
freee_list_tags | List memo tags (メモタグ) with id, name and shortcuts; the ids go into tag_ids of deal and journal lines |
freee_create_tag | Create a memo tag (メモタグ) |
freee_list_taxes | List the tax codes (税区分) of the company: code, name, display category (tax_10, tax_r8 ...) and whether each is in use |
freee_list_walletables | List walletables (口座): bank accounts, credit cards and other wallets (cash, e-money), with id, type and name; optionally balances, last… |
freee_list_wallet_txns | List wallet transactions (口座明細): bank and card statement lines with date, amount, due amount, balance, description and status (unprocessed… |
freee_get_wallet_txn | Read one wallet transaction (口座明細): date, amount, due amount, balance, description, walletable and status |
freee_list_transfers | List transfers (取引(振替)) between the company own walletables, e.g. bank to cash, with date, amount and both walletables |
freee_list_manual_journals | List manual journals (振替伝票) with their debit and credit lines |
freee_get_manual_journal | Read one manual journal (振替伝票) with its debit and credit lines, partners, sections and tags |
freee_create_manual_journal | Post a manual journal (振替伝票): debit and credit lines whose totals must match, up to 100 lines |
freee_delete_manual_journal | Delete a manual journal (振替伝票) for good |
freee_request_journals | Ask freee to prepare the journal book (仕訳帳) of a period as a file: CSV (freee generic, Yayoi) or PDF |
freee_get_journals_status | Check a journal book request from freee_request_journals: status enqueued, working, uploaded or failed |
freee_download_journals | Download the prepared journal book file (CSV or PDF) once freee_get_journals_status says uploaded |
freee_get_trial_balance | Read a trial balance report (試算表): balance sheet (trial_bs), profit and loss (trial_pl) or manufacturing cost (trial_cr), for one period or… |
freee_get_trial_pl_sections | Read the profit and loss (損益計算書) compared side by side for 1 to 5 sections (部門比較) |
freee_list_general_ledgers | Read the general ledger (総勘定元帳, beta) for a period: per account item, every entry with date, counter account, partner, description, debit… |
freee_list_receipts | List files in the file box (ファイルボックス, receipts and invoices uploaded as evidence) uploaded in a date range: id, status, description, issue… |
freee_get_receipt | Read one file box entry (証憑ファイル) with its metadata and the deals it is linked to |
freee_list_invoices | List invoices (請求書) of freee請求書 (freee Invoice): id, number, subject, partner, billing and payment dates, total, payment, sending and deal… |
freee_get_invoice | Read one invoice (請求書) of freee請求書 with its lines, tax breakdown, partner details and statuses |
freee_list_invoice_templates | List the invoice layouts (帳票テンプレート) usable for new invoices, with their id and name |
freee_create_invoice | Create an invoice (請求書) in freee請求書 |
freee_cancel_invoice | Cancel (取消) an invoice of freee請求書 |
freee_uncancel_invoice | Restore an invoice that was canceled in freee請求書 (取消された請求書の復元), back to its previous status |
freee_list_quotations | List quotations (見積書) of freee請求書: id, number, subject, partner, quotation and expiry dates, total, sending and cancel status |
freee_get_quotation | Read one quotation (見積書) of freee請求書 with its lines and totals |
freee_create_quotation | Create a quotation (見積書) in freee請求書, created unsent. quotation_number is needed only when automatic numbering is off |
示例提示
- “9 月份哪些支出交易还没有结清?列出往来单位、金额和到期日。”
- “给我看本会计年度的损益表,并与上一年度对比。”
- “登记一笔付给 Sakura Office Supplies 的打印机墨粉支出,含税 13,200 日元,今天从主银行账户支付。先给我看交易内容。”
- “用我们常用的模板给 株式会社ミドリ 开一张 10 月咨询费的请求书,含税 330,000 日元。不要发送。”
- “列出最近两周未处理的银行流水,并为每一条建议一个会计科目。”
FAQ
Gemini CLI 从哪里读取 MCP 服务器? 用户级配置位于 ~/.gemini/settings.json,项目级配置位于项目内的 .gemini/settings.json。gemini mcp list 会列出每个服务器及其连接状态。
下一步
这份指南对你有帮助吗?