プロトタイプ · プレビュー版:公式レジストリのすべてのサーバーを掲載し、30分ごとに同期しています。Google でログインするとレビューを書けます。プロトタイプ · 30分ごとに更新
PopNx MCPAIを使う人のためのMCPサーバー · やさしい言葉で解説

Wherewent

作者:habibafaisalバージョン 0.4.1i★ 0iパソコンで動くリポジトリ ↗
レジストリ名io.github.habibafaisal/wherewent

インストール方法

What it does

Zero-config SQL flight recorder for slow Python/SQLAlchemy jobs: exact call site, count, and fix.

  • Connects パソコンで動く
  • Account or key No key needed
  • Category 旅行・地図・天気

この順位の理由

一覧は利用スコア(100 点満点)で並びます。内訳は次のとおり

人気0/80GitHub スターか週間ダウンロード数。大きい方を 60、小さい方を 20 で数えます
新しさ3/1230 日以内のリリースかコード更新で満点
応答中0/8前回の確認でクラウドのエンドポイントが応答
利用スコア3/100

品質: 基本チェック 3/3 項目に合格(表示のみ、並び順には不使用) · 勢い: データなし (「急上昇」タブでのみ使用)

インストール

使っているAIアプリを選んで、設定をコピーしてください。

ひとことで AI にインストールしてもらう

Wherewent をインストールして。https://mcp.popnx.com/i/habibafaisal-wherewent.md に従い、コマンドを見せて、私が OK するまで実行しないで。

パソコンで作業できる AI(Claude Code や Cursor など)に貼り付けます。手順を読み、コマンドを見せて、あなたの OK を待ちます。キー不要・登録不要。 · AI が読む全文を見る

チェック 3/3 合格 · あなたのパソコンで動きます · ✓ コマンド確認済み 2026年11月14日

まず:どの AI を使っていますか?

使っているアプリを選ぶと、下に手順が表示されます。

Claude につなげますが、先に準備が必要です

先にパソコンへ Python (uv) を入れてください(1 回だけ) · パソコン版 Claude アプリ(Windows または Mac)のみ。Web やスマホでは使えません

AI にインストールしてもらう

このメッセージを Claude のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。

このパソコンの Claude に MCP server Wherewent を入れてください。順番に:1) uv --version で uv があるか確認。なければ https://docs.astral.sh/uv/getting-started/installation/ から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):{ "mcpServers": { "wherewent": { "command": "uvx", "args": [ "wherewent" ] } } } 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、Wherewent のツールが本当に表示されるか確認する。

このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。

  1. uv を入れる(まだなければ)

    もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

    uv --version
    • バージョン番号(例 uv …)が出る = 入っています。この手順は飛ばせます
    • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
    ターミナルの開き方

    Mac:⌘ + Space を押し、Terminal と入力して Enter

    Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

    まだ入っていない場合: uv にはクリック式のインストーラーがありません。uv 公式ページからお使いの OS(macOS か Windows)用の 1 行コマンドをコピーしてターミナルに貼り付けます · Python を別に入れる必要はなく、必要なときに uv が自動で取得します

    uv のダウンロードページを開く ↗

    入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: uv --version

    一度入れれば、uv を使うすべてのツールで使えます

  2. パソコン版 Claude アプリの設定ファイルを開く

    SettingsDeveloperEdit Config

  3. この設定を貼り付けて保存

    {
      "mcpServers": {
        "wherewent": {
          "command": "uvx",
          "args": [
            "wherewent"
          ]
        }
      }
    }
  4. Claude を終了してもう一度開く

  5. 試してみる

    Wherewent を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Claude が Wherewent を使っていると言うか、回答に Wherewent のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に Anthropic のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

ChatGPT はまだ Wherewent につなげません

Wherewent はパソコンに入れて使うものですが、ChatGPT は Web 上で動くサーバーにしかつなげません

代わりにできること

