0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Claude Desktop で Utsuho の半角・全角変換及び平仮名・片仮名変換機能を利用する。

0
Posted at

Claude Desktop で Utsuho の半角・全角変換および平仮名・片仮名変換機能を利用する手順を説明します。

Utsuho は MCP I/F(stdio)を提供しているため、Claude Desktop から「カスタムコネクタ」として利用できます。
簡単に導入できるため、MCP を試す最初の例としても適しています。

Utsuho の紹介

Utsuho (うつほ) は、日本語テキストの表記揺れを決定的な変換ルールで正規化する Python ライブラリです。

半角・全角の変換や、ひらがな・カタカナの変換といった文字単位の正規化に特化しており、汎用的な Unicode 正規化で起こり得る不要な文字変換を避けられます。

Utsuho MCP のインストール

Python の仮想環境を作成し、その中に utsuho-mcp をインストールします。

仮想環境を作成します。

python -m venv .venv

作成した仮想環境を有効化します。

macOS の場合:

source .venv/bin/activate

Windows の場合:

.venv\Scripts\activate

有効化した仮想環境に Utsuho を MCP 拡張付きでインストールします。

pip install "utsuho[mcp]"

Claude Desktop への登録

Claude Desktop のカスタムコネクタとして、Utsuho MCP を登録します。

尚、ローカル MCP は、手動で Claude Desktop の設定ファイルに追加する必要があります。

Claude Desktop の設定ファイル claude_desktop_config.json は、以下のパスに配置されています。

OS パス
macOS ~/Library/Application Support/Claude/claude_desktop_config.json
Windows %APPDATA%\Claude\claude_desktop_config.json

任意のテキストエディタで claude_desktop_config.json を開き、mcpServers に設定を追加します。

command には、仮想環境内にインストールされた utsuho-mcp 実行スクリプトを絶対パスで指定します。
環境ごとにパスが異なるため、以下のプレースホルダを参考にご自身の環境に合わせて置き換えてください。

  • Windows の場合:<仮想環境の絶対パス>\.venv\Scripts\utsuho-mcp.exe
  • macOS の場合:<仮想環境の絶対パス>/.venv/bin/utsuho-mcp
{
  "mcpServers": {
    "utsuho-mcp": {
      "command": "<utsuho-mcp の絶対パス>",
      "args": [],
      "env": {}
    }
  }
}

設定反映のため、Claude Desktop を起動中の場合は再起動します。

動作確認

Claude Desktop から Utsuho MCP を実際に利用し、動作を確認します。

注意:
初回実行時は、ツールの実行許可が必要です。
Claude Desktop の画面サブにある「カスタマイズ」から「コネクタ」を開き、utsuho-mcp の各ツールを有効化してください。

任意のチャットで以下のプロンプトを入力します。

utsuho-mcp を利用できるか確認してください。

実行結果の例:

MCPサーバーが読み込まれているかテストしてみます!

✅ 正常に動作しています!

`utsuho-mcp` が認識され、以下の4つのツールが利用可能な状態です:

| ツール                 | 機能                |
| ---------------------- | ------------------- |
| `hiragana_to_katakana` | ひらがな → カタカナ |
| `katakana_to_hiragana` | カタカナ → ひらがな |
| `half_to_full`         | 半角 → 全角         |
| `full_to_half`         | 全角 → 半角         |

テストとして「せつぞくかくにん」→「セツゾクカクニン」の変換も成功しました。準備完了です!
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?