@first-ch/tools-mcp 0.4.0 → 0.4.1

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
@@ -1,30 +1,31 @@
1
1
  # @first-ch/tools-mcp
2
2
 
3
- MCP server exposing First CH Tools' free web-tool logic (WCAG contrast, JP character/X-weight counting, WebP conversion, JSON-LD, and llms.txt generation) to AI agents such as Claude Code.
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, and llms.txt generation — to AI agents such as Claude Code.
4
4
 
5
5
  日本語版は [後半セクション](#日本語) を参照してください。
6
6
 
7
- ## Tools
8
-
9
- | Tool | What it does | Main input |
10
- | --- | --- | --- |
11
- | `contrast_check` | Computes the WCAG 2.1 contrast ratio between a foreground and background color and returns AA/AAA pass/fail (normal text, large text, UI components) | `fg`, `bg` (hex, e.g. `#333333` / `333` / `fff`) |
12
- | `count_chars` | Counts Japanese text by grapheme, breaks it down into zenkaku/hankaku, counts lines, and computes the X (Twitter) post weight (zenkaku=2, hankaku=1, URL=23 flat, limit 280) | `text` |
13
- | `webp_convert` | Converts PNG/JPEG files to WebP using the same libwebp WASM encoder (default quality 80) as the browser tool at tools.first-ch.com/webp/ | `paths[]` (absolute paths), `quality?` (1-100), `outputDir?` |
14
- | `jsonld_generate` | Generates schema.org JSON-LD for `organization` / `faqpage` / `service` / `breadcrumb`. Empty fields are omitted automatically | `type`, plus the matching `organization` / `faq` / `service` / `breadcrumb` object |
15
- | `llmstxt_generate` | Generates an `llms.txt` file (per the llmstxt.org proposed format) summarizing a site for AI crawlers/agents | `siteName`, `summary?`, `notes?`, `sections?` |
7
+ ## Install
16
8
 
17
- See [`server.mjs`](./server.mjs) for the exact Zod input schemas.
9
+ Three ways to add this server, pick whichever fits your client.
18
10
 
19
- ## Install
11
+ **Requires Node.js `>=18.14.1`** (all three methods below run the server via `npx`, so Node must be installed even when the MCP client itself — e.g. Claude Code's native, no-Node install — doesn't strictly require it).
20
12
 
21
- With Claude Code:
13
+ ### 1. npm, via the Claude Code CLI
22
14
 
23
15
  ```bash
24
16
  claude mcp add firstch-tools -- npx -y @first-ch/tools-mcp
25
17
  ```
26
18
 
27
- With any other MCP client, add to its server config (e.g. `mcp.json` / `claude_desktop_config.json`):
19
+ ### 2. Claude Code plugin (also installs the same MCP server)
20
+
21
+ ```
22
+ /plugin marketplace add First-CH/firstch-tools-mcp
23
+ /plugin install firstch-tools@first-ch
24
+ ```
25
+
26
+ ### 3. Any other MCP client (generic JSON config)
27
+
28
+ Add to your client's server config (e.g. `mcp.json` / `claude_desktop_config.json`):
28
29
 
29
30
  ```json
30
31
  {
@@ -37,7 +38,19 @@ With any other MCP client, add to its server config (e.g. `mcp.json` / `claude_d
37
38
  }
38
39
  ```
39
40
 
40
- Requires Node.js `>=18.14.1`.
41
+ This server is also registered in the [MCP Registry](https://registry.modelcontextprotocol.io) as `io.github.First-CH/tools-mcp` (see [`server.json`](./server.json)), so registry-aware clients can discover and install it by that name too.
42
+
43
+ ## Tools
44
+
45
+ | Tool | What it does | Main input |
46
+ | --- | --- | --- |
47
+ | `contrast_check` | Computes the WCAG 2.1 contrast ratio between a foreground and background color and returns AA/AAA pass/fail (normal text, large text, UI components) | `fg`, `bg` (hex, e.g. `#333333` / `333` / `fff`) |
48
+ | `count_chars` | Counts Japanese text by grapheme, breaks it down into zenkaku/hankaku, counts lines, and computes the X (Twitter) post weight (zenkaku=2, hankaku=1, URL=23 flat, limit 280) | `text` |
49
+ | `webp_convert` | Converts PNG/JPEG files (absolute paths) to WebP using the same libwebp WASM encoder (default quality 80) as the browser tool at tools.first-ch.com/webp/. Output defaults to the same directory as each input with a `.webp` extension | `paths[]` (absolute paths), `quality?` (1-100), `outputDir?` |
50
+ | `jsonld_generate` | Generates schema.org JSON-LD for `organization` / `faqpage` / `service` / `breadcrumb`. Empty fields are omitted automatically. Returns both a `json` object and a ready-to-embed `<script>` snippet | `type`, plus the matching `organization` / `faq` / `service` / `breadcrumb` object |
51
+ | `llmstxt_generate` | Generates an `llms.txt` file (per the llmstxt.org proposed format) summarizing a site for AI crawlers/agents | `siteName`, `summary?`, `notes?`, `sections?` |
52
+
53
+ See [`server.mjs`](./server.mjs) for the exact Zod input schemas.
41
54
 
