@first-ch/tools-mcp 0.39.0 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  MCP server exposing [First CH Tools](https://tools.first-ch.com)' free web-tool logic — WCAG contrast, JP character/X-weight counting, WebP conversion, JSON-LD generation, llms.txt generation, encoding/line-ending conversion, Marp Markdown→slide rendering, Japanese/English test-data generation, text/code diffing, cron-expression explanation, Base64/data-URI encoding, URL query-parameter editing, HTML entity escaping/unescaping, JSON⇄YAML conversion, px ⇄ rem/em unit conversion, colour-code conversion with alpha compositing, MD5/SHA-1/SHA-256/SHA-384/SHA-512 hashing, JWT decoding with expiry and signature checks, User-Agent parsing with device/bot detection, bulk UUID v4 / ULID generation, aspect-ratio calculation with responsive sizing, case conversion between camelCase, snake_case and kebab-case, CSV/TSV ⇄ JSON conversion, IP/CIDR calculation with subnet splitting and IP-range reduction, business-day date calculation with Japanese public holidays, HTML-to-Markdown conversion, Japanese era ⇄ Western date conversion with age calculation, and URL-slug generation from Japanese titles — to AI agents such as Claude Code. All of those run on your machine.
4
4
 
5
- It also ships **`app_*` tools** for the 34 web apps at [apps.first-ch.com](https://apps.first-ch.com) (site checks such as GEO/AI-search readiness, meta tags, security headers, SSL certificates, DNS and email DNS, redirects, broken links, structured data, AI-crawler access, Japanese readability, and AI-assisted business-tone and LP-copy checks). Unlike the local tools, **an `app_*` tool sends its input (a URL, domain name or text) to apps.first-ch.com** and returns the JSON the app's API responds with — see [Network access, files and privacy](#network-access-files-and-privacy).
5
+ It also ships **`app_*` tools** for the 35 web apps at [apps.first-ch.com](https://apps.first-ch.com) (site checks such as GEO/AI-search readiness, meta tags, security headers, SSL certificates, DNS and email DNS, redirects, broken links, structured data, AI-crawler access, Japanese readability, and AI-assisted business-tone and LP-copy checks). Unlike the local tools, **an `app_*` tool sends its input (a URL, domain name or text) to apps.first-ch.com** and returns the JSON the app's API responds with — see [Network access, files and privacy](#network-access-files-and-privacy).
6
6
 
7
7
  日本語版は [後半セクション](#日本語) を参照してください。
8
8
 
@@ -89,6 +89,7 @@ This server is also registered in the [MCP Registry](https://registry.modelconte
89
89
  | `serp_check` | Checks whether a page's `<title>`, meta description and URL fit in a Google search result by **pixel width**, not character count (same judgement logic as tools.first-ch.com/serp/, without the visual preview). Desktop = 600px column, title 20px × 1 line, description 14px × 2 lines; mobile = 380px, 2 / 3 lines. Wraps CJK per character and Latin per word with simple kinsoku, returns the visible lines, the cut-off part, width vs. limit, grapheme counts, a state (ok / cut / short / empty), checks (empty, truncated, too short, no site-name separator, not https, deep path, percent-encoding), the breadcrumb and paste-ready tags. Widths are an approximation (Arial advance widths + 1em for CJK, no kerning), so they can run a few px wider than a browser measurement | `title?`, `description?`, `url?` or `items[]` (up to 500), `device?` (`desktop` / `mobile` / `both`), `lang?` |
90
90
  | `css_layout_generate` | Builds copy-ready CSS and HTML for a Flexbox or CSS Grid layout (same logic as tools.first-ch.com/css-layout/). Only non-default declarations are written, repeated tracks fold into `repeat()`. Validates `grid-template-areas` (equal cell counts per row, rectangular names, valid names, track-count mismatch) and emits `grid-area` rules. Notes flag combinations that do nothing (flex-grow vs justify-content, align-content with nowrap, 1fr tracks leaving no free space) and common pitfalls (min-width: auto overflow, 1fr minimum, reverse/dense reading order). Eight presets (holy grail, auto-fit grid, sidebar, header…) | `mode?` (`flex` / `grid` / `presets`), `preset?`, flex: `direction?`, `wrap?`, `justifyContent?`, `alignItems?`…; grid: `columns?`, `rows?`, `areas?`, `autoFit?`, `flow?`…; `gap?`, `count?`, `items?`, `lang?` |
91
91
  | `wiki_doc_lint` | Audits an exported internal wiki — Markdown, HTML or text exported from Notion, Backlog Wiki, Confluence and the like (same logic as tools.first-ch.com/wiki-doc-lint/). Returns **near-duplicate page pairs** (`duplicates`: Jaccard index of four-character fragments of the text with symbols and spaces removed, at or above `threshold`, with the lines only one side has and a fix that keeps the page with more incoming links, or the longer one on a tie), **orphan pages that no other page links to** (`orphans`, with `addLine` — the link line to add to a Notion-style parent or a contents page; index/README/home pages are not counted unless `entryPages=false`), **inconsistent and outdated terms** (`terms`: a "preferred ← variant" dictionary — your `dictionary` is added to the default one — plus Japanese katakana words found both with and without a final long-vowel mark, suggesting the majority form; every hit has its line and the line before/after the fix), **broken links** (`broken`: relative links with a document extension and `[[Page name]]` links whose target is not among the files) and a Markdown `report` of suggested fixes. Links are read from `[text](path)`, `[[Page name]]` and `<a href>`, matched by relative path, title, Notion file names with their IDs and the page name at the end of Notion/Confluence URLs. Code blocks, inline code, URLs and tags are skipped for terms, and matches inside a longer word (ユーザ in ユーザビリティ, Javascript in Javascripts) are ignored. Pass `paths` (absolute files or folders, read recursively; hidden folders and node_modules are skipped) or `files`. UTF-8, Shift_JIS and UTF-16 (BOM) are detected; up to 3,000 files / 60 MB. Read-only — it never edits the files | `paths?` or `files?` (`[{ path, text }]`), `threshold?` (0.5–1, default 0.8), `dictionary?`, `useDefaultDictionary?`, `autoChoon?`, `entryPages?`, `format?` (`both` default / `json` / `markdown`), `lang?` (`ja` default / `en`) |
92
+ | `fit_to_box` | Character size and line breaks for writing a string by hand into a printed box — e.g. the address, amount and name boxes on the inner envelope (nakabukuro) of a Japanese wedding or condolence money envelope (same logic as tools.first-ch.com/en/nakabukuro-ran/). From the box width and height (mm) and direction, returns the character size that fits (mm, rounded down to 0.1 mm), the line count and each line. Size uses a 1.5 mm margin inside each side and a 0.3× line gap, limited by both line length and line count (half-width letters/digits count as 0.6 in horizontal boxes; caps of 9 mm for addresses, 14 mm for amount/name). `kind: "address"` breaks between the street number and the building/room first, and only when that cannot reach 4 mm also after the prefecture/city or before the street number (runs like 12番地の18 or 1203号室 are never split; a line break in `text` marks the building; up to 4 lines); `postalCode` adds a 〒 line; vertical boxes get kanji street numbers (`numerals`: `digits` = 一〇, `tens` = 十). Below 4 mm, `alternatives` gives the size and lines with the prefecture dropped and with the building on two lines (it does not decide what may be dropped); `asIs` is how many characters spill out when written unbroken at 5 mm. `kind: "amount"` writes 30000 / 3万 / 30,000円 in formal numerals (daiji) as 金参萬円 (1–99,999,999; 圓, 也 and pre-printed 金/円 supported); `name` breaks only at spaces; `plain` takes any text | `text`, `width`, `height` (mm), `orientation?` (`vertical` default / `horizontal`), `kind?` (`address` default / `name` / `amount` / `plain`), `postalCode?`, `numerals?`, `thousandChar?` (阡 default / 千 / 仟), `yenChar?` (円 / 圓), `nari?`, `kinEnPrinted?`, `lang?` |
92
93
 
93
94
  ### App tools (`app_*`, sent to apps.first-ch.com)
94
95
 
@@ -116,6 +117,7 @@ Each `app_*` tool calls one app's public JSON API (`POST https://apps.first-ch.c
116
117
  | `app_mixed_content` | [Mixed Content Checker](https://apps.first-ch.com/en/mixed-content/) — Enter a URL to list every http:// reference left inside an https page (img, script, link, iframe, video, source and CSS url()), with its line number, the offending tag and how to fix it. References browsers block are separated from the ones they auto-upgrade. | `url` |
117
118
  | `app_image_audit` | [Page Image Audit](https://apps.first-ch.com/en/image-audit/) — Enter a URL to audit every img / picture on the page: format (WebP / AVIF adoption), loading=lazy, width/height attributes and alt text. For the first 30 images the real file size and served format are measured with a HEAD request. | `url` |
118
119
  | `app_tech_detect` | [Tech Stack Detector](https://apps.first-ch.com/en/tech-detect/) — Enter a URL to infer the CMS (WordPress, Shopify, Wix, STUDIO and more), framework, CDN, analytics tags (GA4/GTM) and web fonts from HTML and header signatures — always with the evidence behind each guess. | `url` |
120
+ | `app_gaibu_soushinsaki` | [Third-Party Tag Inventory](https://apps.first-ch.com/en/gaibu-soushinsaki/) — Fetches one page and matches the script src, img and iframe hosts and inline install snippets in its HTML against a table of 18 major analytics, advertising and social-embed services (Google, Meta, Microsoft, LinkedIn, LY Corporation, X). Returns the company count, per-service details (typical purpose, where to stop it, official source), discontinued services such as Universal Analytics, external hosts not in the table, and a CSV checklist. It only reads what is written in the HTML: it does not verify actual data transmission or legal compliance, and tags inside a tag manager are invisible. | `url` |
119
121
  | `app_wp_check` | [WordPress Quick Audit](https://apps.first-ch.com/en/wp-check/) — Enter a URL to see whether the site runs WordPress, which theme it uses, the version it announces, and whether REST API username enumeration, xmlrpc.php, author archives, the default login URL, readme.html or a debug log are exposed. Read-only GETs, never enumeration. | `url` |
120
122
  | `app_feed_check` | [RSS/Atom Feed Validator](https://apps.first-ch.com/en/feed-check/) — Enter a feed URL or a site URL: we discover the feed, fetch it, and validate its XML syntax, required elements, item list, character encoding and date formats (RFC 822 for RSS, RFC 3339 for Atom). Feeds using the itunes namespace also get the Apple Podcasts required-element check. | `url` |
121
123
  | `app_favicon_check` | [Favicon Checker](https://apps.first-ch.com/en/favicon-check/) — Enter a URL to extract every icon declaration (favicon.ico, link rel=icon, apple-touch-icon and Web App Manifest icons), fetch each one and list its real format, dimensions (every size inside an ICO) and weight — with light and dark previews. | `url` |
@@ -187,7 +189,7 @@ Release rule: a push to `main` automatically publishes a new package version thr
187
189
 
188
190
  `@first-ch/tools-mcp` は、[First CH Tools](https://tools.first-ch.com)(無料Webツール集)の計算ロジック — WCAGコントラスト比・日本語文字数/Xウェイト計測・WebP変換・JSON-LD生成・llms.txt生成・文字コード/改行コード変換・Marp Markdown→スライド レンダリング・テストデータ生成・テキスト/コード差分・Cron式の解説・Base64/Data URI変換・URLパラメータの分解/編集/再構築・HTML特殊文字のエスケープ/エンティティのデコード・JSON⇄YAMLの相互変換・px⇄rem/emの単位換算とCSSの一括変換・カラーコードの相互変換とアルファ透過の合成・MD5/SHA-1/SHA-256/SHA-384/SHA-512のハッシュ生成と照合・JWTのデコードと有効期限/署名の検証・User-Agent文字列の解析とデバイス判定・UUID v4 / ULIDの一括生成・アスペクト比の計算とレスポンシブサイズの算出・camelCase / snake_case / kebab-case などの文字列ケース変換・CSV/TSV ⇄ JSON の相互変換・日数/営業日の計算(日本の祝日を内蔵)・HTML→Markdownの変換・和暦⇄西暦の変換と満年齢の計算・日本語タイトルからのURLスラッグ生成 — をAIエージェント(Claude Code等)向けMCPツールとして提供するサーバーです。これらは全て端末内で処理します。
189
191
 
190
- あわせて、[apps.first-ch.com](https://apps.first-ch.com) のWebアプリ34本(GEO・メタタグ・セキュリティヘッダー・SSL証明書・DNS/メールDNS・リダイレクト・リンク切れ・構造化データ・AIクローラー許可・和文可読性・AIによるビジネス文面/LP文言のチェックなど)を呼ぶ **`app_*` ツール**も提供します。**`app_*` ツールは入力(URL・ドメイン名・文面)を apps.first-ch.com のサーバーへ送り**、アプリの API が返した JSON を返します(端末内で完結する他のツールとはここが違います)。詳しくは [通信・ファイル・プライバシー](#通信ファイルプライバシー) を参照してください。
192
+ あわせて、[apps.first-ch.com](https://apps.first-ch.com) のWebアプリ35本(GEO・メタタグ・セキュリティヘッダー・SSL証明書・DNS/メールDNS・リダイレクト・リンク切れ・構造化データ・AIクローラー許可・和文可読性・AIによるビジネス文面/LP文言のチェックなど)を呼ぶ **`app_*` ツール**も提供します。**`app_*` ツールは入力(URL・ドメイン名・文面)を apps.first-ch.com のサーバーへ送り**、アプリの API が返した JSON を返します(端末内で完結する他のツールとはここが違います)。詳しくは [通信・ファイル・プライバシー](#通信ファイルプライバシー) を参照してください。
191
193
 
192
194
  ### インストール
193
195
 
@@ -272,6 +274,7 @@ claude mcp add firstch-tools -- npx -y @first-ch/tools-mcp
272
274
  | `serp_check` | title / meta description / URL が Google 検索結果に収まるかを、文字数ではなく**ピクセル幅**で判定する(tools.first-ch.com/serp/ の判定部分と同一ロジック・プレビュー描画は除く)。パソコン=幅600px・タイトル20px×1行・説明文14px×2行、スマートフォン=380px・2行/3行。和文は文字単位・欧文は単語単位で禁則つきで折り返し、表示される行・切り詰められる部分・幅と上限・文字数・状態(ok / cut / short / empty)・指摘(未入力・切り詰め・短い・サイト名の区切りが無い・https でない・階層が深い・%エンコード)・パンくず表示・貼り付け用タグを返す。幅は近似(Arial の字幅表+和文1em・カーニングなし)で、ブラウザの実測より数px広く出ることがある | `title?`・`description?`・`url?` か `items[]`(500件まで)、`device?`(`desktop` / `mobile` / `both`)、`lang?` |
273
275
  | `css_layout_generate` | Flexbox / CSS Grid の指定から、コピーして使える CSS と HTML を作る(tools.first-ch.com/css-layout/ と同一ロジック)。既定値と同じ宣言は書かず、同じトラックは repeat() に畳む。grid-template-areas を検証し(行ごとのマス数・名前が長方形か・使えない名前・列トラック数との食い違い)、名前ごとの grid-area を出す。効かない組み合わせ(flex-grow と justify-content・nowrap の align-content・1fr で余白が無い)と落とし穴(min-width: auto のあふれ・1fr の最小値・reverse/dense の読む順)を notes で指摘。定番8種のプリセット | `mode?`(`flex` / `grid` / `presets`), `preset?`, flex: `direction?`・`wrap?`・`justifyContent?`・`alignItems?` ほか、grid: `columns?`・`rows?`・`areas?`・`autoFit?`・`flow?` ほか、`gap?`, `count?`, `items?`, `lang?` |
274
276
  | `wiki_doc_lint` | Notion・Backlog Wiki・Confluence などから書き出した社内文書(Markdown / HTML / テキスト)を点検する(tools.first-ch.com/wiki-doc-lint/ と同一ロジック)。**内容がほぼ同じページの組**(`duplicates`: 記号と空白を除いた本文の4文字単位の断片の Jaccard 係数が `threshold` 以上の組・それぞれにしかない行・被リンクの多い方〔同数なら本文が長い方〕を残す修正案)、**ほかのどのページからもリンクされていない孤立ページ**(`orphans`: Notion 型の親ページか目次ページに足すリンクの1行 `addLine` つき。index・README・home などの目次ページは `entryPages=false` にしない限り数えない)、**表記ゆれ・旧称**(`terms`: 「揃える表記 ← ゆれ」の辞書〔`dictionary` は既定の辞書に足す〕と、辞書に無いカタカナ語の語末の長音ゆれ〔多い方に揃える案〕。各箇所の行番号と修正前後の文)、**リンク切れ**(`broken`: 文書の拡張子を持つ相対リンクと `[[ページ名]]` のうち行き先が無いもの)、修正案をまとめた Markdown の `report` を返す。リンクは `[文字](パス)`・`[[ページ名]]`・a タグを読み、相対パス・ページ名・Notion のIDつきファイル名・Notion/Confluence のURL末尾のページ名で照合する。コードブロック・インラインコード・URL・タグは表記ゆれの対象外で、語の途中(ユーザビリティの中のユーザ)は拾わない。`paths`(ファイル・フォルダーの絶対パス。サブフォルダーまで読み、隠しフォルダーと node_modules は飛ばす)か `files` を渡す。UTF-8・Shift_JIS・UTF-16(BOM)を自動判別し、3,000ファイル・合計60MBまで。ファイルは読むだけで書き換えない | `paths?` または `files?`(`[{ path, text }]`)、`threshold?`(0.5〜1・既定 0.8)、`dictionary?`、`useDefaultDictionary?`、`autoChoon?`、`entryPages?`、`format?`(既定 `both` / `json` / `markdown`)、`lang?`(既定 `ja` / `en`) |
277
+ | `fit_to_box` | 印刷済みの記入欄(市販の中袋〔ご祝儀袋・香典袋〕の「住所」「金額」「氏名」の欄など)に手で書くとき、欄の幅・高さ(mm)と向きから、収まる1字の大きさ(mm・0.1mm単位で切り捨て)・行数・改行した後の各行を返す(tools.first-ch.com/nakabukuro-ran/ と同一ロジック)。欄の線から内側へ1.5mmずつ余白を取り、行間を字の0.3倍として、行の長さと行数の両方から決める(横書きの半角英数は0.6字分・上限は住所9mm・金額と氏名14mm)。`kind: "address"` は「〜番地」と「建物名・部屋番号」の境目で改行し、そこで4mmに届かないときだけ都道府県・市区町村の後や番地の前でも区切る(「12番地の18」「1203号室」など数字の並びの途中では切らない・`text` の改行は建物名の前として扱う・最大4行)。`postalCode` で「〒」の行を先頭に足し、縦書きの欄では番地を漢数字にする(`numerals`: `digits`=一〇型 / `tens`=十型)。1字が4mm未満なら `alternatives` に「都道府県を省いた場合」「建物名を2行にした場合」の大きさと行を返す(省いてよいかは判断しない)。`asIs` は改行せずに1字5mmで書いたときにはみ出す字数。`kind: "amount"` は 30000・3万・30,000円 を大字の「金参萬円」にして欄に合わせる(1〜99,999,999円・圓/也/「金」「円」が印刷済みに対応)。`name` は空白でだけ改行し、`plain` は任意の文字列 | `text`、`width`・`height`(mm)、`orientation?`(既定 `vertical` / `horizontal`)、`kind?`(既定 `address` / `name` / `amount` / `plain`)、`postalCode?`、`numerals?`、`thousandChar?`(既定 阡 / 千 / 仟)、`yenChar?`(円 / 圓)、`nari?`、`kinEnPrinted?`、`lang?` |
275
278
 
276
279
  #### apps のツール(`app_*`・apps.first-ch.com へ送信)
277
280
 
@@ -299,6 +302,7 @@ claude mcp add firstch-tools -- npx -y @first-ch/tools-mcp
299
302
  | `app_mixed_content` | [混在コンテンツチェッカー](https://apps.first-ch.com/mixed-content/) — https のページに残った http:// の参照(img・script・link・iframe・video・source・CSS の url())を抽出し、行番号・タグ・直し方と、ブラウザがブロックするか自動で https 化されるかを返す。見つかった http:// のURLへはアクセスしない。 | `url` |
300
303
  | `app_image_audit` | [ページ内画像診断](https://apps.first-ch.com/image-audit/) — URLのページ内の img / picture を抽出し、フォーマット(WebP・AVIF 対応)・loading=lazy・width/height の指定・alt を診断する。先頭30枚は HEAD リクエストで実際のファイルサイズと形式まで測る。 | `url` |
301
304
  | `app_tech_detect` | [技術スタック検出](https://apps.first-ch.com/tech-detect/) — URLのページの HTML と応答ヘッダーのシグネチャから、CMS(WordPress・Shopify・Wix・STUDIO 等)・フレームワーク・CDN・解析タグ(GA4/GTM)・Webフォントを推定し、そう判断した根拠(どこで何に合致したか)と一緒に返す。 | `url` |
305
+ | `app_gaibu_soushinsaki` | [外部タグ棚卸し(解析・広告・SNS埋め込み)](https://apps.first-ch.com/gaibu-soushinsaki/) — URLのページを1回だけ取得し、HTMLに書かれた script の src・img・iframe の外部ホストとインラインの設置スニペットを、主要18サービス(Google・Meta・Microsoft・LinkedIn・LINEヤフー・X)の対応表と照合する。会社数・サービスごとの明細(一般的な用途・止める場所・公式資料の出典)・終了済みサービス(UA など)・表にない外部ホストと、確認用の棚卸し表(CSV)を返す。HTMLに書かれたタグだけを見るもので、実際の送信や法令への適合は判定しない(タグマネージャー経由のタグは見えない)。 | `url` |
302
306
  | `app_wp_check` | [WordPress簡易診断](https://apps.first-ch.com/wp-check/) — URLのサイトが WordPress かどうか・テーマ名・名乗っている範囲のバージョンを判定し、REST API のユーザー名列挙・xmlrpc.php・著者アーカイブ・既定のログインURL・readme.html・デバッグログの露出を診断する。攻撃的な列挙はせず GET で見える範囲だけを見る(WordPress の痕跡があるときだけ既定パス7本を追加で GET。ユーザー名は件数だけ返す)。 | `url` |
303
307
  | `app_feed_check` | [RSS/Atomフィード検証](https://apps.first-ch.com/feed-check/) — フィードを自動発見して取得し、XML の構文・必須要素・記事一覧・文字化け・日付形式(RSS は RFC 822・Atom は RFC 3339)を検証する。itunes 名前空間のあるフィードは Apple Podcasts の必須要素も確認する。 | `url` |
304
308
  | `app_favicon_check` | [faviconチェッカー](https://apps.first-ch.com/favicon-check/) — URLのページの favicon.ico・link rel=icon・apple-touch-icon・Web App Manifest のアイコン宣言を抽出し、1件ずつ実際に取得して形式・実寸法(ICO は内包サイズ全部)・容量を返す。 | `url` |
package/apps.mjs CHANGED
@@ -204,6 +204,13 @@ const DEFS = [
204
204
  '技術スタック検出',
205
205
  'URLのページの HTML と応答ヘッダーのシグネチャから、CMS(WordPress・Shopify・Wix・STUDIO 等)・フレームワーク・CDN・解析タグ(GA4/GTM)・Webフォントを推定し、そう判断した根拠(どこで何に合致したか)と一緒に返す。',
206
206
  ),
207
+ urlApp(
208
+ 'gaibu-soushinsaki',
209
+ '/gaibu-soushinsaki/api/inventory',
210
+ '外部タグ棚卸し(解析・広告・SNS埋め込み)',
211
+ 'URLのページを1回だけ取得し、HTMLに書かれた script の src・img・iframe の外部ホストとインラインの設置スニペットを対応表(Google・Meta・Microsoft・LinkedIn・LINEヤフー・X の主要18サービス)と照合する。会社数・サービスごとの明細(一般的な用途・止める場所・公式資料の出典)・終了済みサービス(UA・オプティマイズ)の数・表にない外部ホストと、確認用の棚卸し表(CSV)を返す。HTMLに書かれたタグだけを見るもので、実際の送信や法令への適合は判定しない(タグマネージャー経由のタグは見えない)。',
212
+ { urlLabel: '棚卸しする自社サイトのページのURL' },
213
+ ),
207
214
  urlApp(
208
215
  'wp-check',
209
216
  '/wp-check/api/check',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@first-ch/tools-mcp",
3
- "version": "0.39.0",
4
- "description": "First CH Tools の計算ロジック(WCAGコントラスト比・文字数/Xウェイト・WebP変換・JSON-LD生成・llms.txt生成・文字コード/改行コード変換・Marp Markdown→スライド レンダリング・テストデータ生成・テキスト/コード差分・Cron式の解説・Base64/Data URI変換・URLパラメータの分解/再構築・HTML特殊文字のエスケープ/エンティティのデコード・JSON⇄YAMLの相互変換・px⇄rem/emの単位換算とCSSの一括変換・カラーコードの相互変換とアルファ透過の合成・MD5/SHA-1/SHA-256/SHA-384/SHA-512のハッシュ生成と照合・JWTのデコードと有効期限/署名の検証・User-Agent文字列の解析とデバイス判定・UUID v4/ULIDの一括生成・アスペクト比の計算とレスポンシブサイズの算出・TSV/CSVからMarkdownテーブルへの整形と相互変換・SQLクエリの整形と予約語の大文字化・URL/テキストからのQRコード生成・UNIXタイムスタンプと日時表記の相互変換・robots.txtの生成(AIクローラーの許可プリセット付き)・文字列のケース変換(camelCase/snake_case/kebab-case など11形式)・CSV/TSVとJSON配列の相互変換(区切りの自動判定・a.b 列と入れ子の相互展開)・全角⇄半角の変換とテキストの掃除(文字種ごとの向き指定・半角カナの合成/分解・空白と空行の整理)・IPアドレス/CIDRの計算(ネットワーク・ブロードキャスト・ホスト範囲とホスト数・IPv4/IPv6・サブネット分割・包含判定・IP範囲→最小CIDR集合の逆算)・日数/営業日の計算(2日付間の日数と営業日数・起点日+N日/N営業日の期日・締め日と支払サイトからの支払日・土日と日本の祝日を内蔵)・HTML→Markdownの変換(見出し/リスト/表/リンク/画像/コード・script/styleや装飾タグの除去・本文だけの抽出・相対URLの絶対化)・和暦⇄西暦の変換(令和〜明治・自動判定・曜日と干支・存在しない和暦の指摘・満年齢と入学/卒業の年・元号一覧と早見表)・日本語タイトルからのURLスラッグ生成(かな→ヘボン式ローマ字・記号除去・ハイフン/アンダースコア連結・小文字化・長音の省略/表記)・Basic認証用 htpasswd の生成と照合(bcrypt / apr1-md5・パスワードの自動生成・Apache / nginx の設定スニペット)・OpenAPI/Swagger仕様書から日本語のMarkdownドキュメントとTypeScript型定義の生成(OpenAPI 3.x / Swagger 2.0・YAML/JSON・$ref/allOf/oneOf 対応・エンドポイントごとの引数/レスポンス型・外部 $ref は読みに行かない)・FAQ構造化データ(FAQPage の JSON-LD・Markdown・details/summary の HTML を同時生成・回答のリンク/箇条書きを HTML 化・「Q: / A:」形式の一括貼り付けの解析)・テキストの行操作(重複行の削除・数値を認識する並べ替え・シード付きシャッフル・行番号・空行除去・前後トリム・接頭辞/接尾辞)・印刷サイズとDPIの計算(用紙×解像度×塗り足しから必要なピクセル数・手持ちの画像の実効dpiと判定・早見表・mm/inch/px/pt/級の換算)・SERPのメタタグ文字数チェック(title / description が検索結果に収まるかをピクセル幅で判定・切り詰め位置と表示行・パンくず表示・https や階層の指摘)・Flexbox / CSS GridのCSS生成(既定値を省いた宣言・repeat()への畳み込み・grid-template-areasの検証・効かない組み合わせの指摘・定番プリセット)・社内文書の点検(Notion・Confluence などから書き出した Markdown/HTML の重複ページ・孤立ページ・表記ゆれや旧称・リンク切れの検出と修正案))をMCPツールとして提供するサーバー。あわせて apps.first-ch.com のWebアプリ34本(GEO・メタタグ・セキュリティヘッダー・SSL・DNS・リダイレクト・リンク切れ・構造化データ・AIクローラー許可・和文可読性・ビジネス文面チェック等)の JSON API を呼ぶ app_* ツールも提供する(こちらは入力を apps.first-ch.com へ送るため既定では無効・FIRSTCH_ENABLE_APPS=1 で有効)",
3
+ "version": "0.41.0",
4
+ "description": "First CH Tools の計算ロジック(WCAGコントラスト比・文字数/Xウェイト・WebP変換・JSON-LD生成・llms.txt生成・文字コード/改行コード変換・Marp Markdown→スライド レンダリング・テストデータ生成・テキスト/コード差分・Cron式の解説・Base64/Data URI変換・URLパラメータの分解/再構築・HTML特殊文字のエスケープ/エンティティのデコード・JSON⇄YAMLの相互変換・px⇄rem/emの単位換算とCSSの一括変換・カラーコードの相互変換とアルファ透過の合成・MD5/SHA-1/SHA-256/SHA-384/SHA-512のハッシュ生成と照合・JWTのデコードと有効期限/署名の検証・User-Agent文字列の解析とデバイス判定・UUID v4/ULIDの一括生成・アスペクト比の計算とレスポンシブサイズの算出・TSV/CSVからMarkdownテーブルへの整形と相互変換・SQLクエリの整形と予約語の大文字化・URL/テキストからのQRコード生成・UNIXタイムスタンプと日時表記の相互変換・robots.txtの生成(AIクローラーの許可プリセット付き)・文字列のケース変換(camelCase/snake_case/kebab-case など11形式)・CSV/TSVとJSON配列の相互変換(区切りの自動判定・a.b 列と入れ子の相互展開)・全角⇄半角の変換とテキストの掃除(文字種ごとの向き指定・半角カナの合成/分解・空白と空行の整理)・IPアドレス/CIDRの計算(ネットワーク・ブロードキャスト・ホスト範囲とホスト数・IPv4/IPv6・サブネット分割・包含判定・IP範囲→最小CIDR集合の逆算)・日数/営業日の計算(2日付間の日数と営業日数・起点日+N日/N営業日の期日・締め日と支払サイトからの支払日・土日と日本の祝日を内蔵)・HTML→Markdownの変換(見出し/リスト/表/リンク/画像/コード・script/styleや装飾タグの除去・本文だけの抽出・相対URLの絶対化)・和暦⇄西暦の変換(令和〜明治・自動判定・曜日と干支・存在しない和暦の指摘・満年齢と入学/卒業の年・元号一覧と早見表)・日本語タイトルからのURLスラッグ生成(かな→ヘボン式ローマ字・記号除去・ハイフン/アンダースコア連結・小文字化・長音の省略/表記)・Basic認証用 htpasswd の生成と照合(bcrypt / apr1-md5・パスワードの自動生成・Apache / nginx の設定スニペット)・OpenAPI/Swagger仕様書から日本語のMarkdownドキュメントとTypeScript型定義の生成(OpenAPI 3.x / Swagger 2.0・YAML/JSON・$ref/allOf/oneOf 対応・エンドポイントごとの引数/レスポンス型・外部 $ref は読みに行かない)・FAQ構造化データ(FAQPage の JSON-LD・Markdown・details/summary の HTML を同時生成・回答のリンク/箇条書きを HTML 化・「Q: / A:」形式の一括貼り付けの解析)・テキストの行操作(重複行の削除・数値を認識する並べ替え・シード付きシャッフル・行番号・空行除去・前後トリム・接頭辞/接尾辞)・印刷サイズとDPIの計算(用紙×解像度×塗り足しから必要なピクセル数・手持ちの画像の実効dpiと判定・早見表・mm/inch/px/pt/級の換算)・SERPのメタタグ文字数チェック(title / description が検索結果に収まるかをピクセル幅で判定・切り詰め位置と表示行・パンくず表示・https や階層の指摘)・Flexbox / CSS GridのCSS生成(既定値を省いた宣言・repeat()への畳み込み・grid-template-areasの検証・効かない組み合わせの指摘・定番プリセット)・社内文書の点検(Notion・Confluence などから書き出した Markdown/HTML の重複ページ・孤立ページ・表記ゆれや旧称・リンク切れの検出と修正案)・記入欄に収める字の大きさと改行位置(中袋〔ご祝儀袋・香典袋〕の住所欄などの幅・高さmmから1字の大きさ・行数・改行位置・縦書きの漢数字・金額の大字))をMCPツールとして提供するサーバー。あわせて apps.first-ch.com のWebアプリ35本(GEO・メタタグ・セキュリティヘッダー・SSL・DNS・リダイレクト・リンク切れ・構造化データ・AIクローラー許可・和文可読性・ビジネス文面チェック等)の JSON API を呼ぶ app_* ツールも提供する(こちらは入力を apps.first-ch.com へ送るため既定では無効・FIRSTCH_ENABLE_APPS=1 で有効)",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "firstch-tools-mcp": "server.mjs"
@@ -22,6 +22,10 @@
22
22
  "mcpName": "io.github.First-CH/tools-mcp",
23
23
  "keywords": [
24
24
  "mcp",
25
+ "text-fit",
26
+ "japanese-address",
27
+ "kanji-numerals",
28
+ "daiji",
25
29
  "model-context-protocol",
26
30
  "webp",
27
31
  "wcag",
package/server.mjs CHANGED
@@ -46,6 +46,7 @@ import { dpiCalcTool } from './dpi.mjs';
46
46
  import { serpCheckTool } from './serp.mjs';
47
47
  import { cssLayoutGenerateTool } from './css-layout.mjs';
48
48
  import { wikiDocLintTool } from './wiki-doc-lint.mjs';
49
+ import { fitToBoxTool } from './fit-to-box.mjs';
49
50
 
50
51
  const { version } = createRequire(import.meta.url)('./package.json');
51
52
  // SDK v2 の serveStdio は接続ごとに factory から McpServer を1つ作る(旧仕様の initialize と
@@ -1963,4 +1964,41 @@ registerTool(
1963
1964
  },
1964
1965
  );
1965
1966
 
1967
+ registerTool(
1968
+ 'fit_to_box',
1969
+ {
1970
+ title: '記入欄に収める字の大きさと改行位置',
1971
+ description:
1972
+ '印刷済みの記入欄(市販の中袋〔ご祝儀袋・香典袋〕の「住所」「金額」「氏名」の欄など)に手で書くとき、欄の幅・高さ(mm)と向きから、' +
1973
+ '文字列が収まる1字の大きさ(mm・0.1mm 単位で切り捨て)・行数・改行した後の各行を返す(tools.first-ch.com/nakabukuro-ran/ と同一ロジック)。' +
1974
+ '字の大きさは、欄の線から内側へ1.5mmずつ余白を取り、行間を字の大きさの0.3倍として、行の長さと行数の両方から決める' +
1975
+ '(横書きでは半角英数を全角の0.6字分で数える。上限は住所9mm・金額と氏名14mm・plain 12mm)。' +
1976
+ '`kind="address"`(既定)は住所を「〜番地」と「建物名・部屋番号」の境目で改行し、そこで4mmに届かないときだけ都道府県・市区町村の後や番地の前でも区切る' +
1977
+ '(「12番地の18」「1203号室」など数字の並びの途中では切らない・text に改行を入れるとそこを建物名の前として扱う・最大4行)。' +
1978
+ 'postalCode を渡すと「〒」付きの1行を先頭に足す。縦書きの欄では番地の数字を漢数字(numerals: "digits"=一〇型 / "tens"=十型)にする。' +
1979
+ '1字が4mmを下回るときは alternatives に「都道府県を省いた場合」と「建物名を2行にした場合」の大きさと行を返す(省いてよいかは判断しない)。' +
1980
+ 'asIs は改行せずに1字5mmで書いたときに欄の外へはみ出す字数。' +
1981
+ '`kind="amount"` は金額(30000・3万・30,000円)を大字(壱・弐・参・四・伍・六・七・八・九・拾・百・阡・萬)の「金参萬円」にして欄に合わせる(1〜99,999,999円・圓/也/「金」「円」が印刷済みに対応)。' +
1982
+ '`kind="name"` は氏名(空白でだけ改行)、`kind="plain"` は任意の文字列。完全ローカル処理・ネットワーク送信なし。',
1983
+ inputSchema: {
1984
+ text: z.string().describe('欄に書く文字列(住所・金額・氏名など)'),
1985
+ width: z.number().describe('欄の幅(mm・線の内側を定規で測った値)'),
1986
+ height: z.number().describe('欄の高さ(mm)'),
1987
+ orientation: z.enum(['vertical', 'horizontal']).optional().describe("書く向き(既定 'vertical'=縦書き)"),
1988
+ kind: z.enum(['address', 'name', 'amount', 'plain']).optional().describe("文字列の種類(既定 'address')"),
1989
+ postalCode: z.string().optional().describe('kind=address で欄の先頭に書く郵便番号(例: 100-0001)'),
1990
+ numerals: z.enum(['digits', 'tens']).optional().describe("縦書きの漢数字の書き方('digits'=一〇・一二〔既定〕/ 'tens'=十・十二)"),
1991
+ thousandChar: z.enum(['阡', '千', '仟']).optional().describe("kind=amount の千の字(既定 '阡')"),
1992
+ yenChar: z.enum(['円', '圓']).optional().describe("kind=amount の円の字(既定 '円')"),
1993
+ nari: z.boolean().optional().describe('kind=amount で末尾に「也」を付ける(既定 false)'),
1994
+ kinEnPrinted: z.boolean().optional().describe('kind=amount で欄に「金」「円」が印刷済み(返す文字列から除く・既定 false)'),
1995
+ lang: z.enum(['ja', 'en']).optional().describe("エラー・注記の言語(既定 'ja')"),
1996
+ },
1997
+ },
1998
+ async (opts) => {
1999
+ await logUsage('fit_to_box');
2000
+ return asText(fitToBoxTool(opts));
2001
+ },
2002
+ );
2003
+
1966
2004
  serveStdio(buildServer);