Files
dify-docs/ja/use-dify/build/mcp.mdx
Chenhe Gu 767397a9de changed language codes: cn -> zh, jp -> ja. with other supporting structural changes (#565)
* fix redirect language code prefixes

* rename: cn -> zh, jp -> ja

* remove hardcoded ja / zh references

* remove hardcoded 'english' references

* renamed variable names and dict keys to language agnostic names

* fix: add missing language helper methods to PRAnalyzer

- Add get_language_directory() method
- Initialize source_language and target_languages from config
- Fixes AttributeError when generating mixed PR errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* test: kitchen sink workflow validation v2

This PR validates the translation workflow after config-driven refactoring:

Changes:
- Add new test file: test-workflow-validation.mdx
- Modify existing file: introduction.mdx
- Update docs.json navigation

Tests:
- New file translation (add workflow)
- Existing file translation (update workflow)
- Navigation sync across languages
- Config-driven language codes (zh/ja instead of cn/jp)
- Source language abstraction (no hardcoded "English")

Expected workflow behavior:
1. Detect changes in en/ directory
2. Translate new file to zh and ja
3. Update modified file translations
4. Sync docs.json for all language sections
5. Commit translated files automatically

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: update workflow paths to use zh/ja instead of cn/jp

Aligns workflow trigger paths with the zh/ja language directory rename.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Revert "fix: update workflow paths to use zh/ja instead of cn/jp"

This reverts commit 9587b7cc5d.

* Revert "test: kitchen sink workflow validation v2"

This reverts commit 4abdd69fd2.

* fix: update workflow paths in doc analyze workflow to use zh/ja instead of cn/jp

* Refactor/language codes (#240)

* test: kitchen sink workflow validation v2

This PR validates the translation workflow after config-driven refactoring:

Changes:
- Add new test file: test-workflow-validation.mdx
- Modify existing file: introduction.mdx
- Update docs.json navigation

Tests:
- New file translation (add workflow)
- Existing file translation (update workflow)
- Navigation sync across languages
- Config-driven language codes (zh/ja instead of cn/jp)
- Source language abstraction (no hardcoded "English")

Expected workflow behavior:
1. Detect changes in en/ directory
2. Translate new file to zh and ja
3. Update modified file translations
4. Sync docs.json for all language sections
5. Commit translated files automatically

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: update workflow paths to use zh/ja instead of cn/jp

Aligns workflow trigger paths with the zh/ja language directory rename.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Revert "fix: update workflow paths to use zh/ja instead of cn/jp"

This reverts commit 9587b7cc5d.

* Revert "test: kitchen sink workflow validation v2"

This reverts commit 4abdd69fd2.

* fix: update workflow paths in doc analyze workflow to use zh/ja instead of cn/jp

---------

Co-authored-by: Claude <noreply@anthropic.com>

* fix: update workflow files to use 'source' instead of 'english'

After refactoring the PR analyzer to use 'source' for source language
PRs (instead of hardcoded 'english'), the workflow files need to match.

Changes:
- sync_docs_analyze.yml: pr_type == 'source' (was 'english')
- sync_docs_update.yml: PR_TYPE != 'source' check
- Updated all comments from "English" to "source language"
- Updated all pr_type values in JSON from "english" to "source"

This ensures the workflows trigger correctly with the refactored
config-driven language system.

Related: language code refactoring (cn/jp → zh/ja)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix/workflow source language references (#245)

* test: kitchen sink workflow validation v2

This PR validates the translation workflow after config-driven refactoring:

Changes:
- Add new test file: test-workflow-validation.mdx
- Modify existing file: introduction.mdx
- Update docs.json navigation

Tests:
- New file translation (add workflow)
- Existing file translation (update workflow)
- Navigation sync across languages
- Config-driven language codes (zh/ja instead of cn/jp)
- Source language abstraction (no hardcoded "English")

Expected workflow behavior:
1. Detect changes in en/ directory
2. Translate new file to zh and ja
3. Update modified file translations
4. Sync docs.json for all language sections
5. Commit translated files automatically

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: update workflow paths to use zh/ja instead of cn/jp

Aligns workflow trigger paths with the zh/ja language directory rename.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Revert "fix: update workflow paths to use zh/ja instead of cn/jp"

This reverts commit 9587b7cc5d.

* Revert "test: kitchen sink workflow validation v2"

This reverts commit 4abdd69fd2.

* fix: update workflow paths in doc analyze workflow to use zh/ja instead of cn/jp

* fix: update workflow files to use 'source' instead of 'english'

After refactoring the PR analyzer to use 'source' for source language
PRs (instead of hardcoded 'english'), the workflow files need to match.

Changes:
- sync_docs_analyze.yml: pr_type == 'source' (was 'english')
- sync_docs_update.yml: PR_TYPE != 'source' check
- Updated all comments from "English" to "source language"
- Updated all pr_type values in JSON from "english" to "source"

This ensures the workflows trigger correctly with the refactored
config-driven language system.

Related: language code refactoring (cn/jp → zh/ja)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>

* fix

* fix docs.json language codes

* rename previous version docs: cn -> zh, jp -> ja

* rm duplicate redirect entires

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-28 04:00:02 -08:00

108 lines
4.5 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "MCPツールの使用"
icon: "microchip"
---
<Note> ⚠️ このドキュメントはAIによって自動翻訳されています。不正確な部分がある場合は、[英語版](/en/use-dify/build/mcp)を参照してください。</Note>
[MCPサーバー](https://modelcontextprotocol.io/introduction)から外部ツールをDifyアプリに接続します。組み込みツールだけでなく、成長する[MCPエコシステム](https://mcpservers.org/)のツールも使用できます。
<Note>
これはDifyでMCPツールを使用することについて説明しています。DifyアプリをMCPサーバーとして公開する場合は、[こちら](/zh/use-dify/publish/publish-mcp)をご覧ください。
</Note>
<Info>
現在、[HTTPトランスポート](https://modelcontextprotocol.io/docs/concepts/architecture#transport-layer)を使用するMCPサーバーのみをサポートしています。
</Info>
## MCPサーバーの追加
ワークスペースで**ツール** → **MCP**に移動します。
![](/images/6cef1436fcc13a65ccedb54bcf5ab77eb87b8faba1098a85951839fb1907f2d2.png)
**MCPサーバーを追加HTTP**をクリック:
![](/images/b5429131836c1caae84f4ce8b3b806221e39636723644961ce2f2a97d5421f16.png)
**サーバーURL**MCPサーバーの場所`https://api.notion.com/mcp`
**名前とアイコン**わかりやすい名前を付けてください。Difyはアイコンを自動的に取得しようとします。
**サーバーID**一意の識別子小文字、数字、アンダースコア、ハイフン、最大24文字
<Warning>
サーバーIDを使い始めたら、絶対に変更しないでください。このサーバーのツールを使用するアプリが壊れてしまいます。
</Warning>
## 次に起こること
Difyは自動的に
1. サーバーに接続
2. OAuth処理を実行
3. 使用可能なツールのリストを取得
4. アプリビルダーで使用できるようにします
ツールが見つかると、サーバーカードが表示されます:
![](/images/fcef5ecad1deca82a1d8988c4bcb7cec745a0cd47945ff05fca588502cfaafbc.png)
## サーバーの管理
任意のサーバーカードをクリックすると:
**ツールの更新**:外部サービスが新しいツールを追加した際に更新
![](/images/7b526a64ff34b10a357511b2cd3e42f251a6786210eac71c58ca7bfccdf63f0c.png)
**再認証**:トークンの期限切れ時に認証を修正
**設定の編集**サーバーの詳細を変更IDは除く
**削除**:サーバーを切断(そのツールを使用するアプリが壊れます)
## MCPツールの使用
接続されると、MCPツールは予想される場所すべてに表示されます
**エージェント内**ツールはサーバー別にグループ化されて表示「Notion MCP » ページ作成」)
**ワークフロー内**MCPツールはードとして使用可能
**エージェントノード内**:通常のエージェントと同じ
## ツールのカスタマイズ
MCPツールを追加する際、カスタマイズできます
![](/images/CleanShot2025-07-07at07.41.33@2x.png)
**説明**:デフォルトの説明をより具体的にオーバーライド
**パラメータ**:各ツールパラメータについて、選択できます:
- **自動**AIに値を決定させる
- **固定**:変更されない特定の値を`numResults`を5固定に設定し、`query`は自動のままにします。
## アプリの共有
MCPツールを使用するアプリをエクスポートする場合
- エクスポートにはサーバーIDが含まれます
- アプリを他の場所で使用するには、同じIDで同じサーバーを追加してください
- アプリに必要なMCPサーバーを文書化してください
## トラブルシューティング
**「未設定サーバー」**URLを確認し、再認証してください
**不足しているツール**:「ツールの更新」を実行してください
**壊れたアプリ**おそらくサーバーIDを変更したでしょう。元のIDで再度追加してください。
## ヒント
- `github-prod`や`crm-system`のような永続的で説明的なサーバーIDを使用してください
- 開発/ステージング/本番環境で同じMCP設定を維持してください
- 設定項目には固定値を、動的入力には自動を設定してください
- デプロイ前にMCP統合をテストしてください