@first-ch/tools-mcp 0.38.0 → 0.40.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 +6 -2
- package/apps.mjs +23 -0
- package/package.json +6 -2
- package/server.mjs +38 -0
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
|
|
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).
|
|
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
|
|
|
@@ -124,6 +125,7 @@ Each `app_*` tool calls one app's public JSON API (`POST https://apps.first-ch.c
|
|
|
124
125
|
| `app_email_dns` | [Email DNS Checker](https://apps.first-ch.com/en/email-dns/) — Enter a domain and we look up MX, SPF, DKIM and DMARC. We follow every include: to count the SPF DNS lookups against the limit of ten, explain the DMARC policy, and check it all against Google's sender guidelines (2024). | `domain`, `selector?` |
|
|
125
126
|
| `app_domain_info` | [Domain Info & Expiry Checker](https://apps.first-ch.com/en/domain-info/) — Enter a domain and we query RDAP (the successor to WHOIS) for the registrar, creation date, expiry date, EPP statuses such as clientHold, and name servers. Days until expiry and renewal warnings come first. gTLD servers are resolved via the IANA bootstrap; TLDs without RDAP (including .jp) are reported as such. | `domain` |
|
|
126
127
|
| `app_domain_availability` | [Bulk Domain Availability Check](https://apps.first-ch.com/en/domain-availability/) — Enter one candidate name and we check .com, .net, .org, .jp, .co.jp, .dev, .io, .ai, .app and .co at once using RDAP and public DNS. Verdicts are three-way — registered, possibly free, inconclusive — and we never claim a name is definitely available (no affiliate links either). | `name` |
|
|
128
|
+
| `app_lookalike_domain` | [Lookalike Domain Checker](https://apps.first-ch.com/en/lookalike-domain/) — Compares a sender's address with up to 50 vendor domains you pass and flags lookalikes: romanization variants, swapped TLDs, one-letter changes and look-alike characters (including punycode). Returns where the letters differ, plus the sender domain's registration date (RDAP) and MX. Without `trusted` it only looks up the registration date and MX. **Sends the sender address and your vendor list to apps.first-ch.com** (nothing is stored). | `sender`, `trusted?` |
|
|
127
129
|
| `app_myip` | [IP & Request Info](https://apps.first-ch.com/en/myip/) — Shows the public IP, estimated country/city, network (ASN), HTTP/TLS details, User-Agent and main request headers of the request your machine sends to apps.first-ch.com. Handy for VPN checks. | — |
|
|
128
130
|
| `app_brand_fetch` | [Brand Fetch](https://apps.first-ch.com/en/brand-fetch/) — Enter a domain to extract the site's logo, favicons, main colours and company description. Colours are ranked by CSS frequency with contrast ratios on white and black — handy for placeholder branding in proposals and mock-ups. | `url` |
|
|
129
131
|
| `app_tone_check` | [Japanese Business Tone Check](https://apps.first-ch.com/en/tone-check/) — Paste a Japanese business email or proposal to flag phrases that may read as rude, vague, double keigo or too pushy, with drop-in rewrites and cultural pitfalls for English translation (AI-generated advice). **Rate-limited**: 5 calls per 10 minutes per IP, and 50 calls per day shared with `app_lp_persona_check`. | `text` |
|
|
@@ -186,7 +188,7 @@ Release rule: a push to `main` automatically publishes a new package version thr
|
|
|
186
188
|
|
|
187
189
|
`@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ツールとして提供するサーバーです。これらは全て端末内で処理します。
|
|
188
190
|
|
|
189
|
-
あわせて、[apps.first-ch.com](https://apps.first-ch.com) のWebアプリ
|
|
191
|
+
あわせて、[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 を返します(端末内で完結する他のツールとはここが違います)。詳しくは [通信・ファイル・プライバシー](#通信ファイルプライバシー) を参照してください。
|
|
190
192
|
|
|
191
193
|
### インストール
|
|
192
194
|
|
|
@@ -271,6 +273,7 @@ claude mcp add firstch-tools -- npx -y @first-ch/tools-mcp
|
|
|
271
273
|
| `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?` |
|
|
272
274
|
| `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?` |
|
|
273
275
|
| `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`) |
|
|
276
|
+
| `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?` |
|
|
274
277
|
|
|
275
278
|
#### apps のツール(`app_*`・apps.first-ch.com へ送信)
|
|
276
279
|
|
|
@@ -306,6 +309,7 @@ claude mcp add firstch-tools -- npx -y @first-ch/tools-mcp
|
|
|
306
309
|
| `app_email_dns` | [メール設定チェッカー](https://apps.first-ch.com/email-dns/) — ドメインの MX・SPF・DKIM・DMARC を引いて診断する。SPF は include: をたどって DNS ルックアップ10回の上限を実測し、DMARC のポリシーを解釈して Gmail 送信者ガイドライン(2024年〜)への適合も判定する。DKIM はセレクタが分からないと確認できないため、省略時は代表的なセレクタを当てる(見つからなくても DKIM が無いとは限らない)。 | `domain`, `selector?` |
|
|
307
310
|
| `app_domain_info` | [ドメイン情報・期限チェッカー](https://apps.first-ch.com/domain-info/) — ドメインを RDAP(WHOIS の後継)で引き、レジストラ・作成日・有効期限と残り日数・ステータス(clientHold 等)・ネームサーバーを返す。RDAP 非対応の TLD(.jp を含む)はその旨を返す。登録者・管理者の個人情報は読まない。 | `domain` |
|
|
308
311
|
| `app_domain_availability` | [ドメイン空き一括チェック](https://apps.first-ch.com/domain-availability/) — サービス名・屋号の候補1つについて、.com / .net / .org / .jp / .co.jp / .dev / .io / .ai / .app / .co の登録有無を RDAP と公開DNSでまとめて判定する。判定は「登録済み/未登録の可能性/判定不能」の3値で、空きは断定しない。 | `name` |
|
|
312
|
+
| `app_lookalike_domain` | [偽ドメイン見分け(取引先と照合)](https://apps.first-ch.com/lookalike-domain/) — 差出人のメールアドレスを取引先のドメイン(最大50件)と照合し、ローマ字の表記ゆれ・TLDの入れ替え・1文字違い・見た目の似た文字(punycode を含む)で似せた偽ドメインかを判定する。違う文字の位置と、差出人のドメインの登録日(RDAP)・MX も返す。`trusted` を省くと登録日と MX だけを返す。**差出人のアドレスと取引先の一覧を apps.first-ch.com へ送る**(保存はしない)。 | `sender`、`trusted?` |
|
|
309
313
|
| `app_myip` | [IP・リクエスト情報の確認](https://apps.first-ch.com/myip/) — この MCP サーバーが動いている端末から apps.first-ch.com へ届いたリクエストを見て、グローバルIP・推定国/都市・回線(ASN)・HTTP/TLS の方式・User-Agent・主要リクエストヘッダーを返す。VPN の切り替え確認などに使う。 | — |
|
|
310
314
|
| `app_brand_fetch` | [ブランド情報抽出](https://apps.first-ch.com/brand-fetch/) — サイトのロゴ・ファビコン・主要配色・会社説明を抽出して返す。配色は CSS の出現頻度順で、白地・黒地とのコントラスト比つき。画像は URL と寸法だけを返す。提案書やモックの仮ブランド作りに使う。 | `url` |
|
|
311
315
|
| `app_tone_check` | [ビジネス文面のニュアンスチェック](https://apps.first-ch.com/tone-check/) — 日本語のビジネスメール・提案文の失礼・曖昧・二重敬語・催促のきつさを「相手にどう受け取られるか」の観点で指摘し、言い換え候補を返す。英訳して送るときの文化的な誤解ポイントも添える。**回数制限あり**(同じIPから10分に5回・AIの2本合計で1日50回)。 | `text` |
|
package/apps.mjs
CHANGED
|
@@ -290,6 +290,29 @@ const DEFS = [
|
|
|
290
290
|
lang: LANG,
|
|
291
291
|
},
|
|
292
292
|
},
|
|
293
|
+
{
|
|
294
|
+
slug: 'lookalike-domain',
|
|
295
|
+
apiPath: '/lookalike-domain/api/check',
|
|
296
|
+
title: '偽ドメイン見分け(取引先と照合)',
|
|
297
|
+
summary:
|
|
298
|
+
'差出人のメールアドレス(またはドメイン)を、取引先のドメイン(最大50件)と照合し、ローマ字の表記ゆれ・TLDの入れ替え・1文字違い・見た目の似た文字(punycode を含む)などで似せた偽ドメインかを判定する。違う文字の位置(diff)と、差出人のドメインの登録日(RDAP)・MX も返す。trusted を省くと照合はせず、登録日と MX だけを返す。振込先の変更や請求書のメールの確認に。' +
|
|
299
|
+
'同じIPから10分に30回まで(超えると HTTP 429)。',
|
|
300
|
+
sends: '差出人のアドレスと、渡した取引先のドメイン一覧',
|
|
301
|
+
fetches: false,
|
|
302
|
+
inputSchema: {
|
|
303
|
+
sender: z
|
|
304
|
+
.string()
|
|
305
|
+
.min(1)
|
|
306
|
+
.max(320)
|
|
307
|
+
.describe('差出人のメールアドレスかドメイン(例: keiri@example.co.jp。「表示名 <addr>」の形でもよい)'),
|
|
308
|
+
trusted: z
|
|
309
|
+
.array(z.string().min(1).max(320))
|
|
310
|
+
.max(50)
|
|
311
|
+
.optional()
|
|
312
|
+
.describe('照合する取引先のドメイン(最大50件。例: ["example.co.jp"])。省くと登録日と MX だけを返す'),
|
|
313
|
+
lang: LANG,
|
|
314
|
+
},
|
|
315
|
+
},
|
|
293
316
|
{
|
|
294
317
|
slug: 'myip',
|
|
295
318
|
apiPath: '/myip/api/info',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@first-ch/tools-mcp",
|
|
3
|
-
"version": "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
|
|
3
|
+
"version": "0.40.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アプリ34本(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);
|