42
55
  ## Telemetry
43
56
 
@@ -47,6 +60,10 @@ Nothing is logged by default. Usage is recorded **only** when you set the `FIRST
47
60
 
48
61
  The same algorithms are also available as a free, no-install browser tool at **[tools.first-ch.com](https://tools.first-ch.com)** — useful when you want a UI instead of an MCP call, or want to hand a link to someone without an MCP client.
49
62
 
63
+ ## Vendor sync (WebP codec)
64
+
65
+ `webp_convert` bundles a vendored, unmodified subset of [`@jsquash/webp`](https://github.com/jamsinclair/jSquash) v1.5.0 under [`vendor/jsquash-webp/`](./vendor/jsquash-webp/). The web version at tools.first-ch.com vendors the exact same v1.5.0 subset, so both surfaces produce identical output. Each side's CI independently verifies its vendored files against [`vendor/jsquash-webp/CHECKSUMS.sha256`](./vendor/jsquash-webp/CHECKSUMS.sha256) (see [`.github/workflows/ci.yml`](./.github/workflows/ci.yml)), so a silent, unnoticed drift between the two copies isn't possible.
66
+
50
67
  ## License
51
68
 
52
69
  The package itself is licensed under [MIT](./LICENSE).
@@ -58,33 +75,44 @@ It bundles a subset of [jSquash](https://github.com/jamsinclair/jSquash)'s WebP
58
75
 
59
76
  Both license files are included verbatim in the published npm package, as required by their respective terms (BSD-3-Clause in particular requires the copyright notice, condition list, and disclaimer to be reproduced in binary redistributions).
60
77
 
61
- ---
78
+ ## Development
62
79
 
63
- ## 日本語
80
+ ```bash
81
+ npm ci
82
+ npm test # unit tests (lib.mjs / webp.mjs), see test.mjs
83
+ node e2e.mjs # stdio smoke test: spawns server.mjs, lists tools, calls a couple of handlers
84
+ ```
64
85
 
65
- `@first-ch/tools-mcp` は、First CH Tools(無料Webツール集)の計算ロジック — WCAGコントラスト比・日本語文字数/Xウェイト計測・WebP変換・JSON-LD生成・llms.txt生成 — をAIエージェント(Claude Code等)向けMCPツールとして提供するサーバーです。
86
+ CI runs both across Node 18.14.1 / 20 / 22, plus a vendor checksum check and a published-tarball content check — see [`.github/workflows/ci.yml`](./.github/workflows/ci.yml).
66
87
 
67
- ### ツール一覧
88
+ ---
68
89
 
69
- | ツール | 何をするか | 主な入力 |
70
- | --- | --- | --- |
71
- | `contrast_check` | 文字色と背景色のWCAG 2.1コントラスト比を計算し、AA/AAA基準(通常テキスト・大テキスト・UI部品)の合否を返す | `fg`・`bg`(hex。例: `#333333` / `333` / `fff`) |
72
- | `count_chars` | 日本語テキストを書記素単位で数え、全角/半角内訳・行数・X(Twitter)投稿ウェイト(全角=2・半角=1・URL=一律23・上限280)を返す | `text` |
73
- | `webp_convert` | PNG/JPEG画像をWebPへ変換する。tools.first-ch.com/webp/ と同一のlibwebp WASMエンコーダ(品質既定80) | `paths[]`(絶対パス)・`quality?`(1-100)・`outputDir?` |
74
- | `jsonld_generate` | schema.org準拠のJSON-LDを生成する(`organization` / `faqpage` / `service` / `breadcrumb`)。空項目は自動で省略 | `type` と対応する `organization` / `faq` / `service` / `breadcrumb` オブジェクト |
75
- | `llmstxt_generate` | AI検索・生成AI向けにサイト概要を伝える `llms.txt`(llmstxt.org提案フォーマット準拠)を生成する | `siteName`・`summary?`・`notes?`・`sections?` |
90
+ ## 日本語
76
91
 