A · Wherewent につなげるアプリを使う

  • 先にパソコンへ Python (uv) を入れてください(1 回だけ) · パソコン版 Claude アプリ(Windows または Mac)のみ。Web やスマホでは使えません
  • 先にパソコンへ Python (uv) を入れてください(1 回だけ)
  • 先にパソコンへ Python (uv) を入れてください(1 回だけ)
  • 先にパソコンへ Python (uv) を入れてください(1 回だけ)

B · 旅行・地図・天気 の中で ChatGPT につなげる別のサーバー

同じカテゴリでよく使われているものから、キーなしでアドレスだけでつなげるものを選びました

Claude Code につなげますが、先に準備が必要です

先にパソコンへ Python (uv) を入れてください(1 回だけ)

AI にインストールしてもらう

このメッセージを Claude Code のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。

このパソコンの Claude Code に MCP server Wherewent を入れてください。順番に:1) uv --version で uv があるか確認。なければ https://docs.astral.sh/uv/getting-started/installation/ から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):claude mcp add --scope user wherewent -- uvx wherewent 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、Wherewent のツールが本当に表示されるか確認する。

このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。

  1. uv を入れる(まだなければ)

    もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

    uv --version
    • バージョン番号(例 uv …)が出る = 入っています。この手順は飛ばせます
    • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
    ターミナルの開き方

    Mac:⌘ + Space を押し、Terminal と入力して Enter

    Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

    まだ入っていない場合: uv にはクリック式のインストーラーがありません。uv 公式ページからお使いの OS(macOS か Windows)用の 1 行コマンドをコピーしてターミナルに貼り付けます · Python を別に入れる必要はなく、必要なときに uv が自動で取得します

    uv のダウンロードページを開く ↗

    入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: uv --version

    一度入れれば、uv を使うすべてのツールで使えます

  2. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:PowerShell を開く

  3. このコマンドを貼り付けて Enter

    claude mcp add --scope user wherewent -- uvx wherewent
  4. Claude Code で /mcp と入力

    Wherewent が一覧にあり、接続済みと表示されれば OK です

  5. 試してみる

    Wherewent を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Claude Code が Wherewent を使っていると言うか、回答に Wherewent のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に Anthropic のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

Cursor につなげますが、先に準備が必要です

先にパソコンへ Python (uv) を入れてください(1 回だけ)

AI にインストールしてもらう

このメッセージを Cursor のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。

このパソコンの Cursor に MCP server Wherewent を入れてください。順番に:1) uv --version で uv があるか確認。なければ https://docs.astral.sh/uv/getting-started/installation/ から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):{ "mcpServers": { "wherewent": { "command": "uvx", "args": [ "wherewent" ] } } } 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、Wherewent のツールが本当に表示されるか確認する。

このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。

  1. uv を入れる(まだなければ)

    もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

    uv --version
    • バージョン番号(例 uv …)が出る = 入っています。この手順は飛ばせます
    • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
    ターミナルの開き方

    Mac:⌘ + Space を押し、Terminal と入力して Enter

    Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

    まだ入っていない場合: uv にはクリック式のインストーラーがありません。uv 公式ページからお使いの OS(macOS か Windows)用の 1 行コマンドをコピーしてターミナルに貼り付けます · Python を別に入れる必要はなく、必要なときに uv が自動で取得します

    uv のダウンロードページを開く ↗

    入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: uv --version

    一度入れれば、uv を使うすべてのツールで使えます

  2. このボタンで Cursor を開く

    Cursor で開く

    Cursor がインストールの確認をするので Install を押します

  3. Cursor の AI チャットを Agent モードで開く

  4. 試してみる

    Wherewent を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Cursor が Wherewent を使っていると言うか、回答に Wherewent のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に Cursor のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

VS Code につなげますが、先に準備が必要です

先にパソコンへ Python (uv) を入れてください(1 回だけ)

AI にインストールしてもらう

このメッセージを VS Code のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。

