CopyTuner Client
Manage Rails i18n translations with CopyTuner. Search, update, and create translation keys.
CopyTunerClient::Mcp
Rails i18nの翻訳管理サービス「CopyTuner」のMCP(Model Context Protocol)サーバー実装です。AIアシスタントがRailsアプリケーションの多言語化対応を効率的に支援するためのツールセットを提供します。
概要
このgemは、CopyTunerプロジェクトの翻訳データにアクセスし、Rails i18nキーの検索、翻訳の管理、新しいキーの作成などをMCPプロトコル経由で実行できるサーバーを提供します。
機能
利用可能なツール
- search_key: Rails i18nキーの検索(
t()やI18n.t()で使用されるキーの検索に最適化) - search_translations: 翻訳内容による検索(特定のテキストを含む翻訳の検索)
- create_i18n_key: 新しいi18nキーの作成(複数言語対応、非同期処理)
- get_locales: プロジェクトで使用中のロケール一覧の取得
- get_edit_url: 登録済みキーの編集画面URLの生成
リソーステンプレート
copytuner://projects/{project_id}/translations/{locale}/{key}: 個別の翻訳リソースへのアクセス
インストール
Gemfileに以下を追加:
group :development do
gem 'copy_tuner_client-mcp', github: 'SonicGarden/copy_tuner_client-mcp', require: false
end
そして実行:
bundle install
使用方法
1. CopyTunerClientの設定
まず、Railsアプリケーションでcopy_tuner_clientが適切に設定されている必要があります:
# config/initializers/copy_tuner_client.rb
CopyTunerClient.configure do |config|
config.api_key = "your-api-key"
config.project_id = "your-project-id"
config.locales = ["ja", "en"]
end
2. AIアシスタントでの設定と利用
MCPプロトコルに対応したAIアシスタント(Claude Code、VSCode Copilot等)で、以下の設定ファイルを配置するとMCPサーバーが自動的に起動され、翻訳管理機能が利用可能になります。
Claude Code
プロジェクトのルートディレクトリに .mcp.json ファイルを作成:
{
"mcpServers": {
"copy-tuner": {
"command": "bundle",
"args": ["exec", "copy-tuner-mcp"]
}
}
}
VSCode Copilot
.vscode/mcp.json ファイルを作成:
{
"servers": {
"copy-tuner": {
"type": "stdio",
"command": "bundle",
"args": ["exec", "copy-tuner-mcp"],
"cwd": "${workspaceFolder}"
}
}
}
CLAUDE.md設定例
プロジェクトのルートディレクトリに CLAUDE.yml ファイルを作成することで、AIアシスタントがプロジェクトの国際化の仕組みを理解できるようになります:
# CLAUDE.md
## 国際化(i18n)について
- i18nのバックエンドには**copy_tuner**というサーバでi18nデータを管理する仕組みを利用
- i18nのキーや内容を参照する場合は、copy_tunerから取得する必要がある
- `config/locales` 配下のファイルは利用していません
- copy_tunerサーバと連携してローカライズデータを管理
使用例
設定完了後、AIアシスタントで以下のような操作が可能になります:
キーの検索
user.nameに関連するi18nキーを検索してください
翻訳内容の検索
「ログイン」という文字を含む翻訳を検索してください
新しいキーの作成
user.profile.bioというキーで「プロフィール」(日本語)と「Profile」(英語)の翻訳を作成してください
3. 手動起動(動作確認・デバッグ用)
通常はAIアシスタントの設定ファイルを通じて自動的に起動されますが、動作確認やデバッグが必要な場合は、Railsアプリケーションのルートディレクトリで以下を実行して手動起動できます:
bundle exec copy-tuner-mcp
ライセンス
このgemはMIT Licenseの下でオープンソースとして利用可能です。
Related Servers
PHP MCP Server for Laravel
A Laravel wrapper for the php-mcp/server library to expose Laravel applications as MCP servers.
MCP Manager
An interactive CLI tool for managing MCP server configurations in the current directory.
Cloudflare MCP Server Example
A template for deploying a remote MCP server on Cloudflare Workers without authentication.
AppSignal MCP
Integrate with the AppSignal monitoring API to query and fetch error and performance data.
Authless Remote MCP Server on Cloudflare
An example of a remote MCP server deployable on Cloudflare Workers without authentication.
Alchemy MCP Server
Interact with Alchemy's blockchain APIs to query data without writing code.
Grok MCP
A MCP server for xAI's Grok API, providing access to capabilities including image understanding, image generation, live web search, and reasoning models.
mcp-installer
Installs other MCP servers from their source repositories, requiring npx for Node.js and uv for Python.
Remote MCP Server (Authless)
A remote MCP server deployable on Cloudflare Workers without authentication.
MCP Command Server
A secure server for executing pre-approved system commands via an environment variable.