MCP Anthropic サーバー ( mcp-anthropic
)
Anthropic の実験的なプロンプト エンジニアリング API と対話するためのツールを提供する MCP (Model Context Protocol) サーバー。
特徴
次のツールを提供します:
generate_prompt
: タスクの説明に基づいてプロンプトを生成します。improve_prompt
: フィードバックに基づいて既存のプロンプトを改善します。templatize_prompt
: 具体的なプロンプトの例を再利用可能なテンプレートに変換します。
設定
- リポジトリをクローンする(該当する場合)
- プロジェクト ディレクトリに移動します。
- 依存関係をインストールします:
- API キーを設定します。
- プロジェクト ルートに
.env
ファイル ( ./mcp-anthropic/.env
) を作成します。 - Anthropic API キーを
.env
ファイルに追加します。ANTHROPIC_KEY=your_anthropic_api_key_here
- このファイルがバージョン管理にコミットされていないことを確認してください (
.gitignore
でカバーされている必要があります)。 - **LibreChat 統合に関する注意:**このサーバーを LibreChat 内の子プロセスとして設定および実行する具体的な手順 (API キーの処理を含む) については、
documentation.md
ファイルを参照してください。
サーバーの実行
- TypeScript コードをビルドします。
- サーバーを起動します。サーバーが起動し、MCP接続を待機します。サーバーの起動と登録されているツールを示す出力が表示されます。
ツールドキュメント
generate_prompt
タスクの説明に基づいてプロンプトを生成します。
入力スキーマ:
{
"type": "object",
"properties": {
"task": {
"type": "string",
"description": "A description of the task the prompt should be designed for (e.g., \"a chef for a meal prep planning service\")."
},
"target_model": {
"type": "string",
"description": "The target Anthropic model identifier (e.g., \"claude-3-opus-20240229\")."
}
},
"required": ["task", "target_model"]
}
improve_prompt
フィードバックに基づいて既存のプロンプトを改善します。
入力スキーマ:
{
"type": "object",
"properties": {
"messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"role": { "type": "string", "description": "Role (e.g., 'user', 'assistant')." },
"content": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": { "type": "string", "description": "Content type (e.g., 'text')." },
"text": { "type": "string", "description": "Text content." }
},
"required": ["type", "text"]
},
"description": "Content blocks."
}
},
"required": ["role", "content"]
},
"description": "The sequence of messages representing the prompt conversation."
},
"system": {
"type": "string",
"description": "(Optional) A system prompt to guide the model."
},
"feedback": {
"type": "string",
"description": "Specific feedback on how to improve the prompt (e.g., \"Make it more detailed\")."
},
"target_model": {
"type": "string",
"description": "The target Anthropic model identifier (e.g., \"claude-3-opus-20240229\")."
}
},
"required": ["messages", "feedback", "target_model"]
}
templatize_prompt
具体的なプロンプトの例を再利用可能なテンプレートに変換します。
入力スキーマ:
{
"type": "object",
"properties": {
"messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"role": { "type": "string", "description": "Role (e.g., 'user', 'assistant')." },
"content": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": { "type": "string", "description": "Content type (e.g., 'text')." },
"text": { "type": "string", "description": "Text content." }
},
"required": ["type", "text"]
},
"description": "Content blocks."
}
},
"required": ["role", "content"]
},
"description": "The sequence of messages representing the prompt conversation example."
},
"system": {
"type": "string",
"description": "(Optional) A system prompt associated with the example."
}
},
"required": ["messages"]
}