このパソコンの VS Code に MCP server Wherewent を入れてください。順番に:1) uv --version で uv があるか確認。なければ https://docs.astral.sh/uv/getting-started/installation/ から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):{ "servers": { "wherewent": { "type": "stdio", "command": "uvx", "args": [ "wherewent" ] } } } 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、Wherewent のツールが本当に表示されるか確認する。

このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。

  1. uv を入れる(まだなければ)

    もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

    uv --version
    • バージョン番号(例 uv …)が出る = 入っています。この手順は飛ばせます
    • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
    ターミナルの開き方

    Mac:⌘ + Space を押し、Terminal と入力して Enter

    Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

    まだ入っていない場合: uv にはクリック式のインストーラーがありません。uv 公式ページからお使いの OS(macOS か Windows)用の 1 行コマンドをコピーしてターミナルに貼り付けます · Python を別に入れる必要はなく、必要なときに uv が自動で取得します

    uv のダウンロードページを開く ↗

    入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: uv --version

    一度入れれば、uv を使うすべてのツールで使えます

  2. このボタンで VS Code を開く

    VS Code で開く

    VS Code がインストールの確認をするので Install を押します

  3. VS Code の AI チャットを Agent モードで開く

  4. 試してみる

    Wherewent を使って、私に何ができるか教えて、1 つやってみせて

    ✓ VS Code が Wherewent を使っていると言うか、回答に Wherewent のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に VS Code のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

Windsurf、Zed、Gemini CLI など MCP を使える他のアプリは追加方法がそれぞれ違います。アプリ一覧で確認してください

MCP を使えるアプリをすべて見る →

JSON 設定は下の「開発者向け」にあります

つまずいたら?Wherewent を使っている人に聞いてみましょう💬 ディスカッション →
開発者向け:ターミナルのコマンドと JSON 設定

パソコンにインストール

Claude Code

claude mcp add --scope user wherewent -- uvx wherewent

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "wherewent": {
      "command": "uvx",
      "args": [
        "wherewent"
      ]
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "wherewent": {
      "command": "uvx",
      "args": [
        "wherewent"
      ]
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "wherewent": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "wherewent"
      ]
    }
  }
}

この設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。

ひと目でわかる

週あたりのダウンロードi
13/週
接続方法
パソコンで動く
最新バージョンi
0.4.1
レジストリ公開日i
2026年7月26日
コードの最終更新i
2026年7月31日
作者
habibafaisal
パッケージ
pypi: wherewent
ウェブサイト
github.com
レジストリでの状態
有効

使えるアプリ

このサーバーのつなぎ方と、各アプリの公式ドキュメントに基づきます。2026年11月10日に確認。

パソコン上で動かせるアプリ

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

すべてのアプリと長所・短所 →

できること

パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。

基本チェックi

誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月19日にチェック

  • ✓ 合格

    作者とリポジトリが一致

    レジストリ名は、リポジトリを所有するGitHubアカウント habibafaisal で確認済みです

  • ✓ 合格

    今もメンテナンスされている

    コードの最終更新:4 か月前

  • ✓ 合格

    ライセンスがある

    MITを使用

  • – 対象外

    エンドポイントが応答する

    これはパソコンで動くため、インターネット上のエンドポイントはありません

  • – 対象外

    OAuthでサインイン

    パソコンで動き、代わりにローカルの設定を使います

  • … 未チェック

    ツールの説明に隠れた指示がない

    パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです

公開済みの脆弱性(OSV.dev)

OSV.dev に wherewent@0.4.1 の登録はありません

このバージョンのパッケージ本体のみ確認。すべての依存関係ではありません · 確認日 2026年11月16日

確認していること → · JSON

作者の方へ:再確認の依頼・情報の誤りの報告
作者向け:README にバッジを付ける

