EspoCRM Assistant
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@EspoCRM Assistant show me the top 5 open opportunities by amount"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
EspoCRM Assistant
Constrained EspoCRM access for issue #28. The assistant-visible MCP server can read records and prepare signed change sets; it cannot apply or delete anything. See the evaluation for the build-vs-wrap decision and security boundary.
This service requires an existing EspoCRM deployment. It does not install, enable, migrate, or administer EspoCRM. The Keep Platform or another GitOps repository should consume a published image from this repository and provide Kubernetes deployment configuration, secrets, probes, ingress, and operator runbooks.
Local Development
python -m venv .venv
. .venv/bin/activate
pip install -e .
export ESPOCRM_URL=https://crm.example.com
export ESPOCRM_READ_API_KEY=...
thekeep-espocrm-mcpRun the dependency-free tests with:
PYTHONPATH=src python -m unittest discover -s tests -vRelated MCP server: DB MCP Gateway
Runtime Modes
The stdio MCP entrypoint is for local evaluation:
thekeep-espocrm-mcpRun streamable HTTP MCP for an internal gateway:
export ESPOCRM_MCP_HOST=0.0.0.0
export ESPOCRM_MCP_PORT=8080
export ESPOCRM_MCP_PATH=/mcp
thekeep-espocrm-mcp-httpDo not expose the streamable HTTP endpoint directly to the internet. Production should keep it internal and place OAuth/OIDC and per-user authorization in front of it through the platform MCP gateway tracked by #54.
The container default command is the service HTTP entrypoint:
thekeep-espocrm-httpIt exposes:
GET /healthzauthenticated
POST /crm/*read and prepare endpoints usingESPOCRM_ASSISTANT_TOKENauthenticated
POST /approval/apply-changeusingESPOCRM_ASSISTANT_APPLY_TOKEN
Apply a reviewed change set outside the assistant, either locally:
thekeep-espocrm-apply change.json \
--approve-sha256 <sha256> \
--approved-by <human-identity>or through the deployed approval endpoint:
curl -fsS http://espocrm-assistant.espocrm.svc.cluster.local:8090/approval/apply-change \
-H "Authorization: Bearer ${ESPOCRM_ASSISTANT_APPLY_TOKEN}" \
-H "Content-Type: application/json" \
--data @approved-change.jsonapproved-change.json must contain change, approved_sha256, and
approved_by. The approval endpoint uses separate write credentials and is not
registered as an MCP tool.
Use separate read-only and write-capable Espo API users. The executor reads
ESPOCRM_WRITE_API_KEY; optional HMAC secrets use the same READ_/WRITE_
prefix. The deployed approval endpoint additionally requires
ESPOCRM_ASSISTANT_APPLY_TOKEN and writes audit records to
ESPOCRM_ASSISTANT_AUDIT_LOG. Writes require source attribution; Opportunity
writes also require reciprocal signal evidence or an explicit human override.
The executor rejects stale updates, adds an Espo Note, and appends a mode-0600
audit record.
Configuration
Use a least-privilege EspoCRM API user for reads and a separate write-capable API user for the approval executor. Do not reuse admin credentials.
Variable | Required | Purpose |
| yes | Existing EspoCRM base URL. HTTPS is required unless |
| yes | Read-only EspoCRM API key used by assistant-visible tools. |
| no |
|
| for read HMAC | HMAC secret for the read API user. |
| for apply | Write-capable EspoCRM API key used only by approval/apply paths. |
| no |
|
| for write HMAC | HMAC secret for the write API user. |
| for HTTP | Bearer token for the custom JSON HTTP API. |
| for HTTP apply | Separate bearer token for |
| no | JSONL audit path; defaults under |
| no | HTTP service bind host; default |
| no | HTTP service port; default |
| no | Streamable HTTP MCP bind host; default |
| no | Streamable HTTP MCP port; default |
| no | Streamable HTTP MCP path; default |
| no |
|
| no | Set to |
Image Publishing
The CI workflow tests the package and builds the container image on every pull
request. Pushes to main and v* tags publish to GHCR by default:
ghcr.io/the-keep-studios/espocrm-assistant:sha-<git-sha>
ghcr.io/the-keep-studios/espocrm-assistant:vX.Y.ZThe workflow also publishes latest on main for convenience, but downstream
GitOps deployments should pin a sha-* tag, release tag, or digest.
The OCI registry is replaceable. Set these repository variables/secrets before running the workflow if publishing somewhere other than GHCR:
variable
OCI_REGISTRY: registry hostname, for exampleregistry.example.comvariable
OCI_IMAGE: full image name, for exampleregistry.example.com/thekeep/espocrm-assistantvariable
OCI_USERNAME: registry username when it differs from the GitHub actorsecret
OCI_PASSWORD: registry password or token
For non-GitHub installs, build or mirror the image with standard OCI tooling and update the consuming platform manifest to that immutable tag or digest.
Available Tools
7 toolscrm_duplicate_candidatesC
Find possible duplicates from identifying fields.
Inputs: fields (required).
crm_export_csvC
Export validated change sets as CSV for manual import.
Inputs: changes (required). Returns: result
crm_getC
Read one allowlisted CRM record.
Inputs: entity (required), record_id (required), fields.
crm_metadataA
Read allowlisted field metadata for one entity.
Inputs: entity (required).
crm_prepare_changeC
Prepare and hash a non-mutating create or update change set.
Inputs: request (required).
crm_prepare_lead_conversionC
Prepare linked Lead-to-Opportunity change sets for human approval.
Inputs: request (required).
crm_searchC
Search allowlisted CRM records without mutation.
Inputs: entity (required), filters, text, fields, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct CRM operation: duplicate detection, CSV export, single record retrieval, metadata, change preparation, lead conversion preparation, and search. No overlap in functionality; an agent can easily distinguish them.
All tools use the 'crm_' prefix with a verb-based name, e.g., 'crm_search', 'crm_get'. However, 'crm_get' lacks a noun (like 'record'), and 'crm_metadata' uses a noun as a verb, which is slightly inconsistent but still clear.
Seven tools is well-scoped for a CRM assistant focused on read, search, duplicate detection, and preparation of change sets for human approval. No unnecessary tools, and the count supports a focused workflow.
The toolset covers core read, search, metadata, duplicate checking, change preparation, lead conversion preparation, and export. Missing direct mutation (create/update/delete) is intentional for a non-mutating, human-approval workflow. A minor gap is the lack of a list-all-entities tool, but search can compensate.
Related MCP Connectors
Read-only sales CRM for AI clients: leads, pipeline, AI-agent chats, calls, ad attribution.
Read-only AI access to HAVN properties, leads, tasks, files, media, and analytics.
Read-only access to your VeloCapture leads, RFPs, contacts and drafts from an AI assistant.
Read-only finance and operations controls for AI agents with evidence and safe next actions.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables read-only SQL database access for AI assistants, allowing schema exploration and safe query execution without risk of data modification.-
- AlicenseNot gradedqualityCmaintenanceProvides read-only access to databases for MCP-compatible AI tools, allowing schema exploration and SELECT queries without exposing credentials or risking data changes.67 npm3MIT
- AlicenseAqualityDmaintenanceA read-only MCP server that enables AI assistants to query Freshsales CRM data (leads, contacts, deals, accounts) via search, saved views, and record lookup.5MIT
- AlicenseNot gradedqualityBmaintenanceEnables read-only file-management operations from AI assistants, including health checks, connection and folder listings, search, share-link resolution, metadata retrieval, and on-demand document reading.MIT