Salesforce MCP Server

MIT License
18
  • Apple
  • Linux

Integrations

  • Enables querying, modifying, and managing Salesforce objects and records, with capabilities for object/field management, schema information retrieval, data querying with relationship support, record manipulation (insert, update, delete), and cross-object searching using SOSL.

Salesforce MCP サーバー

Claude と Salesforce を統合する MCP(Model Context Protocol)サーバー実装により、Salesforce のデータとメタデータを自然言語で操作できるようになります。このサーバーにより、Claude は日常的な言語で Salesforce のオブジェクトとレコードをクエリ、変更、管理できます。

特徴

  • オブジェクトとフィールドの管理:自然言語を使用してカスタムオブジェクトとフィールドを作成および変更します
  • スマートオブジェクト検索: 部分的な名前一致を使用して Salesforce オブジェクトを検索します
  • 詳細なスキーマ情報: あらゆるオブジェクトの包括的なフィールドと関係の詳細を取得します
  • 柔軟なデータクエリ: リレーションシップサポートと複雑なフィルターを使用してレコードをクエリします
  • データ操作: レコードの挿入、更新、削除、アップサートが簡単に行えます
  • クロスオブジェクト検索: SOSL を使用して複数のオブジェクトを検索する
  • 直感的なエラー処理: Salesforce 固有のエラー詳細による明確なフィードバック

インストール

npm install -g @surajadsul02/mcp-server-salesforce

設定

Salesforce認証

次の 2 つの方法のいずれかを使用して Salesforce で認証できます。

1. ユーザー名/パスワード認証

  1. Salesforceの認証情報を設定する
  2. セキュリティトークンを取得する(Salesforce設定からリセット)
  3. 設定セクションに示されているように環境変数を設定します

2. コンシューマーキー/シークレットを使用したOAuth2認証

  1. Salesforceで接続アプリを設定する
  2. コンシューマーキーとコンシューマーシークレットを取得する
  3. 設定セクションに示されているように環境変数を設定します

IDE統合

カーソルIDEセットアップ

  1. パッケージをグローバルにインストールします。
npm install -g @surajadsul02/mcp-server-salesforce
  1. Cursor IDE .cursor/mcp.jsonで MCP サーバーを構成します。
envコマンドの使用
{ "mcpServers": { "salesforce": { "command": "env", "args": [ "SALESFORCE_USERNAME=your.actual.email@example.com", "SALESFORCE_PASSWORD=YourActualPassword123", "SALESFORCE_TOKEN=YourActualSecurityToken123", "SALESFORCE_INSTANCE_URL=https://login.salesforce.com", "npx", "-y", "@surajadsul02/mcp-server-salesforce" ] } } }
カーソルでのOAuth2認証
{ "mcpServers": { "salesforce": { "command": "env", "args": [ "SALESFORCE_USERNAME=your.actual.email@example.com", "SALESFORCE_PASSWORD=YourActualPassword123", "SALESFORCE_TOKEN=YourActualSecurityToken123", "SALESFORCE_INSTANCE_URL=https://login.salesforce.com", "SALESFORCE_CONSUMER_KEY=YourConsumerKey", "SALESFORCE_CONSUMER_SECRET=YourConsumerSecret", "npx", "-y", "@surajadsul02/mcp-server-salesforce" ] } } }

クロードデスクトップセットアップ

  1. パッケージをグローバルにインストールします (まだインストールされていない場合)。
npm install -g @surajadsul02/mcp-server-salesforce
  1. claude_desktop_config.jsonに追加します:
