vtiger-mcp

vtiger-mcp

MCP server for vtiger CRM that enables AI agents to log timesheets and create/update records in any module via natural language.

Category
访问服务器

README

vtiger-mcp

npm version license: MIT node

MCP server + CLI for vtiger CRM. Connect any AI agent (Claude Desktop, Claude Code, Cursor, …) to your vtiger CRM to log timesheets and create / update records in any module — in plain English.

It talks to vtiger's built-in REST API (/webservice.php, available in vtiger 6.x / 7.x). It adds no access rules of its own: every call runs as the authenticated user, so vtiger enforces that user's role, profile, and row-level sharing automatically. Each person uses their own Webservice Access Key, so they only see and change what their account already allows.

New to the terminal? See SETUP.md for a click-by-click, non-developer guide.


🤖 Install with an AI agent (copy-paste prompt)

Don't want to edit config files yourself? Copy the whole prompt below and paste it into an AI agent that can edit files (Claude Code, Cursor, Windsurf, Gemini CLI, OpenAI Codex, VS Code Copilot Agent, …). It will ask for your details and set everything up for you.

Install and configure the "vtiger-mcp" MCP server for me (npm package name: vtiger-mcp).
It lets me log vtiger CRM timesheets and create/update records in any module from this agent.

Do this:
1. Verify Node.js 18+ is installed (run: node --version). If it's missing, tell me to install
   the LTS from https://nodejs.org and stop.
2. Ask me for these and WAIT for my answers:
   - VTIGER_URL: my vtiger base URL, e.g. https://yourcrmdomain.com (no /webservice.php)
   - VTIGER_USERNAME: my vtiger login username
   - VTIGER_ACCESS_KEY: my "Webservice Access Key" from vtiger -> My Preferences (NOT my password)
3. Detect which MCP client I use and find its config file:
   - Claude Desktop: %APPDATA%\Claude\claude_desktop_config.json (Windows) or
     ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
   - Cursor: ~/.cursor/mcp.json ; Windsurf: ~/.codeium/windsurf/mcp_config.json ;
     Gemini CLI: ~/.gemini/settings.json  (all use the "mcpServers" JSON key)
   - VS Code: ./.vscode/mcp.json  (uses a top-level "servers" key with "type": "stdio")
   - OpenAI Codex CLI: ~/.codex/config.toml  (TOML table [mcp_servers.vtiger])
   If you can't tell, ask me which client I'm using.
4. Back up that file, then MERGE IN (do not overwrite my other servers) a server named "vtiger":
   command: npx
   args: ["-y", "vtiger-mcp"]
   env: { VTIGER_URL, VTIGER_USERNAME, VTIGER_ACCESS_KEY, VTIGER_ALLOW_DELETE: "false" }
   Use the correct shape for my client (mcpServers JSON, VS Code "servers", or Codex TOML).
5. Keep my access key ONLY in this local config. Never commit it, echo it back in full, or share it.
6. (Optional) Verify auth by running, with those env vars set:  npx -p vtiger-mcp vtiger whoami
   It should print my vtiger userId.
7. Tell me to fully quit and reopen my client, then try: "list my vtiger modules"
   or "log 2 hours to <task name> today".

Prefer to do it manually? See CLIENTS.md for every client's exact config.


Features

  • 🔐 Per-user auth via each user's Webservice Access Key — row-level access preserved, nothing centralized.
  • 🧩 Any module: create, update, query, describe, retrieve, delete — subject to the user's permissions.
  • ⏱️ Timesheet helpers for the time-tracking module (create/list/update entries, resolve tasks by name).
  • 🖥️ Ships as both an MCP server (for AI agents) and a CLI.
  • 📦 Zero changes to your vtiger install. Node 18+, no native deps.

Requirements

  • Node.js 18+
  • A vtiger CRM (6.x / 7.x) whose /webservice.php endpoint is reachable
  • Your Webservice Access Key — in the CRM: My Preferences → "Webservice Access Key" (a 16-char string; not your login password)

Install

# Global (gives you the `vtiger` CLI and the `vtiger-mcp` server binary)
npm install -g vtiger-mcp

# …or run without installing
npx vtiger-mcp        # starts the MCP server (stdio)

Or from source:

git clone https://github.com/ViralP17/vtiger-mcp.git
cd vtiger-mcp
npm install
npm run build

Configure

Set three environment variables (via your MCP client config, or a .env file for the CLI — see .env.example):

Variable Example Notes
VTIGER_URL https://yourcrmdomain.com Base URL, no /webservice.php
VTIGER_USERNAME your.username Your vtiger login
VTIGER_ACCESS_KEY xxxxxxxxxxxxxxxx Webservice Access Key
VTIGER_ALLOW_DELETE false Set true to allow delete

Use as an MCP server

