Salesforce External MCP Server
Enables Agentforce agents to retrieve order status and loyalty points from external systems via OAuth 2.0 secured MCP endpoints hosted on AWS.
README
Salesforce External MCP Server — AWS Hosted
A Python FastAPI MCP server deployed on AWS EC2 with nginx reverse proxy and Let's Encrypt SSL, registered as an External MCP Server inside Salesforce and called by an Agentforce Employee Agent ("A[...]
Business Problem
Enterprises need Agentforce to reach external systems that aren't natively connected to Salesforce — legacy CRMs, loyalty platforms, custom order systems. This proves the pattern end to end: host[...]
Architecture

How It Works
- Agentforce Employee Agent ("AWS") has the MCP tools registered as available actions
- User asks something like "What's the status of order 1001?"
- Agent matches intent to the
get_order_statustool - Salesforce authenticates via OAuth 2.0 Client Credentials against
/token - Authenticated call routes through Named Credential to
/mcp - nginx terminates SSL, reverse proxies to uvicorn on port 8000
- FastAPI server processes the MCP JSON-RPC call, returns structured data
- Agent composes a natural language reply
Tools Exposed
| Tool | Input | Output |
|---|---|---|
| get_order_status | order_id | status, carrier, eta |
| check_loyalty_points | customer_id | points, tier |
Salesforce Components
| Component | Type | Purpose |
|---|---|---|
| AWS | Agentforce Employee Agent | Calls the MCP tools as actions |
| NorthstarMCP | External Credential | OAuth 2.0 Client Credentials auth |
| NorthstarMCP | Named Credential | Secure endpoint URL |
| NorthstarMCP | External Service Registration | MCP tool registration |
| Agentforce Agent AWS Permissions | Permission Set | Grants agent access to MCP tools |
OAuth 2.0 Configuration
| Field | Value |
|---|---|
| Flow | Client Credentials with Client Secret |
| Identity Provider URL | https://northstar-mcp.mooo.com/token |
| Scope | mcp.read |
| Named Credential URL | https://northstar-mcp.mooo.com/mcp |
| Principal | MCPAuthentication |
Live Verification
curl https://northstar-mcp.mooo.com/
{"status":"ok","info":"Dummy MCP server. POST /token for OAuth, POST /mcp for MCP JSON-RPC."}
Verified live on AWS EC2 — uvicorn process confirmed running, nginx confirmed listening on 443 with valid Let's Encrypt certificate.
Problems Faced & How They Were Solved
| Problem | Root Cause | Fix |
|---|---|---|
| Salesforce couldn't reach localhost server | Not internet-accessible | Deployed to AWS EC2 with public domain |
| Salesforce rejecting HTTP connection | No SSL configured | nginx reverse proxy with Let's Encrypt via Certbot |
| Agent couldn't call the tools | Permission Set missing agent access | Created Agentforce Agent AWS Permissions with agentAccesses enabled |
Prerequisites
- Salesforce org with Agentforce + MCP Server registration enabled
- Domain with DNS pointed to your server
- AWS EC2 instance, nginx, Certbot
- Python 3.9+, FastAPI, uvicorn
Deployment
# Python server (on EC2)
pip3 install -r requirements.txt
python3 external_dummy_mcp_server.py
# SSL setup (one-time)
sudo certbot --nginx -d northstar-mcp.mooo.com
# Salesforce metadata
sf project deploy start --manifest package.xml
sf org assign permset --name Agentforce_Agent_AWS_Permissions
Admin Configuration
| Step | Action |
|---|---|
| 1 | External Credential → add Client Secret for MCPAuthentication principal |
| 2 | Verify Named Credential URL points to /mcp endpoint |
| 3 | Confirm both tools show Active under MCP Servers |
| 4 | Add MCP tools to Agent → Actions |
| 5 | Activate the Agent |
Demo
Salesforce MCP Server registration

Agent action configuration

Live agent response

Production Considerations
| Area | Current State | Production Fix |
|---|---|---|
| Data layer | In-memory Python dicts | Real database (RDS/PostgreSQL) |
| Credentials | Hardcoded in code | AWS Secrets Manager or env vars |
| Process management | Manual uvicorn process | systemd service for auto-restart |
Key Insight
Most demos show an AI agent calling into Salesforce. This shows a Salesforce Agentforce agent calling OUT to an externally hosted MCP server with proper SSL and OAuth — proving Agentforce can i[...]
Tech Stack
- Salesforce Agentforce (Employee Agent)
- External Service Registration (Model Context Protocol)
- Named Credentials + External Credentials (OAuth 2.0)
- Python FastAPI · AWS EC2 · nginx · Let's Encrypt
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。