chakoshi MCP Server
A bridge server connecting Claude Desktop with the chakoshi moderation API for content safety.
chakoshi MCP Server
MCPクライアントアプリケーションと、chakoshi API を連携するMCP (Model Context Protocol) サーバーです。
Claude Desktop などからchakoshiを利用して日本語テキストのモデレーション(有害性チェック)を実行できます。
chakoshiとは
chakoshiとは、NTT ドコモビジネスが提供するLLM向けのガードレールです。詳細は以下をご覧ください。
リポジトリに含まれるツール
本リポジトリの構成
chakoshi-mcp-server/
├── main.py # エントリポイント
├── chakoshi_server/
│ ├── __init__.py
│ ├── config.py # 環境変数の管理
│ └── server.py # MCP サーバーの実装部分
├── pyproject.toml # プロジェクト設定
└── .env # 環境変数(要作成)
moderate_text
テキストコンテンツの有害性をチェックするツールです。
入力パラメータ:
text(string, 必須): チェックしたいテキスト
出力:
- chakoshi API からのモデレーション結果をJSON形式で返します
使用プロンプト例:
chakoshi を使ってこのテキストをチェックしてください: "問題のあるコンテンツの例"
chakoshi API の設定
API キーの取得
-
chakoshiのプレイグラウンドにアクセスし、画面に従って新規登録フローを進めてください。
-
新規登録、およびログイン完了後、プレイグラウンドの設定をクリックします。
-
その後、設定画面からAPIキーを新規に発行します。
カテゴリセットの設定
-
プレイグラウンドにアクセスし、「新しいカスタム検知項目の追加」をクリックし、検知項目名とカスタム検知項目の定義を入力します。
-
別名で保存を選択し、新しくカスタム検知項目セットを保存します。
-
保存後、「選択中の検知項目セットIDをコピー」の項目からカテゴリセットIDをコピーします。
必要要件
-
Python 3.10 以上
-
chakoshi のユーザ登録、および、APIキー
-
MCPクライアントアプリケーション (Claude Desktopなど)
インストール
1. リポジトリのクローン
git clone https://github.com/nttcom/chakoshi-mcp-server.git
cd chakoshi-mcp-server
2. 依存関係のインストール
# uvのインストール
curl -LsSfhttps://astral.sh/uv/install.sh | sh
# PATHの設定
source $HOME/.local/bin/env
# uv を使用する場合(推奨)
uv sync
# pip を使用する場合
pip install -e .
3. 環境変数の設定
.env ファイルを作成し、以下の環境変数を設定してください:
CHAKOSHI_API_KEY=your_chakoshi_api_key
CHAKOSHI_API_URL=https://api.beta.chakoshi.ntt.com/v1/judge/text
CHAKOSHI_MODEL_ID=chakoshi-moderation-241223
CHAKOSHI_CATEGORY_SET_ID=your_category_set_id
CHAKOSHI_TIMEOUT_SEC=5
注意: 実際の APIキーとカテゴリセットID はchakoshiプレイグラウンドの管理画面から取得してください。
使用方法
サーバの起動
uv run main.py
Claude Desktop との連携
Claude Desktop の設定ファイル(claude_desktop_config.json)に以下を追加:
{
"mcpServers": {
"command": "/PATH_to_uv/uv",
"args": [
"--directory",
"/PATH_to_chakoshi/chakoshi-mcp-server",
"run",
"main.py"
],
"env": {
"CHAKOSHI_API_KEY": "YOUR_CHAKOSHI_API_KEY"
}
}
}
その後、Claude Desktop 内で以下のように使用できます:
chakoshiを使ってこのテキストをチェックしてください:「問題のあるコンテンツの例」
Claude が自動的に moderate_text ツールを使用してモデレーション結果を返します。
API レスポンス例
{
"category1": {
"score": 0.05,
"threshold": 0.5,
"result": "safe"
},
"category2": {
"score": 0.02,
"threshold": 0.3,
"result": "safe"
}
}
注意事項
-
chakoshi API は現在ベータ版です。本番環境などでは使用しないでください。
-
APIキーは適切に管理し、決して公開しないでください。
-
APIキーのレート制限などについては公式ドキュメントを参照してください。
ライセンス
MIT
Related Servers
Resend Email
Send emails directly from your editor using the Resend API.
MCP LinkedIn
Interact with LinkedIn using an unofficial API, requiring email and password for authentication.
Postmark
An MCP server for sending emails via the Postmark service, configured through environment variables.
MCP IDE Bridge
An open-source messaging server for client-to-client communication using MCP HTTP Streamable messaging.
Coreflux MQTT MCP Server
Connects to a Coreflux MQTT broker, offering tools for Coreflux commands and integration with AI assistants.
Voice Mode
A server for natural voice conversations with AI assistants like Claude and ChatGPT.
rqbit
Interact with the rqbit torrent client API. Requires a running rqbit instance.
Bluesky
integrates with Bluesky API to query and search feeds and posts.
Outlook MCP Server
Read, search, and manage emails in Microsoft Outlook through a standardized interface.
Claude MCP Slack
A GitHub Action that functions as a Slack MCP server, enabling secure image downloads and integrations with Slack.