Token导航 LogoToken导航

MCP Server · AI代理

MCP Apex SDK

MCP Apex SDK是一个实现Model Context Protocol规范的开发工具包,用于创建MCP服务器,提供资源、工具和提示作为原语,支持标准Streamable HTTP传输和处理MCP协议消息。

未说明官方级别未说明来源级核验工具 2
协议实现HTTP传输AI代理

快速开始

公开资料没有提供安装命令,按仓库或官方文档接入。
作者 / 组织
bfmvsa
提供方
bfmvsa

工具数量

2

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

18

仓库热度

收录来源

1 个

MCP World

选型结论

MCP Apex SDK 属于AI代理类 MCP Server,公开资料标注 2 个工具,通过传输方式未标注接入,客户端适配情况以官方文档为准,没有现成的安装命令;接入前要先准备 会话凭据。

分类

AI代理

传输方式

未说明

认证方式

会话凭据

部署方式

公开资料未说明

安装与配置

公开目录没有给出安装命令,需要按仓库 README安装;下面按同类条目的通用流程说明。

公开命令不是通用的启动方式,拼不出可靠配置示例;请在客户端 MCP 配置里按官方文档填写 command 和 args。

上手步骤

  1. 1

    先确认运行方式

    公开资料没有标注传输方式,先看仓库 README,确认是本地进程还是远程地址。

  2. 2

    获取服务

    公开目录没有给出安装命令,按仓库 README里的步骤安装或获取服务。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 2 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

公开资料仍需确认:安装命令

详细介绍

MCP Apex SDK

概述

这 模型上下文协议(MCP) 为应用程序向LLM提供上下文提供了一种标准化的方法,将 LLM交互提供上下文。

此Apex SDK实现了MCP规范,使您能够:

  • 创建MCP服务器,将资源、工具和提示作为原语公开
  • 使用标准流式HTTP传输
  • 处理MCP协议消息

安装链接

/packaging/installPackage.apexp?p0=04tN2000000mUAHIA2

快速开始

  1. 安装 Salesforce组织中的软件包
  2. 部署 演示类从 force-app/main/example/ 文件夹
  3. 暴露 这 DemoServer 从示例文件夹中作为REST资源
  4. 测试 使用的功能

这 MCP检查员 工具

如何暴露MCP服务器

要将服务器暴露给访客用户,请创建一个站点并启用 DemoServer 访客用户类:

  1. 引导到 Setup > User Interface > Sites and Domains > Sites
  2. 点击 New 并输入 Site Label 和 Site Name,然后单击 Save
  3. 在网站详细信息页面上,单击 Activate,然后单击 Public Access Settings
  4. 在 Enabled Apex Class Access 节,添加 DemoServer 到 Enabled Apex Classes
  5. 返回 Setup > User Interface > Sites and Domains > Sites,找到您新创建的网站,并复制其 Site URL
  6. 追加 /services/apexrest/mcp 到复制 Site URL 获取MCP服务器的完整URL
\[!注意\] 如果你的组织有一个命名空间,URL将是 {site_url}/services/apexrest/{namespace}/mcp.

测试MCP服务器

要测试服务器,请使用 MCP检查员 工具。