作者の方は、このコードを README に貼れます。バッジはこのページにリンクします。

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/habibafaisal-wherewent.svg)](https://mcp.popnx.com/en/servers/habibafaisal-wherewent)

話し合い

質問、コツの共有、使えないことの報告ができます。「役に立った」の多い順です。

まだ投稿はありません。最初の質問や共有をどうぞ。

ここの投稿は利用者によるもので、PopNx チームのものではありません。

ログインして投稿

ユーザーレビュー

まだレビューはありません

ログインしてレビューを書く

旅行・地図・天気のほかのサーバーとの比較i

  • このカテゴリのほかの2008件のうち0%よりスターが多い
  • このカテゴリのほかの2008件のうち16%より最近レジストリに公開
  • 基本チェックの結果が、このカテゴリのほかの2008件のうち99%と同じかそれ以上

レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。

よくある質問

Wherewentは安全ですか?

当てはまる基本チェック3項目のうち3項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。

どんなキーやコードが必要ですか?

レジストリには必須のキーは載っていません。ただし、最初に使うときにサインインを求めるサーバーもあります。

パソコンで動きますか、それともクラウドですか?

あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。

今もメンテナンスされていますか?

GitHubリポジトリの最終更新は4 か月前、最新バージョン(0.4.1)がレジストリに届いたのは4 か月前です。

どのアプリで使えますか?

Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにPython (uv)も必要です。

代わりに使えるものは?

同じカテゴリには:Mu, Award Travel Finder, Killbottleneck, Whimsical, HasData Google Maps

似た働きのほかの候補

同じカテゴリでほかの作者のもの。コマンドは確認済み。公式を先に、次にスター順。

カードの見方:↓ 週あたりのダウンロードi★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i

Mu

News, web search, mail, markets, weather, places, files, calendar, contacts. 67 tools, one endpoint.

作者:micro成長中★ 4404 か月前更新

クラウドで動く✓ micro.mu

Whimsical

Create and edit flowcharts, mind maps, wireframes, and docs in Whimsical, or search your workspace.

作者:WhimsicalCode初期★ 112 か月前更新

クラウドで動く✓ 提供元 · whimsical.com
似たものと比べる
これ
Wherewent
MuAward Travel FinderKillbottleneckWhimsicalHasData Google Maps
動く場所パソコンにインストールが必要クラウドで動き、インストール不要クラウドで動き、インストール不要パソコンにインストールが必要クラウドで動き、インストール不要クラウドでもパソコンにインストールでも使える
キーが必要いいえいいえいいえはいいいえはい
Claude で + から追加いいえいいえいいえいいえはいいいえ
基本チェック3/34/43/33/34/45/5
ライセンスMITAGPL-3.0MITMITMITMIT
料金登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし

作者のREADME

READMEを開く

作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。

wherewent

Where did the time go? Find out in one command.

A zero-config recorder that answers "why did this Python batch job take so long?"

Run it from your shell — or as an [MCP server](#use-it-as-an-mcp-server-agent-native) an AI agent invokes directly.

wherewent run python your_job.py

The 0.4ms query that costs you 5 minutes

A query can be individually fast — 0.4ms — and still sink your job, because it's called 500,000 times from a single line of code. Your app burns 300 seconds on round-trips while Postgres itself only worked for 80. Every profiler you've tried shows you *"time spent in psycopg"* and stops there.

wherewent shows you the calling pattern. It groups queries by shape, counts how often each shape ran, sums the wall time, and points at the exact file:line in *your* code that fired it — then tells you, in plain English with the arithmetic shown, what to do about it.

====================================================================================================

wherewent — SQL flight recorder


wall: 26.15s cpu: 25.41s (97% CPU busy) queries: 20,004 commits: 20,001 rollbacks: 1 in-DB time: 5.46s (20.9% of wall; app-observed: includes network+driver+server) commit time: 9.06s total rows: 20,000 recording added ~1.81s (~6.9% of wall) ==================================================================================================== QUERY GROUP CALLS TOTAL MEDIAN CALL SITE


INSERT INTO events (name, value) VALUES (?, ?) 20,000 5.46s 0.24ms demo/naive_job.py:65 in main SELECT count(*) AS count_1 FROM events 1 0.00s 0.16ms demo/naive_job.py:71 in main ==================================================================================================== FINDINGS


  1. [R1+R2] commit-per-row loop 20,000 calls x 0.24ms median ~= 5.5s = 21% of 26.1s wall, at demo/naive_job.py:65. Batch it. 20,001 commits for 20,000 rows (1.0 rows/commit), 9.1s in commit = 35% of wall. Batch to 1,000+ rows/txn. ~= 14.5s attributable

====================================================================================================

Why it's different

Sampling profilersAPM / tracingwherewent
Zero code changes✅❌✅
Groups queries by shape❌⚠️✅
Blames *your* call site⚠️⚠️✅
Tells you the fix❌❌✅
Runs anywhere, no server✅❌✅
Works on a Ctrl-C'd partial run❌⚠️✅

Install

pip install wherewent

That's it — the recorder is pure standard library. You only need SQLAlchemy because *your job* already uses it.

Use it

Wrap any command. Your script runs completely unmodified — no imports, no decorators, no config:

wherewent run python your_job.py --some arg

wherewent run python -m your_package wherewent run --save run.json python your_job.py # also dump machine-readable JSON

  • The report prints to stderr at exit; your job's own stdout/stderr pass through untouched.
  • Ctrl-C still produces a report. Sampling the first 5 minutes of a 14-hour job is the main use case — partial data is the point.
  • Peek without stopping. Send SIGUSR1 (kill -USR1 ) for a partial snapshot mid-run, or run with WHEREWENT_INTERVAL=30 to print one every 30s. The job keeps going.
  • Works on async SQLAlchemy. Queries run inside a greenlet with no user frames on the stack, so naive stack-walking blames nothing; wherewent attributes them to your real call site anyway (AsyncSession / AsyncConnection).
  • It can never crash or corrupt your job. Every hook body is wrapped so the recorder fails silent rather than taking your run down with it.
  • It never records your data. Only query *shapes* and *counts* are kept — literal values and bind parameters are stripped before anything is stored.
Try the built-in demo
git clone https://github.com/habibafaisal/wherewent && cd wherewent

pip install -e ".[dev]" wherewent run python demo/naive_job.py # watch the R1+R2 finding fire python demo/benchmark.py # naive vs fixed, with the overhead gate

Use it as an MCP server (agent-native)

wherewent ships a [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server, so an AI agent can invoke it directly the moment a job is slow and get back machine-readable findings — instead of reading raw query logs and reasoning its way to the same conclusion. It is listed in the official MCP Registry as io.github.habibafaisal/wherewent.

Install with the [mcp] extra (this pulls in the MCP SDK; the core recorder stays pure-stdlib) and run the stdio server:

uvx --from 'wherewent[mcp]' wherewent-mcp

or: pip install 'wherewent[mcp]' && wherewent-mcp

Transport: stdio. Tools exposed:

MCP toolWhat it does
analyze_job(command, unit_function?, timeout_s=600)Run a Python/SQLAlchemy job under wherewent and return *why* it was slow — exact call site, query count, and fix as structured fields. On timeout, partial results are returned (timed_out: true).
explain_run(path)Return the enriched findings from a JSON file already produced by wherewent run --save — no re-run.

Each finding carries fix, call_site, calls, wall_fraction, and an evidence object an agent can act on and cite. Wire it into any MCP client (e.g. Claude Desktop) via config:

{

"mcpServers": { "wherewent": { "command": "uvx", "args": ["--from", "wherewent[mcp]", "wherewent-mcp"] } } }

A Dockerfile at the repo root builds this same stdio server for container-based MCP hosts.

Name your unit of work

"81,749 queries" is hard to judge. "135 queries per receivable" tells an engineer instantly that the architecture is chatty. Name the unit your job processes and wherewent reports the economics of *one* — median duration, queries/commits/rows per unit, and how the cost trends as the run progresses:

# Zero-config: name a function; every top-level call is one unit

wherewent run --unit-function myapp.jobs:process_receivable python run.py

# Or mark the unit in code (same machinery, same report)

import wherewent for receivable in book: with wherewent.unit("receivable"): process(receivable)

UNIT: myapp.jobs:process_receivable (1,203 units)


median duration 341 ms queries/unit 135 (median) commits/unit 1.0 rows/unit 46.0 GROWTH units 1–100 220 ms/unit units (last 100) 379 ms/unit queries 1–100 98 queries/unit queries (last 100) 171 queries/unit trend +72% slower over the run query trend +74% more queries/unit over the run ← R6 fires

R6 fires on either slope. That matters for a compute-bound job: if the clock stays flat but queries/unit climbs, the duration trend reads flat and only the query trend exposes the problem — so wherewent reports both and says plainly that the pattern is a *scalability* risk rather than the current wall-clock bottleneck.

The growth trend is why a *sampled* run is honest: it shows cost-per-unit rising, so you know the full run will be worse than a linear extrapolation — the thing a totals-only profiler can never tell you. Per-unit counts are exact even under concurrent async units; nothing but shapes and counts is ever recorded.

How it works

  1. Injects itself into the target process via a PYTHONPATH sitecustomize shim — no changes to your code, no wrapper imports.
  2. Listens at the class level — event.listen(sqlalchemy.engine.Engine, ...) — so *every* engine your app creates is captured automatically, config-free.
  3. Normalizes each statement into a query *group*: literals, bind params, IN-lists and multi-row VALUES collapse, so a million distinct inserts become one honest row.
  4. Resolves the call site by walking the stack past library frames to the first line of *your* code — cheaply: cached by filename, full stacks only for the first 5 samples per group, so the hot path stays cheap enough to hit its overhead budget.
  5. Fires deterministic findings from three rules, each showing its arithmetic.
The findings engine
RuleFires whenTells you
R1 — chatty group> 1,000 calls, > 10% of wall, median < 5msA fast query is called too many times — batch it (executemany / IN-list / JOIN).
R2 — commit-per-row> 100 commits, < 10 rows/commit, > 5% of wall in commitYou're committing per row — batch to 1,000+ rows per transaction.
R3 — DB-wait boundin-DB time > 60% of wall, CPU busy < 30%The job is round-trip bound, not compute bound.
R4 — co-occurring pattern≥ 2 query groups fire from the same function AND the pattern scales — many queries/iteration across many iterations, *or* > 10% of wall once one-time setup is excludedSeveral queries fire together every iteration (SELECT + UPDATE + INSERT) — collapse them into one round-trip. Clusters by *function*, not by line, so a helper that issues its statements on three different lines is still seen as one operation. One-shot (calls == 1) statements are excluded — they're fixed cost, and R5's job. Reports estimated *queries-per-iteration*, and flags patterns that scale even when a bounded run's clock hides them.
R5 — one-shot heavyweighta single calls==1 statement > 15% of wall or > 10s absoluteOne statement is a huge fixed cost. R1/R3/R4 all look for chattiness and miss it — R5 catches the single most fixable line. The absolute floor matters: 20s is worth cutting whether it's 24% of a sampled run or 1% of the full one.
R6 — rising per-unit costper-unit time *or* queries/unit climbs ≥ 1.5× from the first 100 units to the last 100 (needs --unit-function/wherewent.unit())Cost per item grows as the run progresses — accumulating state, unbatched history reads, or a list that grows each loop. Reports the slope (queries/unit early vs late), so a compute-bound job whose *query* cost is growing still gets caught.

Findings that share a root cause merge (e.g. R1+R2), everything under 5% of wall is suppressed, and at most the top 3 are shown — ranked by seconds attributable. R4 catches the case a per-group threshold can't: an N+1 pattern spread across a SELECT + UPDATE + INSERT that individually look innocent but fire as one unit each loop — and, since v0.3, it fires on patterns that scale even when one-time setup costs make them look small on a short sample run.

Every number is honest. Query times are labelled *app-observed* (they include network, driver, and server time — not just Postgres). Anything that can't be measured prints —, never a guess. wherewent even times

冒頭だけを表示しています。続きはリポジトリで読めます