NetHunt CRM MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
NetHunt CRM MCP Server
Local MCP server for NetHunt CRM, built with Python and the official MCP Python SDK, plus an optional Telegram sidecar bot for natural-language control.
Features
stdioby default for local Codex/CLI integrationsOptional
streamable-httptransport for Docker smoke tests and MCP InspectorOptional
aiogramTelegram bot sidecar that talks to the MCP server overstreamable-httpOpenAI Responses API orchestration with
gpt-5.4Private-chat-only Telegram access controlled by
.envallowlisted user IDsUniversal folder discovery across the current NetHunt workspace
Curated tools for auth, discovery, search, reads, comments, call logs, create, update, and delete
Optional automation tools for internal NetHunt workflow APIs via a separate cookie-auth client
Granular automation editor tools for activation, renaming, steps, and splits
Additive metadata enrichment for folders, fields, records, and automation graphs with stable IDs and provenance
Generated MCP schema snapshots under
docs/mcp-schema/Two discovery resources:
nethunt://folders/readablenethunt://folders/{folder_id}/fieldsnethunt://automations/capabilities
Structured JSON responses for every tool call:
Success:
ok,data,metaError:
ok=false,error.code,error.message,error.details
Related MCP server: KommoMCP
Requirements
Python 3.12+
NetHunt CRM email
NetHunt CRM API key
NetHunt API authentication uses the combination email:api_key, not the API key by itself.
Official references:
NetHunt API docs: https://nethunt.com/integration-api
API key help: https://help.nethunt.com/en/articles/4260105-where-to-get-nethunt-api-key
MCP Python SDK: https://py.sdk.modelcontextprotocol.io/
aiogram docs: https://docs.aiogram.dev/en/latest/
OpenAI Responses API: https://developers.openai.com/api/reference/resources/responses/methods/create
Environment
Copy .env.example to .env or export the variables directly:
$env:NETHUNT_EMAIL = "you@example.com"
$env:NETHUNT_API_KEY = "replace-me"Available variables:
NETHUNT_EMAILrequiredNETHUNT_API_KEYrequiredNETHUNT_BASE_URLdefaulthttps://nethunt.comNETHUNT_AUTOMATION_BASE_URLdefaulthttps://nethunt.comNETHUNT_AUTOMATION_COOKIEoptional unless you use automation toolsNETHUNT_AUTOMATION_EXTRA_HEADERS_JSONoptional JSON object of extra headers for automation requestsNETHUNT_AUTOMATION_MANIFEST_JSONoptional JSON object describing supported automation kinds and endpointsNETHUNT_TIMEZONEdefaultEurope/KievNETHUNT_LOG_LEVELdefaultINFOMCP_TRANSPORTdefaultstdioMCP_HOSTdefault127.0.0.1MCP_PORTdefault18044MCP_API_KEYoptional bearer token forstreamable-httpclientsMCP_SERVER_URLoptional public server URL used for MCP OAuth metadataTELEGRAM_BOT_TOKENrequired for the Telegram sidecar botTELEGRAM_ALLOWED_USER_IDSrequired comma-separated Telegram numeric user IDsOPENAI_API_KEYrequired for the Telegram sidecar botOPENAI_MODELdefaultgpt-5.4TELEGRAM_MCP_URLdefaulthttp://127.0.0.1:18044/mcpTELEGRAM_MCP_API_KEYoptional override, defaults toMCP_API_KEY
Automation support uses a separate, thin wrapper over NetHunt's internal web API. It is disabled unless both NETHUNT_AUTOMATION_COOKIE and NETHUNT_AUTOMATION_MANIFEST_JSON are set.
Both console entrypoints automatically load .env at startup when it exists.
Native Setup
python -m venv .venv
.\.venv\Scripts\python -m pip install --upgrade pip
.\.venv\Scripts\python -m pip install -e .[dev]Run locally:
.\.venv\Scripts\nethunt-mcpRun the Telegram bot:
.\.venv\Scripts\nethunt-telegram-botThe Telegram bot:
accepts requests only in private chats
allows only users listed in
TELEGRAM_ALLOWED_USER_IDSkeeps conversation memory and pending approvals in memory only
previews mutating actions before execution
Codex Integration
Native stdio setup:
codex mcp add nethunt-crm-local `
--env NETHUNT_EMAIL=you@example.com `
--env NETHUNT_API_KEY=replace-me `
-- .\.venv\Scripts\nethunt-mcp.exeDocker stdio setup:
codex mcp add nethunt-crm-local-docker `
--env NETHUNT_EMAIL=you@example.com `
--env NETHUNT_API_KEY=replace-me `
-- docker run --rm -i `
-e NETHUNT_EMAIL `
-e NETHUNT_API_KEY `
nethunt-mcp:latestThis project does not modify the existing remote nethunt-crm entry in ~/.codex/config.toml.
Cursor Integration
The repository includes scripts/run_cursor_mcp.ps1, which:
loads local values from
.envsets
PYTHONPATHtosrclaunches the server from
.venv
That lets Cursor use local credentials without copying secrets into the global MCP config.
Add this entry to C:\Users\system_administrator\.cursor\mcp.json:
{
"mcpServers": {
"nethunt-crm-local": {
"command": "powershell",
"args": [
"-NoLogo",
"-NoProfile",
"-ExecutionPolicy",
"Bypass",
"-File",
"C:\\Users\\system_administrator\\Documents\\Repos\\NetHunt-Configuration\\scripts\\run_cursor_mcp.ps1"
]
}
}
}If you already have other global MCP servers, merge the new nethunt-crm-local entry into the existing mcpServers object instead of replacing it.
Docker
Build the image:
docker build -t nethunt-mcp:latest .Run in stdio mode:
docker run --rm -i `
-e NETHUNT_EMAIL=you@example.com `
-e NETHUNT_API_KEY=replace-me `
nethunt-mcp:latestRun both the MCP HTTP service and the Telegram sidecar bot:
docker compose up --buildThe MCP service listens on http://127.0.0.1:18044/mcp. The Telegram bot runs as a second container and connects to the MCP service over the internal Compose network.
Telegram Bot Safety
The bot mirrors MCP tools into OpenAI function tools and executes them locally through the MCP client.
Read-only results are model-mediated.
Mutating tools never execute directly from the model.
delete_record,delete_automation,raw_post, and automation write tools use the MCP server's built-in preview/confirmation flow.create_record,update_record,create_record_comment, andcreate_call_loguse a host-generated preview because the underlying MCP tools do not expose a preview mode.Every mutating request pauses for an explicit Telegram
Approve/Cancelaction before execution.Pending approvals expire after 15 minutes.
Tools
auth_testlist_readable_folderslist_writable_folderslist_folder_fieldslist_automation_field_referencesget_recordsearch_recordslist_new_recordslist_updated_recordslist_record_changescreate_recordupdate_recordcreate_record_commentcreate_call_logdelete_recordraw_getraw_postlist_automation_kindslist_automationsget_automationcreate_automationupdate_automationdelete_automationset_automation_enabledactivate_automationdeactivate_automationrename_automationget_automation_step_detailsadd_automation_stepupdate_automation_stepdelete_automation_stepadd_automation_split
Delete Safety
delete_record requires confirm=true. Without confirmation, the tool returns a guard response with a preview payload and no deletion.
Raw Escape Hatch
raw_get(operation, params)supports only documented allowlisted GET operations.raw_post(operation, body, confirm_write)supports only documented allowlisted POST operations.raw_postreturns a preview unlessconfirm_write=true.
For raw operations, path placeholders can be passed directly in the input object. Example:
{
"folder_id": "folder-123",
"fields": {
"Name": "Ada Lovelace"
},
"timeZone": "Europe/Kiev"
}Discovery Metadata
list_readable_foldersandlist_writable_folderskeep the raw folder objects but also addfolderId,folderName,access, andmetadataSource.list_folder_fields(folder_id)keeps the raw field objects but also addsfolderId,fieldName,fieldId,fieldType,fieldOptions,referenceCount,referencedBy,referencePaths, andmetadataSource.Record read/search tools (
get_record,search_records,list_new_records,list_updated_records,list_record_changes) now enrich record-like payloads withfolderId,fieldIds,fieldMetadata, andfieldNameswhen folder metadata is available. If field enrichment fails, the original record payload is still returned.metadataSourceshows whether a value came directly from the folder metadata or was inferred from automation imports.
Automation Tools
Lifecycle automation tools remain manifest-driven:
list_automations,get_automation,create_automation,update_automation,delete_automation, andset_automation_enabled.list_automationsand automation write results now include normalizedimports, top-levelfieldReferences, andreferenceCountin addition to the raw NetHunt payload.get_automation(include_branches=true)returns a normalized branch/step graph with stablebranchId,branchNum,stepId,stepNum,role,type, per-stepfieldReferences, and a summarizedbranchGraph.get_automation_step_detailsstill returns the raw step-detail payload, but now also addskind,automationId,stepNum,listOptions, and, when available,branchId,stepId,role,type, andfieldReferences.list_automation_field_references(folder_id)shows whichfieldIdvalues are already referenced by existing automations for a folder, plusreferencePaths, best-effortfieldName/fieldType/fieldOptions, andmetadataSource.Editor automation tools expose the captured NetHunt RPC model directly: activation, deactivation, rename, step detail reads, step add/update/delete, and split add.
All mutating automation tools use
preview -> confirmsemantics.delete_automationrequiresconfirm=true.Every other automation write tool requires
confirm_write=true.list_automation_kindsreturns only manifest entries that define the full lifecycle, and now also reports optionaleditorOperations.Automation error envelopes such as
status: ERRORare normalized into MCP error codes likenot_foundandvalidation_errorinstead of surfacing as genericinvalid_response.Manifest templates can reference
kind,automation_id,enabled,enabled_command,payload, andoperation_name, plus tool-specific context such asname,step_num,step_type,list_options,branch_id,role,step_id, andchild_branch_num.
Getting Automation Cookies
NETHUNT_AUTOMATION_COOKIE is not an API key. It is the browser session Cookie header from an authenticated NetHunt web session.
Use this workflow:
Log in to NetHunt in Chrome, Edge, or another Chromium-based browser.
Open DevTools with
F12.Open the
Networktab and filter byFetch/XHR.In NetHunt, open the page that uses the automation feature you want to reverse-engineer, for example Workflows.
Click one of the internal API requests for that page, for example a request like
/api/workflows.In
Headers, copy the fullCookierequest header value intoNETHUNT_AUTOMATION_COOKIE.If the same request includes additional auth headers such as
Authorization,X-CSRF-Token, or similar custom headers, copy them intoNETHUNT_AUTOMATION_EXTRA_HEADERS_JSON.
Example:
$env:NETHUNT_AUTOMATION_COOKIE = "session=...; other_cookie=..."
$env:NETHUNT_AUTOMATION_EXTRA_HEADERS_JSON = '{"Authorization":"Basic ...","X-CSRF-Token":"..."}'Notes:
Treat the cookie like a password. Do not commit it to git or paste it into
README.md.Session cookies expire. If automation calls start returning
401or403, capture a fresh value from the browser.Some NetHunt internal endpoints send both
CookieandAuthorization. If the captured request has both, copy both. Do not assume the cookie alone is sufficient.The cookie alone is not enough to discover endpoints. You still need
NETHUNT_AUTOMATION_MANIFEST_JSONwith the exact method, path, and response shape for each supported automation kind.
Minimal manifest example:
{
"workflow": {
"label": "Workflows",
"name_path": "attributes.name",
"enabled_path": "attributes.enabled",
"operations": {
"list": {
"method": "GET",
"path": "/api/workflows",
"response_path": "items"
},
"get": {
"method": "GET",
"path": "/api/workflows/{automation_id}",
"response_path": "item"
},
"create": {
"method": "POST",
"path": "/api/workflows",
"json": "$payload",
"response_path": "item"
},
"update": {
"method": "PUT",
"path": "/api/workflows/{automation_id}",
"json": "$payload",
"response_path": "item"
},
"delete": {
"method": "DELETE",
"path": "/api/workflows/{automation_id}"
},
"set_enabled": {
"method": "PATCH",
"path": "/api/workflows/{automation_id}/state",
"json": {
"enabled": "$enabled"
},
"response_path": "item"
}
}
}
}Command-based editor example:
{
"workflow": {
"label": "Workflows",
"name_path": "result.automation.name",
"enabled_path": "result.automation.enabled",
"operations": {
"list": {
"method": "POST",
"path": "/api/commands",
"json": [
{
"service": "automation",
"name": "getAutomations",
"data": {
"workspaceId": "workspace-id"
},
"id": "1"
}
],
"response_path": "0.result.automations"
},
"get": {
"method": "POST",
"path": "/api/command",
"json": {
"service": "automation",
"name": "getAutomationDetails",
"data": {
"workspaceId": "workspace-id",
"automationId": "{automation_id}"
}
},
"response_path": "result.automation"
},
"create": {
"method": "POST",
"path": "/api/command",
"json": "$payload"
},
"update": {
"method": "POST",
"path": "/api/command",
"json": "$payload"
},
"delete": {
"method": "POST",
"path": "/api/command",
"json": {
"service": "automation",
"name": "deleteAutomation",
"data": {
"workspaceId": "workspace-id",
"automationId": "{automation_id}"
}
}
},
"set_enabled": {
"method": "POST",
"path": "/api/command",
"json": {
"service": "automation",
"name": "{enabled_command}",
"data": {
"workspaceId": "workspace-id",
"automationId": "{automation_id}"
}
}
}
},
"editor_operations": {
"rename": {
"method": "POST",
"path": "/api/command",
"json": {
"service": "automation",
"name": "updateAutomationName",
"data": {
"workspaceId": "workspace-id",
"automationId": "{automation_id}",
"name": "{name}"
}
}
},
"get_step_details": {
"method": "POST",
"path": "/api/commands",
"json": [
{
"service": "automation",
"name": "getStepDetails",
"data": {
"workspaceId": "workspace-id",
"automationId": "{automation_id}",
"stepNum": "$step_num",
"listOptions": "$list_options"
},
"id": "90"
}
],
"response_path": "0.result"
},
"add_step": {
"method": "POST",
"path": "/api/command",
"json": {
"service": "automation",
"name": "addStep",
"data": {
"workspaceId": "workspace-id",
"automationId": "{automation_id}",
"branchId": "$branch_id",
"role": "$role",
"type": "$step_type",
"options": "$payload"
}
}
}
}
}
}Schema Export
Export the current MCP protocol surface into local reference files:
.\.venv\Scripts\python.exe .\scripts\export_mcp_schema.pyThis writes:
docs/mcp-schema/tools-list.jsondocs/mcp-schema/resources-list.jsondocs/mcp-schema/tools/*.jsondocs/mcp-schema/resources/*.json
Regenerate these snapshots any time you add, remove, or rename MCP tools or resources.
Tests
.\.venv\Scripts\python -m pytestTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
API-first CRM for LLMs - contacts, companies, deals and activities over a native MCP server.
A CRM you talk to: leads, deals and a pipeline board inside ChatGPT, Grok and other MCP clients.
Unofficial remote MCP server for Less Annoying CRM: OAuth 2.1, read-only grants, 10 tools.
CRM + visual automation builder AI agents can drive via MCP: contacts, tags, maps, email/SMS flows.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides a REST API and MCP server to interact with Bitrix24 CRM, enabling CRUD operations on entities like deals, leads, contacts, and tasks via natural language.13-
- FlicenseNot gradedqualityDmaintenanceAI-powered CRM assistant for Kommo/amoCRM that provides natural language management via Telegram bot and MCP protocol, enabling analytics, entity operations, and CRM setup.8-
- AlicenseNot gradedqualityBmaintenanceProvides MCP tools to interact with GoHighLevel CRM data, including contacts, conversations, call transcripts, broker lead overviews, pipelines/opportunities, and task creation. Supports both stdio and HTTP transports for local and remote use.ISC
- AlicenseCqualityDmaintenanceMCP server that exposes the Kommo CRM API v4 (plus Files, Conversations, and analytics helpers) as Model Context Protocol tools, resources, and prompts.100MIT