77
- 正確な入力スキーマ(Zod定義)は [`server.mjs`](./server.mjs) を参照してください。
92
+ `@first-ch/tools-mcp` は、[First CH Tools](https://tools.first-ch.com)(無料Webツール集)の計算ロジック — WCAGコントラスト比・日本語文字数/Xウェイト計測・WebP変換・JSON-LD生成・llms.txt生成 — をAIエージェント(Claude Code等)向けMCPツールとして提供するサーバーです。
78
93
 
79
94
  ### インストール
80
95
 
81
- Claude Codeの場合:
96
+ 導入経路は3通りあります。使っているクライアントに合わせて選んでください。
97
+
98
+ **Node.js `>=18.14.1` が必要です**(以下いずれの方法も `npx` 経由でサーバーを起動するため。Claude Code本体はNode不要のnativeインストールもありますが、その場合でもNodeは別途必要です)。
99
+
100
+ #### 1. npm(Claude Code CLI)
82
101
 
83
102
  ```bash
84
103
  claude mcp add firstch-tools -- npx -y @first-ch/tools-mcp
85
104
  ```
86
105
 
87
- 他のMCPクライアントの場合は設定ファイル(`mcp.json` / `claude_desktop_config.json` 等)に以下を追加します。
106
+ #### 2. Claude Code plugin(同じMCPサーバーを導入)
107
+
108
+ ```
109
+ /plugin marketplace add First-CH/firstch-tools-mcp
110
+ /plugin install firstch-tools@first-ch
111
+ ```
112
+
113
+ #### 3. その他のMCPクライアント(汎用JSON設定)
114
+
115
+ 設定ファイル(`mcp.json` / `claude_desktop_config.json` 等)に以下を追加します。
88
116
 
89
117
  ```json
90
118
  {
@@ -97,7 +125,19 @@ claude mcp add firstch-tools -- npx -y @first-ch/tools-mcp
97
125
  }
98
126
  ```
99
127
 
100
- Node.js `>=18.14.1` が必要です。
128
+ 本サーバーは [MCP Registry](https://registry.modelcontextprotocol.io) にも `io.github.First-CH/tools-mcp` として登録済みです([`server.json`](./server.json) 参照)。レジストリ対応クライアントはこの名前からも発見・導入できます。
129
+
130
+ ### ツール一覧
131
+
132
+ | ツール | 何をするか | 主な入力 |
133
+ | --- | --- | --- |
134
+ | `contrast_check` | 文字色と背景色のWCAG 2.1コントラスト比を計算し、AA/AAA基準(通常テキスト・大テキスト・UI部品)の合否を返す | `fg`・`bg`(hex。例: `#333333` / `333` / `fff`) |
135
+ | `count_chars` | 日本語テキストを書記素単位で数え、全角/半角内訳・行数・X(Twitter)投稿ウェイト(全角=2・半角=1・URL=一律23・上限280)を返す | `text` |
136
+ | `webp_convert` | PNG/JPEG画像(絶対パス)をWebPへ変換する。tools.first-ch.com/webp/ と同一のlibwebp WASMエンコーダ(品質既定80)。出力先省略時は各入力と同じ場所に拡張子`.webp`で保存 | `paths[]`(絶対パス)・`quality?`(1-100)・`outputDir?` |
137
+ | `jsonld_generate` | schema.org準拠のJSON-LDを生成する(`organization` / `faqpage` / `service` / `breadcrumb`)。空項目は自動で省略。`json`オブジェクトと埋め込み用`<script>`スニペットの両方を返す | `type` と対応する `organization` / `faq` / `service` / `breadcrumb` オブジェクト |
138
+ | `llmstxt_generate` | AI検索・生成AI向けにサイト概要を伝える `llms.txt`(llmstxt.org提案フォーマット準拠)を生成する | `siteName`・`summary?`・`notes?`・`sections?` |
139
+
140
+ 正確な入力スキーマ(Zod定義)は [`server.mjs`](./server.mjs) を参照してください。
101
141
 
102
142
  ### 計測(Telemetry)について
103
143
 
@@ -107,6 +147,10 @@ Node.js `>=18.14.1` が必要です。
107
147
 
108
148
  同一アルゴリズムを、インストール不要の無料ブラウザツールとしても公開しています: **[tools.first-ch.com](https://tools.first-ch.com)**。UIで使いたいとき・MCPクライアントを持たない相手にリンクを共有したいときはこちらをどうぞ。
109
149
 
150
+ ### vendor同期(WebPコーデック)
151
+
152
+ `webp_convert` は [`@jsquash/webp`](https://github.com/jamsinclair/jSquash) v1.5.0 の無改変サブセットを [`vendor/jsquash-webp/`](./vendor/jsquash-webp/) 配下に同梱しています。Web版(tools.first-ch.com)も同じv1.5.0サブセットを無改変で使っており、双方が同一の出力を返します。各リポジトリのCIが独立に、自身のvendorファイルを [`vendor/jsquash-webp/CHECKSUMS.sha256`](./vendor/jsquash-webp/CHECKSUMS.sha256) に対して検証するため([`.github/workflows/ci.yml`](./.github/workflows/ci.yml) 参照)、両者が気づかないうちに乖離することはありません。
153
+
110
154
  ### ライセンス
111
155
 
112
156
  本パッケージ自体は [MIT](./LICENSE) です。
@@ -117,3 +161,13 @@ Node.js `>=18.14.1` が必要です。
117
161
  - 内部で使われるlibwebpコーデック本体(WASMバイナリとそのJSグルーコード)は **BSD-3-Clause, Copyright (c) 2010 Google Inc.** — [`vendor/jsquash-webp/codec/LICENSE.codec.md`](./vendor/jsquash-webp/codec/LICENSE.codec.md) を参照
118
162
 
119
163
  いずれのライセンスファイルも公開npmパッケージに原文のまま同梱しています(BSD-3-Clauseはバイナリ再配布時にも著作権表示・条件・免責事項の再掲を求めるため)。
164
+
165
+ ### 開発者向け
166
+
167
+ ```bash
168
+ npm ci
169
+ npm test # ユニットテスト(lib.mjs / webp.mjs)。詳細は test.mjs
170
+ node e2e.mjs # stdio smokeテスト: server.mjsを子プロセス起動しツール一覧取得・実行を検証
171
+ ```
172
+
173
+ CIはNode 18.14.1 / 20 / 22 の3系統に加え、vendorチェックサム検証・公開tarball内容検査を実行します([`.github/workflows/ci.yml`](./.github/workflows/ci.yml) 参照)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@first-ch/tools-mcp",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "First CH Tools の計算ロジック(WCAGコントラスト比・文字数/Xウェイト・WebP変換・JSON-LD生成・llms.txt生成)をMCPツールとして提供するサーバー",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,11 +33,10 @@
33
33
  "homepage": "https://tools.first-ch.com",
34
34
  "repository": {
35
35
  "type": "git",
36
- "url": "git+https://github.com/First-CH/FirstCHTools.git",
37
- "directory": "packages/mcp"
36
+ "url": "git+https://github.com/First-CH/firstch-tools-mcp.git"
38
37
  },
39
38
  "bugs": {
40
- "url": "https://github.com/First-CH/FirstCHTools/issues"
39
+ "url": "https://github.com/First-CH/firstch-tools-mcp/issues"
41
40
  },
42
41
  "engines": {
43
42
  "node": ">=18.14.1"
@@ -0,0 +1,10 @@
1
+ # @jsquash/webp v1.5.0 のサブセット(無改変)。
2
+ # site 側(FirstCHTools/site/vendor/jsquash-webp)も同じ v1.5.0 を無改変で使う。
3
+ # 双方がこの定数と一致することを各リポジトリのCIが独立に検証する。
4
+
5
+ e71535eeee820d68b68ece7c8af761c39f3ddec93d3d957d2f83b19191339e0d utils.js
6
+ 3d70163a00e6264fc5a8fa7c8f3b1fa21a50a00d910f4d2de3ef1bbd2fdc98ab meta.js
7
+ 3038e60ebba6252baba08c691e31d1efe5036a185435daa7b4afaef3cc9273f9 codec/enc/webp_enc_simd.js
8
+ 39c279269ec1163b987b6d69749458e3d5b03b9585f58b6ca5455b76b504a305 codec/enc/webp_enc_simd.wasm
9
+ 8c3690b09c168f196446cf5904332023bbc15eb92b6a7cee470ac829e6a65d20 LICENSE
10
+ e293d1dddc9785200b1f58a4f5293543cf8566d9e0b8a3c02fad955035b19f42 codec/LICENSE.codec.md