代理创建者MCP服务器
这 agent-creator MCP服务器旨在促进Agentforce的创建和部署。它与用户交互以收集需求并生成代理元数据,然后可以将其部署到Salesforce组织。
使用示例
使用时 agent-creator-mcp 服务器在克劳德,你可以:
- 创建代理:服务器将引导您完成一系列问题,以了解您的需求,例如:
- “你想用这个人工智能代理解决什么业务问题?” - “什么会让这个人工智能代理为你成功?” - “你工作的公司叫什么名字?” - “你想给这个代理人取什么名字?”
- 生成和部署代理元数据:在收集到必要的信息后,服务器会生成代理元数据并将其部署到Salesforce组织。
快速启动
安装
配置选项
要部署代理,您需要使用Salesforce凭据配置服务器。有两种传输方式可供选择:STDIO和SSE。
使用STDIO传输
STDIO在您的本地计算机上运行,由MCP客户端自动管理。在MCP配置文件中使用以下配置模板,用实际凭据替换占位符:
"ai-assist": {
"command": "uv",
"args": [
"--directory",
"//agent-creator-mcp.",
"run",
"ai-assist"
],
"env": {
"SALESFORCE_USERNAME": "your_username",
"SALESFORCE_PASSWORD": "your_password"
}
}使用SSE传输
服务器发送事件(SSE)传输可以在本地或远程运行,并通过网络进行通信。这种方法对于查看日志和在机器之间共享服务器非常有用。
- 使用SSE传输运行服务器:
SALESFORCE_USERNAME=your_username SALESFORCE_PASSWORD=your_password uv run ai-assist --transport sse- 或者,您可以从以下位置加载环境变量
.env文件,然后运行:
uv run agent-creator-mcp --transport sse- 您可以指定自定义端口(默认值为8000):
uv run agent-creator-mcp --transport sse --port 8080- 将以下内容添加到MCP配置文件中:
"agent-creator-mcp": {
"url": "http://0.0.0.0:8000/sse"
}确保URL中的端口与启动服务器时指定的端口匹配。
在Claude桌面中运行
要在Claude Desktop中设置ai辅助MCP服务器,您需要将其添加到Claude的配置文件中:
- 在MacOS上:
~/Library/Application\ Support/Claude/claude_desktop_config.json - 在Windows上:
%APPDATA%/Claude/claude_desktop_config.json
您可以通过以下方式访问此文件:
- 打开计算机上的Claude菜单,选择“设置…”
- 点击左侧栏中的“开发人员”
- 点击“编辑配置”
配置服务器时,您可以使用STDIO或SSE传输:
使用STDIO传输(本地运行):
{
"mcpServers": {
"ai-assist": {
"command": "uv",
"args": [
"--directory",
"/agent-creator-mcp",
"run",
"agent-creator-mcp"
],
"env": {
"SALESFORCE_USERNAME": "your_username",
"SALESFORCE_PASSWORD": "your_password"
}
}
}
}使用SSE传输(可以在本地或远程运行):
- 使用SSE传输启动服务器:
SALESFORCE_USERNAME=your_username SALESFORCE_PASSWORD=your_password uv run ai-assist --transport sse- 将此添加到您的Claude Desktop配置中:
{
"mcpServers": {
"ai-assist": {
"url": "http://0.0.0.0:8000/sse"
}
}
}- 更新配置后,完全重新启动Claude Desktop。
有关在Claude Desktop中设置MCP服务器的更多详细说明,请参阅 MCP官方文件.
在游标中运行
在Cursor中,MCP服务器在使用STDIO时遇到了一些问题,因此建议使用SSE传输方法。有关在Cursor中设置MCP的详细说明,请参阅 光标MCP文档.
- 首先使用上一节中描述的SSE传输方法运行服务器。
- 将MCP配置添加到Cursor的配置文件中:
"mcp-test": {
"url": "http://0.0.0.0:8000/sse"
}- 确保在URL中使用与服务器配置匹配的正确端口。
调试
对于调试,请使用 MCP检查员 以可视化服务器的操作并排除故障。使用以下方式启动它:
npx @modelcontextprotocol/inspector uv --directory /agent-creator-mcp run agent-creator-mcp -e SALESFORCE_USERNAME your_username -e SALESFORCE_PASSWORD your_password启动后,检查器将显示一个URL,您可以在浏览器中访问该URL以开始调试。
提升特定客户的成果
光标
在Cursor中,您可以创建自定义规则来增强代理创建过程。例如:
# After the generate_agent_metadata is called:
- Create a folder in our project root if it does not exist called: agents
- Store the JSON output in the agents folder: agent_name.json
- Create a visual markdown of all the agent information including description, name, utterances, topics, and actions
- Generate a Mermaid diagram showing the Agent as a Node with Topics as sub-Nodes, and Actions as subnodes of the topics
- After it is generated, ask if the user wants to deploy the agent克劳德
在Claude中,您可以创建一个项目,其中包含使用其他MCP服务器来增强代理创建过程的说明:
- Guide the user to creating their agentforce agent.
- Use the get_agent_requirements tool to help gather requirements.
- Once enough requirements have been collected, call generate_agent_metadata to generate the whole metadata.
- Visualize the topics and agent metadata in the canvas with a React page showing the agent as a node, with topics as sub-nodes, and actions as sub-nodes of topics.
- Once the topics have been generated, call the deploy_agent to deploy the agent.
- Check if the agent deployment status is successful.