
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
espocrm-mcp-server
Advanced tools
A Model Context Protocol (MCP) server for interacting with the EspoCRM API.
A Model Context Protocol (MCP) server designed to interact with the EspoCRM API.
This server allows language models and other MCP clients to perform common CRUD (Create, Read, Update, Delete) operations and search actions within an EspoCRM instance.
This server provides the following tools:
get_record
: Fetches details of a specific EspoCRM record by its type (e.g., Contact
, Account
) and ID.create_record
: Creates a new record in EspoCRM (e.g., a new Lead
).update_record
: Updates an existing record in EspoCRM.delete_record
: Deletes a record from EspoCRM.search_records
: Searches for EspoCRM records based on specified criteria using EspoCRM's search parameters.get_related_records
: Retrieves records linked to a specific EspoCRM record via a defined relationship (e.g., contacts
for an Account
).This server requires two pieces of information to connect to your EspoCRM instance:
https://mycrm.example.com
).These can be provided as command-line arguments or environment variables (see Configuration Methods below).
Additionally, you can configure:
All settings can be configured using either command-line arguments or environment variables:
Setting | Command-line Arg (position) | Environment Variable | Default |
---|---|---|---|
Site URL | 1st argument | ESPOCRM_SITE_URL | (Required) |
API Key | 2nd argument | ESPOCRM_API_KEY | (Required) |
Ignore SSL | 3rd argument: ignore-ssl | ESPOCRM_IGNORE_SSL=true | false |
API Timeout | N/A | ESPOCRM_API_TIMEOUT | 15000 (ms) |
Command-line arguments take precedence over environment variables.
Once the package is published to npm (e.g., as espocrm-mcp-server
or @your-scope/espocrm-mcp-server
), you can configure your MCP client to run it using npx
.
Add the following to your MCP settings file (adjust paths/names as needed):
~/Library/Application Support/Code - Insiders/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
// ... other servers
"espocrm": {
"command": "npx",
"args": [
"espocrm-mcp-server", // Or your scoped package name @your-scope/espocrm-mcp-server
"YOUR_ESPOCRM_SITE_URL", // Arg 1: Site URL
"YOUR_ESPOCRM_API_KEY", // Arg 2: API Key
"ignore-ssl" // Arg 3: Optional - disable SSL verification
],
"env": {
"ESPOCRM_SITE_URL": "YOUR_ESPOCRM_SITE_URL", // Alternative to args[0]
"ESPOCRM_API_KEY": "YOUR_ESPOCRM_API_KEY", // Alternative to args[1]
"ESPOCRM_IGNORE_SSL": "true", // Alternative to args[2]
"ESPOCRM_API_TIMEOUT": "30000" // Custom timeout in ms (30s)
},
"disabled": false,
"autoApprove": []
}
}
}
Important:
espocrm-mcp-server
with your actual published package name if different.ignore-ssl
and its environment variable counterpart ESPOCRM_IGNORE_SSL=true
will disable SSL certificate verification. This is useful when working with self-signed certificates or local development environments.If you haven't published the package, you can run it directly using Node.
{
"mcpServers": {
// ... other servers
"espocrm": {
"command": "node",
"args": [
"/path/to/espocrm-server/build/index.js", // <-- Update this path
"YOUR_ESPOCRM_SITE_URL", // Arg 1: Site URL
"YOUR_ESPOCRM_API_KEY", // Arg 2: API Key
"ignore-ssl" // Arg 3: Optional - disable SSL verification
],
"env": {
"ESPOCRM_API_TIMEOUT": "30000" // Custom API timeout (30s)
},
"disabled": false,
"autoApprove": []
}
}
}
If using Docker, you can set environment variables with the -e
flag:
docker run -i --rm \
-e ESPOCRM_SITE_URL=https://your-crm.example.com \
-e ESPOCRM_API_KEY=your_api_key_here \
-e ESPOCRM_IGNORE_SSL=true \
-e ESPOCRM_API_TIMEOUT=30000 \
espocrm-mcp-server
Alternatively, use command-line arguments:
docker run -i --rm espocrm-mcp-server https://your-crm.example.com your_api_key_here ignore-ssl
If you encounter errors like:
MCP error -32603: EspoCRM API Error: unable to get local issuer certificate (Status: undefined)
This indicates an SSL certificate validation issue. This commonly happens with:
To fix this, you can disable SSL verification in one of these ways:
ignore-ssl
as the third command-line argumentESPOCRM_IGNORE_SSL=true
Security Note: Only disable SSL verification in trusted or development environments. In production, always use proper SSL certificates and keep verification enabled.
Once configured and running, you can invoke the tools using the server name espocrm
.
Example:
"Use the espocrm
server to get the Contact record with ID 6abcdef1234567890
."
<use_mcp_tool>
<server_name>espocrm</server_name>
<tool_name>get_record</tool_name>
<arguments>
{
"entityType": "Contact",
"id": "6abcdef1234567890"
}
</arguments>
</use_mcp_tool>
This server is built with TypeScript.
Install dependencies:
npm install
Build the server (compiles TypeScript to JavaScript in build/
):
npm run build
For development with auto-rebuild on file changes:
npm run watch
This project includes a Dockerfile
for running the server in a container.
1. Build the Image:
Navigate to the espocrm-server
directory in your terminal and run:
docker build -t espocrm-mcp-server .
(You can replace espocrm-mcp-server
with your preferred image tag)
2. Run the Container:
Run the container, passing the Site URL and API Key as command-line arguments after the image name. Since MCP uses standard input/output for communication, you need to run it interactively (-i
).
docker run -i --rm espocrm-mcp-server YOUR_ESPOCRM_SITE_URL YOUR_ESPOCRM_API_KEY
Replace YOUR_ESPOCRM_SITE_URL
and YOUR_ESPOCRM_API_KEY
with your actual credentials. The --rm
flag automatically removes the container when it exits.
(Note: Integrating a Dockerized MCP server with clients like the VS Code extension might require custom configuration or wrapper scripts, as the client typically expects to launch a local process directly.)
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
npm run inspector
The Inspector will provide a URL to access debugging tools in your browser, allowing you to see requests and responses flowing through the server.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A Model Context Protocol (MCP) server for interacting with the EspoCRM API.
The npm package espocrm-mcp-server receives a total of 2 weekly downloads. As such, espocrm-mcp-server popularity was classified as not popular.
We found that espocrm-mcp-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.