Repository navigation
feat(usage): split /mcp initializes into probe / agent / unknown in /admin/activity - #89
Merged
Merged
Conversation
…admin/activity src/data/mcp-client-kinds.json (hand-edited list) + src/utils/client-kind.ts: clientInfo.name → agent (exact names, confirmed only: claude-code and codex-mcp-client, both captured from local runs on 2026-10-24) → probe (exact names mcpbeat, glama, then patterns probe|index|catalog| scanner|crawler|bot|rank|bench|verify|collector|marketplace|directory|monitor|uptime|health-check) → unknown. mcp_usage gains by_client_kind (over every client in the window, not just the top 20), initializes_excluding_probes and clients_excluding_probes; existing fields unchanged. Reads client_name already kept on initialize rows; nothing new is collected (SEC-2026-10-24-001 unchanged). No new route. Tests: scripts/test-client-kind.mjs (4), fixture = the 20 client names seen on production after the 1.3.0 Registry listing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
michielinksee
added a commit
that referenced
this pull request
Oct 24, 2026
…dendum A, awaiting ratification) (#91) src/utils/ua-family.ts reduces the User-Agent to one of six words — claude-code, codex, probe, node, python, other — from the product token only (text before the first "/" or space): claude-code → claude-code, codex-mcp-client → codex, a probe by the #89 list (src/data/mcp-client-kinds.json names and patterns) → probe, node → node, python-httpx / python-requests / python-urllib / aiohttp / httpx / python → python, anything else → other. The raw User-Agent and its version never leave the handler; only the word is stored. mcp_usage_log gains ua_family (ALTER TABLE when missing; earlier rows stay NULL, not rewritten), written on initialize and tools_call rows. /admin/activity mcp_usage gains by_ua_family (both kinds of row) and tools_calls_excluding_probe. No new route. Tests: scripts/test-ua-family.mjs (6). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
使われ方の記録で「目録・巡回」と「エージェントの利用」を分けて数える(main から・積んでいない)
指示:
founder-ops/research/Disclosure_2026-10/INSTRUCTION-agent-usage-probe-split.md。新しいデータは集めない(initialize 行に既にある client_name を読むだけ・SEC-2026-10-24-001 は変わらない)。経路不変(route-gate PASS・55 routes・58772bce…)。A. 集計で分ける
src/data/mcp-client-kinds.json(手で足し引き)+src/utils/client-kind.ts。判定の順: agent の名前(完全一致)→ probe の名前(完全一致)→ probe の語のパターン → unknown。大文字小文字は区別しない。other(64 字の検査に落ちた clientInfo)と空は unknown。パターンが壊れていたら、全部を probe にせず、パターンを無効にする。claude-codeclaude-code/2.1.301 (claude-desktop, agent-sdk/0.3.308)(括弧の中は起動元のアプリ)codex-mcp-clientcodex-mcp-client/0.153.4Claude Desktop・claude.ai・Cursor・VS Code・Windsurf・Cline・Goose・ChatGPT は確かめられないので入れていない(今は unknown)。
mcpbeat・glama・heldfast(どれも公開ページかソースで確認)+パターンprobe|index|catalog|scanner|crawler|bot|rank|bench|verify|collector|marketplace|directory|monitor|uptime|health-?check。/admin/activityのmcp_usageに追加(既存の欄はそのまま):by_client_kind(窓の中の全 client で数える。by_client の上位 20 だけではない)・initializes_excluding_probes・clients_excluding_probes(上位 20・kind 付き)。今の本番を区分けで数え直した結果(10/24 00:25 JST に観測した by_client 上位 20 種=initialize 65 件のうち 50 件):
残りの 15 件は上位 20 の外で、名前が見えていない。見張り画面の管理用の鍵が 10/24 の入れ替え後に 401 なので、今の全体はこの PR からは読めていない。マージと配備の後は
by_client_kindがそのまま全件を数える。B. tools_call の行を分けられるか(調べた結果・この PR では入れない)
ua_class(4 値)だけで、上の 3 つ(Claude Code・Codex・SDK)はどれもunknownになり見分けられない。claude-code/<版> (…)codex-mcp-client/<版>node(目録が自作する時によく使う形)mcpbeat/0.1 (+https://mcpbeat.com/bot/)・AgentToolIndex/1.0 (+…/method)・InvokeRankBot/0.1 (+https://invokerank.com/bot)・anlyon.dev-indexer/0.1・ElectraIndexBot)。verifymcp は第三者の記録でio.verifymcp/probe。ua_familyを 1 列足す。値は列挙値だけにする。claude-code/codex/probe(mcp-client-kinds の probe の名前・パターンを UA の先頭の語に当てる)/node/python/other。UA の生の文字列と版は残さない。これで「プローブの tools_call」と「実際のクライアントの tools_call」が分かれる。ua_classと同じ扱いになる。C. 外の目録の一覧
founder-ops/research/Discovery/mcp-directories.mdを新設した(20 行)。推測では埋めていない。
確かめた
scripts/test-client-kind.mjs4/4: 観測した 20 の名前の振り分け・確認済みでない実クライアントは unknown・判定の順と壊れたパターン・上位 20 の外まで数えるby_client_kind・probe を除いた数と一覧・/admin/activityに載ること。filesに足した)。やっていないこと: マージ・force-push・npm publish・本番 DB への書き込み・設定変更。
🤖 Generated with Claude Code