mcp

MCPサーバーは、Salesforceオーガニゼーションと大規模言語モデル(LLM)とのシームレスな相互作用を可能にするために設計されています。TypeScriptライブラリを使用して安全にアクセスし、秘密情報を平文で露出することを避け、細かなアクセス制御を提供します。モジュラーアーキテクチャにより拡張性も高いです。

GitHubスター

133

ユーザー評価

未評価

お気に入り

0

閲覧数

8

フォーク

36

イシュー

25

インストール方法
難易度
中級
推定所要時間
10-20
必要な環境
Node.js: 18.0.0以上
npm: 8.0.0以上
+1 more

インストール方法

インストール方法

前提条件

Node.js: 18.0.0以上
npm: 8.0.0以上
Claude Desktop: 最新版

インストール手順

1. リポジトリのクローン

bash
git clone https://github.com/salesforcecli/mcp.git
cd mcp

2. 依存関係のインストール

bash
npm install

3. Claude Desktop設定

claude_desktop_config.jsonを編集してMCPサーバーを追加:
json
{
  "mcpServers": {
    "server-name": {
      "command": "node",
      "args": ["path/to/server.js"]
    }
  }
}

4. サーバーの起動

bash
npm start

トラブルシューティング

よくある問題

問題: サーバーが起動しない 解決策: Node.jsのバージョンを確認し、依存関係を再インストールしてください。 問題: Claude Desktopで認識されない 解決策: 設定ファイルのパスと構文を確認してください。

設定方法

設定方法

基本設定

Claude Desktop設定

~/.config/claude-desktop/claude_desktop_config.json(macOS/Linux)または %APPDATA%\Claude\claude_desktop_config.json(Windows)を編集:
json
{
  "mcpServers": {
    "tool-name": {
      "command": "npx",
      "args": ["-y", "package-name"],
      "env": {
        "API_KEY": "your-api-key"
      }
    }
  }
}

環境変数

必要に応じて以下の環境変数を設定:
bash
export API_KEY="your-api-key"
export DEBUG="true"

設定例

基本的な設定

json
{
  "mcpServers": {
    "example-mcp": {
      "command": "node",
      "args": ["server.js"],
      "env": {
        "PORT": "3000",
        "LOG_LEVEL": "info"
      }
    }
  }
}

使用例

使用例

基本的な使用方法

MCPサーバーの基本的な使用方法を以下に示します:

Claude Desktopでの使用

1MCPサーバーの起動確認
Claude Desktopを開き、設定が正しく読み込まれていることを確認してください。
2基本コマンドの実行

   Available tools from this MCP server:
   - tool1: Description of tool1
   - tool2: Description of tool2
   

プログラムでの使用

javascript
// JavaScript例(Node.js)
const { MCPClient } = require('@modelcontextprotocol/client');

const client = new MCPClient();
await client.connect();

// ツールの実行
const result = await client.callTool('toolName', {
  parameter1: 'value1',
  parameter2: 'value2'
});

console.log(result);

応用例

自動化スクリプト

bash
#!/bin/bash

バッチ処理の例

for file in *.txt; do mcp-tool process "$file" done

使用ケース

Salesforceの認証済み組織のリストを取得するためのコマンドを実行する
Salesforceのレコードを表示するためのツールを使用する
メタデータをデプロイまたは取得するための自然言語コマンドを実行する
自動化スクリプトを作成して、複数のSalesforceリソースを一括処理する

追加リソース

作者情報
Salesforce CLI

The Salesforce CLI is a powerful command line interface that simplifies development and build automation when working with your Salesforce org.

157

フォロワー

67

リポジトリ

0

Gist

0

貢献数