npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

p4compara-mcp

v1.2.2

Published

MCP server for P4 Compara - management accounting SaaS for Japanese SMEs

Readme

p4compara-mcp

npm version

P4 三表推移(管理会計SaaS)のMCPサーバーです。Claude Code や Cursor などのAIエージェントから財務データに直接アクセスし、分析を行うことができます。

特徴

  • APIキーのみで利用開始 — OAuth認証不要、環境変数1つで接続
  • プロジェクト単位のアクセス制御 — APIキーがプロジェクトに紐づくため projectId パラメータは省略可
  • freee / マネーフォワード対応 — P4 Comparaが連携済みの会計ソフトからデータを取得
  • 日本語Markdown出力 — LLMが解釈しやすい表形式で財務データを返却

クイックスタート

1. APIキーの取得

P4 Compara アプリの 設定 → データ連携 → MCPサーバー セクションでAPIキーを発行してください。

2. MCP設定ファイルに追加

Claude Code(CLI)

.claude/mcp.json に追加:

{
  "mcpServers": {
    "p4compara": {
      "command": "npx",
      "args": ["-y", "p4compara-mcp"],
      "env": {
        "P4C_API_KEY": "p4c_your-api-key-here"
      }
    }
  }
}

Cursor / VS Code(Claude Code拡張)

プロジェクトルートの .mcp.json に追加:

{
  "mcpServers": {
    "p4compara": {
      "command": "npx",
      "args": ["-y", "p4compara-mcp"],
      "env": {
        "P4C_API_KEY": "p4c_your-api-key-here"
      }
    }
  }
}

設定後、AIエージェントを再起動すれば利用開始できます。

利用可能なツール

APIキーのみで利用可能(10ツール)

| ツール | 説明 | |--------|------| | list_projects | プロジェクト一覧(名前・ステータス・会計ソフト・ロール) | | get_financial_statements | PL/BS/CFの月次推移データ(千円単位Markdown表) | | detect_anomalies | 13種類のルールによる財務データの異常検出 | | get_fiscal_years | 同期済みの会計年度とデータ期間 | | get_account_settings | 勘定科目のPL/BS分類設定 | | get_anomaly_settings | 異常検知の閾値・ルール設定 | | get_custom_metrics | カスタム経営指標(KPI)の定義 | | get_sync_status | 会計ソフトとの接続・同期状態 | | get_comments | 財務諸表セルのコメント(フィルタ対応) | | add_comment | 財務諸表セルへのコメント追加 |

開発者モード(追加の環境変数が必要)

以下のツールは会計ソフトのOAuthトークンへのアクセスが必要なため、SUPABASE_SERVICE_ROLE_KEY 環境変数が必要です:

| ツール | 説明 | |--------|------| | trigger_sync | 会計ソフト(freee/マネーフォワード)からデータ同期を実行 |

使い方の例

AIエージェントに話しかけるだけで、必要なツールが自動的に呼び出されます。

分析・レビュー(複数ツールの自動連携)

「直近12ヶ月の財務データをレビューして、気になる点を指摘して」
→ get_financial_statements + detect_anomalies が自動で呼ばれ、
  三表の推移と異常検知結果を総合的に分析し、レビューコメントを生成

「前年比で大きく変動した科目とその原因仮説を整理して」
→ get_financial_statements が呼ばれ、前年同期比で重要な変動を抽出し、
  考えられる要因をAIが列挙

「預り金や仮払金の滞留リスクをチェックして」
→ detect_anomalies が呼ばれ、仮勘定滞留・預り金精算漏れルールの
  検出結果をAIが解釈し、対応の優先度を提案

データの確認・操作

「プロジェクト一覧を見せて」
→ list_projects でプロジェクト名・会計ソフト・ロールの一覧を表示

「2025年度のPLとBSを見せて」
→ get_financial_statements で月次推移の損益計算書と貸借対照表を取得

「売上高の3月セルにコメント:前年比20%増の要因を確認」
→ add_comment で指定セルにコメントを投稿

動作要件

関連リンク