ユーザー名/パスワード認証の場合
{ "mcpServers": { "salesforce": { "command": "npx", "args": ["-y", "@surajadsul02/mcp-server-salesforce"], "env": { "SALESFORCE_USERNAME": "your_username", "SALESFORCE_PASSWORD": "your_password", "SALESFORCE_TOKEN": "your_security_token", "SALESFORCE_INSTANCE_URL": "https://login.salesforce.com" } } } }
OAuth2認証の場合
{ "mcpServers": { "salesforce": { "command": "npx", "args": ["-y", "@surajadsul02/mcp-server-salesforce"], "env": { "SALESFORCE_USERNAME": "your_username", "SALESFORCE_PASSWORD": "your_password", "SALESFORCE_CONSUMER_KEY": "your_consumer_key", "SALESFORCE_CONSUMER_SECRET": "your_consumer_secret", "SALESFORCE_INSTANCE_URL": "https://login.salesforce.com" } } } }
  1. 構成ファイルの場所:
    • macOS: ~/Library/Application Support/Claude Desktop/claude_desktop_config.json
    • Windows: %APPDATA%\Claude Desktop\claude_desktop_config.json
    • Linux: ~/.config/Claude Desktop/claude_desktop_config.json

必要な環境変数

ユーザー名/パスワード認証の場合:

  • SALESFORCE_USERNAME : Salesforceのユーザー名/メールアドレス
  • SALESFORCE_PASSWORD : Salesforceのパスワード
  • SALESFORCE_TOKEN : Salesforce セキュリティトークン
  • SALESFORCE_INSTANCE_URL : Salesforce インスタンスの URL (オプション、デフォルト: https://login.salesforce.com )

OAuth2認証の場合:

  • SALESFORCE_USERNAME : Salesforceのユーザー名/メールアドレス
  • SALESFORCE_PASSWORD : Salesforceのパスワード
  • SALESFORCE_CONSUMER_KEY : 接続されたアプリケーションのコンシューマーキー
  • SALESFORCE_CONSUMER_SECRET : 接続アプリケーションのコンシューマーシークレット
  • SALESFORCE_INSTANCE_URL : Salesforce インスタンスの URL (オプション、デフォルト: https://login.salesforce.com )

使用例

オブジェクトの検索

"Find all objects related to Accounts" "Show me objects that handle customer service" "What objects are available for order management?"

スキーマ情報の取得

"What fields are available in the Account object?" "Show me the picklist values for Case Status" "Describe the relationship fields in Opportunity"

レコードのクエリ

"Get all Accounts created this month" "Show me high-priority Cases with their related Contacts" "Find all Opportunities over $100k"

カスタムオブジェクトの管理

"Create a Customer Feedback object" "Add a Rating field to the Feedback object" "Update sharing settings for the Service Request object"

オブジェクト間の検索

"Search for 'cloud' in Accounts and Opportunities" "Find mentions of 'network issue' in Cases and Knowledge Articles" "Search for customer name across all relevant objects"

発達

ソースからのビルド

# Clone the repository git clone https://github.com/surajadsul02/mcp-server-salesforce.git # Navigate to directory cd mcp-server-salesforce # Install dependencies npm install # Build the project npm run build

トラブルシューティング

  1. 認証エラー
    • 資格情報が正しいことを確認してください
    • ユーザー名/パスワード認証の場合: セキュリティトークンが正しいことを確認してください
    • OAuth2の場合: コンシューマーキーとシークレットを検証する
  2. 接続の問題
    • SalesforceインスタンスURLを確認する
    • ネットワーク接続を確認する
    • 適切なAPIアクセス権限を確保する
  3. カーソルIDE統合
    • 設定変更後にカーソルIDEを再起動します
    • 開発者ツール(ヘルプ > 開発者ツールの切り替え)でエラーメッセージを確認してください。
    • パッケージがグローバルにインストールされていることを確認する
  4. クロードデスクトップ統合
    • 構成ファイルの場所を確認する
    • ファイルの権限を確認する
    • 設定変更後にClaude Desktopを再起動します
    • 環境変数が適切に設定されていることを確認する

貢献

貢献を歓迎します!お気軽にプルリクエストを送信してください。

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

問題とサポート

問題が発生した場合やサポートが必要な場合は、GitHub リポジトリで問題を報告してください。

ID: h0ldgpjlzf