Point your AI client at vtiger-mcp and pass your credentials in env.

Via npx (after npm install -g vtiger-mcp or letting npx fetch it):

{
  "mcpServers": {
    "vtiger": {
      "command": "npx",
      "args": ["-y", "vtiger-mcp"],
      "env": {
        "VTIGER_URL": "https://yourcrmdomain.com",
        "VTIGER_USERNAME": "your.username",
        "VTIGER_ACCESS_KEY": "your-access-key",
        "VTIGER_ALLOW_DELETE": "false"
      }
    }
  }
}

From a source checkout (use node + the built server path):

{
  "mcpServers": {
    "vtiger": {
      "command": "node",
      "args": ["/path/to/vtiger-mcp/dist/mcp/server.js"],
      "env": { "VTIGER_URL": "https://yourcrmdomain.com", "VTIGER_USERNAME": "your.username", "VTIGER_ACCESS_KEY": "your-access-key" }
    }
  }
}
  • Claude Desktop config: %APPDATA%\Claude\claude_desktop_config.json (Windows) / ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)

📎 Using Cursor, VS Code, Windsurf, Antigravity, OpenAI Codex CLI, Gemini CLI, or another client? See CLIENTS.md for the exact config file and format for each — it's the same server everywhere.

Then just ask, e.g. "Log 3 hours to the Website Redesign task today as regular hours" or "Show my timesheets this week."

Use as a CLI

export VTIGER_URL=https://yourcrmdomain.com
export VTIGER_USERNAME=your.username
export VTIGER_ACCESS_KEY=your-access-key   # or put these in a .env file

vtiger whoami
vtiger modules
vtiger describe TimeControl
vtiger query "SELECT tc_code, date_start, totaltime FROM TimeControl LIMIT 5;"
vtiger log-timesheet --task "Website Redesign" --start 10:00 --end 13:00 --type "Regular Hours" --activity "API work"
vtiger my-timesheets --from 2026-07-01 --to 2026-07-31
vtiger create ProjectTask --set projecttaskname="Write docs" --set projectid=<id>
vtiger update 17x1234 --set description="Revised notes"

Tools exposed to the AI agent

Any module (scoped to your access):

Tool What it does
list_modules Modules you can access
describe_module Live fields of a module (names, mandatory, picklists, references)
query Read-only VTQL SELECT
retrieve_record Fetch one record by id
create_record Create a record in any writable module
update_record Partial update of a record
delete_record Delete (only if VTIGER_ALLOW_DELETE=true)

Timesheet helpers (the time-tracking module):

Tool What it does
whoami Your vtiger user id / profile
list_my_projects Projects you can access
list_my_tasks Project tasks (for the related_to link)
log_timesheet Add a daily entry (resolves task, defaults date/owner, computes total)
list_my_timesheets Your entries in a date range
update_timesheet Edit an existing entry

Notes & tips

  • Field names vary per install. vtiger schemas are customizable, so always describe_module (or vtiger describe <Module>) first to learn the exact field names before creating/updating.
  • Ids are vtiger "webservice ids" like 17x1234 (<moduleId>x<recordId>). Reference fields (owner, related_to, projectid) expect these ids; the timesheet helpers resolve task names to ids for you.
  • The timesheet module is configurable (see below). It defaults to TimeControl; point it at your module without touching code.
  • Deletes are off by default. Set VTIGER_ALLOW_DELETE=true only if you want the agent/CLI to delete records (and your account has that right).
  • Security. Your access key is a secret — keep it in your local .env or client config only. Use HTTPS. Nothing is centralized; each user runs their own copy with their own key.

Configuring the timesheet module (other vtiger installs)

The timesheet helpers default to the TimeControl module with ProjectTask/Project links. If your install uses different module or field names, set these env vars (all optional) — no code changes needed:

Variable Default Purpose
VTIGER_TIMESHEET_MODULE TimeControl Time-entry module
VTIGER_TASK_MODULE ProjectTask Module linked from an entry
VTIGER_PROJECT_MODULE Project Project module

Advanced field-name overrides (rarely needed): VTIGER_TS_DATE_START_FIELD, VTIGER_TS_DATE_END_FIELD, VTIGER_TS_TIME_START_FIELD, VTIGER_TS_TIME_END_FIELD, VTIGER_TS_RELATED_FIELD, VTIGER_TS_DESC_FIELD, VTIGER_TS_HOURSTYPE_FIELD, VTIGER_TS_TOTAL_FIELD, VTIGER_TS_OWNER_FIELD, VTIGER_TASK_NAME_FIELD, VTIGER_TASK_PROJECT_FIELD, VTIGER_PROJECT_NAME_FIELD. See .env.example for the full list and defaults.

Whatever your modules are named, the generic create_record, update_record, query, and describe_module tools always work.

License

MIT © ViralP17

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选