Salesforce Basic MCP Server
Enables AI assistants to query Salesforce data including retrieving accounts by ID, searching accounts by name, and fetching recent opportunities through authenticated API access.
README
Salesforce Basic MCP Server
A simple Model Context Protocol (MCP) server that provides AI assistants with tools to query Salesforce data.
Features
- ✅ Get Account by ID
- ✅ Search Accounts by name
- ✅ Get recent Opportunities
Setup
1. Install Dependencies
# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install. sh | sh
# Create and activate virtual environment
uv venv
source .venv/bin/activate # Mac/Linux
# OR
. venv\Scripts\activate # Windows
# Install dependencies
uv add "mcp[cli]" simple-salesforce python-dotenv
2. Configure Salesforce Credentials
Create a .env file in the project root:
SF_USERNAME=your@salesforce.email.com
SF_PASSWORD=yourpassword
SF_SECURITY_TOKEN=yoursecuritytoken
SF_DOMAIN=login # or 'test' for sandbox
How to get your Security Token:
- Log into Salesforce
- Click your profile icon → Settings
- On the left sidebar: Personal → Reset My Security Token
- Check your email for the token
3. Run the Server
python server.py
4. Test with MCP Inspector
npx @modelcontextprotocol/inspector python server.py
Available Tools
get_account
Get a Salesforce Account by ID.
Parameters:
account_id(string): The Salesforce Account ID
Example:
{
"account_id": "001XXXXXXXXXXXXXXX"
}
search_accounts
Search for Accounts by name.
Parameters:
name(string): The account name to search for
Example:
{
"name": "Acme"
}
get_recent_opportunities
Get the most recent Opportunities.
Parameters:
limit(integer, optional): Number to return (default: 5, max: 20)
Example:
{
"limit": 10
}
Connect to Claude Desktop
Add to your Claude Desktop config file:
Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config. json
{
"mcpServers": {
"salesforce-basic": {
"command": "python",
"args": ["/absolute/path/to/salesforce-mcp-basic/server.py"],
"env": {
"SF_USERNAME": "your@email.com",
"SF_PASSWORD": "yourpassword",
"SF_SECURITY_TOKEN": "yourtoken",
"SF_DOMAIN": "login"
}
}
}
}
Security Notes
⚠️ Never commit .env to git!
- The
.gitignorefile is configured to exclude it - Use environment variables in production
Troubleshooting
"Authentication Failed"
- Double-check username, password, and security token
- Verify your IP is not blocked in Salesforce
- For sandboxes, use
SF_DOMAIN=test
"Module not found"
- Make sure virtual environment is activated
- Run
uv add "mcp[cli]" simple-salesforce python-dotenv
Next Steps
- Add more Salesforce objects (Contacts, Cases, etc.)
- Implement create/update operations
- Add error logging
- Add data validation
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.