连接到您的服务器

  1. 选择 传输类型:流式HTTP
  2. 输入您的服务器URL(例如。, https://{instance_url}/services/apexrest/mcp)
  3. 点击 连接

成功连接后,您将看到可用资源、工具和提示的列表,如所示 下面的屏幕截图:

核心概念

服务器

有几种方法可以创建MCP服务器:

1.仅限必填字段

ctx.Server server = new ctx.Server('1.0.0', 'autocare-plus-mcp-server');

2.所有可用字段

String version = '1.0.0';
String serverName = 'autocare-plus-mcp-server';
String serverTitle = 'AutoCare Plus MCP Server';
String instructions = 'AutoCare Plus car service that exposes a list of available services and a tool to book appointments.';

ctx.Server server = new ctx.Server(version, serverName, serverTitle, instructions);

3.使用链式方法

ctx.Server server = new ctx.Server('1.0.0', 'autocare-plus-mcp-server')
        .setInstructions(instructions)
        .setTitle(serverTitle);

工具

1.创建仅包含必填字段的工具

public with sharing class GetAvailableCarServicesTool extends ctx.Tool {
  public static final String toolName = 'get-available-car-services-tool';
  public static final String toolDescription = 'Retrieves all available car services with their Salesforce record IDs.';

  public GetAvailableCarServicesTool() {
    super(toolName, toolDescription);
  }

  //...
}

2.使用所有可用的构造函数字段

public with sharing class GetAvailableCarServicesTool extends ctx.Tool {
  public static final String toolName = 'get-available-car-services-tool';
  public static final String toolTitle = 'Get Available Car Services';
  public static final String toolDescription = 'Retrieves all available car services with their Salesforce record IDs.';

  public GetAvailableCarServicesTool() {
    super(toolName, toolTitle, toolDescription);
  }

  //...
}

3.添加属性

public with sharing class WeatherTool extends ctx.Tool {
  public WeatherTool() {
    super('get-weather-details', 'Get weather details for a specific city');

    ctx.Tool.Property cityName = new ctx.Tool.Property(
      'cityName', // Property name
      'string', // Property type
      'The name of the city', // Property description
      true // true if property is required, false if optional
    );

    this.addProperty(cityName);
  }

  //...
}

4.处理物业

public with sharing class WeatherTool extends ctx.Tool {
  //...

  public override String call(Map input) {
    String cityName = (String) input.get('cityName');

    // Perform logic here...
    String result = 'The weather in ' + cityName + ' is perfect!';

    return result;
  }
}

资源

1.创建资源(仅限必填字段)

public with sharing class CarServiceResource extends ctx.Resource {
  public static final String uri = '@server://services';
  public static final String resourceName = 'service-catalog';

  public CarServiceResource() {
    super(uri, resourceName);
  }

  // ...
}

2.创建资源(所有可用字段)

public with sharing class CarServiceResource extends ctx.Resource {
  public static final String uri = '@server://services';
  public static final String resourceName = 'service-catalog';
  public static final String resourceTitle = 'Catalog of Services';
  public static final String resourceDescription = 'List of all available car services';
  public static final String resourceMimeType = 'application/json';
  public static Long resourceSize = 65536;

  public CarServiceResource() {
    super(uri, resourceName, resourceTitle, resourceDescription, resourceMimeType, resourceSize);
  }

  // ...
}

3.使用方法链创建资源

public with sharing class CarServiceResource extends ctx.Resource {
  public static final String uri = '@server://services';
  public static final String resourceName = 'service-catalog';
  public static final String resourceTitle = 'Catalog of Services';
  public static final String resourceDescription = 'List of all available car services';
  public static final String resourceMimeType = 'application/json';
  public static Long resourceSize = 65536;

  public CarServiceResource() {
    super(uri, resourceName);
    this.setTitle(resourceTitle)
      .setDescription(resourceDescription)
      .setMimeType(resourceMimeType)
      .setSize(resourceSize);
  }

  // ...
}

4.检索资源数据

public with sharing class CarServiceResource extends ctx.Resource {
  // ...

  public override List read() {
    // This method MUST return List
    List services = new List{ 'Oil Change', 'Battery Check' };

    List result = new List();
    for (String service : services) {
      result.add(new ctx.Resource.Content(this.uri, service));
    }

    return result;
  }
}
4.1创建ctx。资源。内容(仅限必填字段)
ctx.Resource.Content content = new ctx.Resource.Content('uri', 'text-data');
4.2创建ctx。资源。内容(所有字段)
String uri = '@server://service/oil-change';
String name = 'oil-change';
String title = 'Oil Change';
String text = 'Oil Change Service';

ctx.Resource.Content content = new ctx.Resource.Content(uri, name, title, text);
4.3创建ctx。资源。内容使用方法链接
String uri = '@server://service/oil-change';
String name = 'oil-change';
String title = 'Oil Change';
String text = 'Oil Change Service';

ctx.Resource.Content content = new ctx.Resource.Content(uri, text)
        .setTitle(title)
        .setMimeType('text/plain')
        .setText(text);
4.4创建ctx。资源。包含二进制内容的内容
String uri = '@file:///example.png';
String name = 'example.png';
String title = 'Example Image';

ctx.Resource.Content content = new ctx.Resource.Content(uri)
        .setName(name)
        .setTitle(title)
        .setMimeType('image/png')
        .setBlobData('base64-encoded-data');

5.添加资源注释

public with sharing class CarServiceResource extends ctx.Resource {
  public static final String uri = '@server://services';
  public static final String resourceName = 'service-catalog';

  public CarServiceResource() {
    super(uri, resourceName);

    List audience = new List{ 'user', 'assistant' }; // "user" or "assistant" or both
    Decimal priority = 0.8; // Value between 0 and 1
    Datetime lastModified = System.now(); // ISO 8601 formatted timestamp

    ctx.Resource.Annotations annotations = new ctx.Resource.Annotations(audience, priority, lastModified);

    this.setAnnotations(annotations);
  }

  // ...
}

提示

1.创建提示(仅限必填字段)

public with sharing class CodeReviewPrompt extends ctx.Prompt {
  public CodeReviewPrompt() {
    super('code-review');
  }

  // ...
}

2.创建提示(所有可用字段)

public with sharing class CodeReviewPrompt extends ctx.Prompt {
  public CodeReviewPrompt() {
    super('code-review', 'Code Review', 'Asks the LLM to analyze code quality and suggest improvements');
  }

  // ...
}

3.使用方法链创建提示

public with sharing class CodeReviewPrompt extends ctx.Prompt {
  public CodeReviewPrompt() {
    super('code-review');
    this.setTitle('Code Review').setDescription('Asks the LLM to analyze code quality and suggest improvements');
  }

  // ...
}

4.添加提示参数

public with sharing class CodeReviewPrompt extends ctx.Prompt {
  public CodeReviewPrompt() {
    super('code-review', 'Code Review', 'Asks the LLM to analyze code quality and suggest improvements');

    ctx.Prompt.Argument code = new ctx.Prompt.Argument('code', 'The code to review', true);

    this.addArgument(code);
  }

  // ...
}

5.检索提示消息

public with sharing class CodeReviewPrompt extends ctx.Prompt {
  // ...

  public override List get(Map input) {
    String code = (String) input.get('code');

    List messages = new List();

    messages.add(new ctx.Prompt.Message('user', 'Review the following code and suggest improvements: ' + code));

    return messages;
  }
}

工具与能力

工具数量

2

资源数量

0

提示词数量

0

能力标签

Apex本地部署LLM上下文管理Apex开发Salesforce集成HTTP传输协议实现

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

多步任务编排

把拆解、检索、执行串成一条链,模型按步骤调用工具。

长期上下文

把会话、笔记和知识放到外部存储,换个会话还能接着做。

接自有流程

把内部系统和模型连起来,让助手调用已有的工作流。

选择建议

值得选的地方

  • 只提供 2 个工具,职责集中,接入后不容易误操作。
  • 公开说明写得比较完整,接入前能看清能力边界。

先想清楚的地方

  • 公开资料没有可直接复制的安装命令,第一次接入要自己找入口。
  • 需要自备会话凭据,没有凭据没法直接试。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 愿意照着官方文档一步步配环境的人。

不太适合

  • 暂时拿不到会话凭据的人。
  • 希望一条命令就装好、不想看文档的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
MCP Apex SDK

MCP World · 本页

2未说明未标注1 个2026-05-17
Everything Claude Code

MCP World

0stdio有1 个2026-05-17
Filesystem 560c4363

MCP World

13未说明未标注2 个2026-05-17
Time 7365cb6d

MCP.so

2SSE有2 个2026-05-17
Server Everything (everything)

MCP World

11stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

MCP Apex SDK 怎么安装?

公开目录没有给出可以直接复制的安装命令,需要按仓库 README里的步骤安装;装好后写进客户端的 MCP 配置再重启。

MCP Apex SDK 怎么在 Claude Desktop、Cursor 里配置?

它是传输方式未标注,客户端配置里要写启动命令和参数,运行环境是 未标注;保存后完全退出客户端再打开,配置才会生效。

MCP Apex SDK 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

MCP Apex SDK 需要 API Key 吗?

公开资料标注的认证方式是会话凭据,也就是要先拿到凭据才能连上;凭据只填在自己本地的配置里,不要写进公开仓库。

MCP Apex SDK 支持哪些客户端?

公开资料没有标注具体客户端;能配置本地 MCP 命令的客户端都能接,配置方式参照官方文档。

来源信息

继续浏览同类 MCP