monica-mcp
monica-mcp
A full-coverage Model Context Protocol server for Monica CRM. 29 tools covering all 30 API endpoints — search contacts, log activities, manage notes/tasks/reminders, track relationships, and more.
Designed for AI assistants like Claude Desktop, Hermes, Cline, and any MCP-compatible client.
Note: This project is 100% AI-generated. The code, tests, CI/CD, and documentation were all written by an AI agent (Hermes). No human wrote any of the code.
Tested against a live Monica v4.1.2 instance on the author's homelab. All 29 tools validated with create → read → update → delete lifecycle tests. Test data was cleaned up after verification.
Design Philosophy
Action-based tools (not one tool per CRUD op)
Most MCP servers expose 5 separate tools per entity (list, get, create, update, delete). With 30 entities that's 150 tools — flooding the LLM's context window with ~50K+ tokens just for tool definitions. Research shows tool selection accuracy degrades quickly past 15-20 tools.
This server uses one tool per entity with an action parameter:
monica_contact(action: "list" | "get" | "create" | "update" | "delete", ...)Result: 29 tools instead of 150+, ~10-15K tokens for definitions, and better tool selection accuracy.
Safety by design
Delete is an action, not a tool — the AI must explicitly pass
action: "delete"rather than calling a tool named "delete"Read-only mode — set
MONICA_READ_ONLY=trueto block all write operationsDelete protection — set
MONICA_DISABLE_DELETE=trueto block only deletesTool exclusion — set
MONICA_EXCLUDE_TOOLS=monica_contact,monica_tagto remove specific toolsRead-only entities — countries, currencies, genders have no create/update/delete actions
Delete warnings — every tool description includes "⚠️ delete is irreversible"
Quick Start
npx (recommended)
{
"mcpServers": {
"monica": {
"command": "npx",
"args": ["-y", "monica-mcp"],
"env": {
"MONICA_BASE_URL": "https://your-monica-instance.com",
"MONICA_API_TOKEN": "your-bearer-token"
}
}
}
}Read-only mode (recommended for exploration)
{
"mcpServers": {
"monica": {
"command": "npx",
"args": ["-y", "monica-mcp"],
"env": {
"MONICA_BASE_URL": "https://your-monica-instance.com",
"MONICA_API_TOKEN": "your-bearer-token",
"MONICA_READ_ONLY": "true"
}
}
}
}Local development
git clone https://github.com/philipp-mlr/monica-mcp.git
cd monica-mcp
npm install
npm run build
MONICA_BASE_URL=https://your-monica-instance.com MONICA_API_TOKEN=your-token node dist/index.jsConfiguration
Environment Variable | Required | Default | Description |
| Yes | — | Bearer token for Monica API |
| No |
| Your Monica instance URL |
| No |
| Block all create/update/delete operations |
| No |
| Block only delete operations |
| No | — | Comma-separated tool names to exclude |
Getting an API token
In Monica, go to Settings → API → Create New Token. Copy the generated Bearer token.
Tool Reference
All 29 tools use an action parameter. Available actions vary per entity — see each tool's description for details.
Contact Management
Tool | Actions | Description |
| list, get, create, update, delete, search, set_tags, update_career, list_activities, list_calls, list_addresses, list_notes, list_tasks, list_reminders, list_gifts, list_debts, list_relationships, list_conversations, list_photos, list_documents, list_fields, list_audit_logs, assign_tag, remove_tag | Full contact management with 15+ contact-scoped sub-queries |
| list, get, create, update, delete | Address CRUD |
| list, get, create, update, delete | Contact field CRUD (email, phone, etc.) |
| list, get, create, update, delete | Contact field type CRUD |
| list, get, create, update, delete | Company CRUD |
| list, get, create, update, delete | Occupation CRUD |
| list, get, create, update, delete | Contact group CRUD |
Communication
Tool | Actions | Description |
| list, get, create, update, delete | Activity CRUD |
| list, get, create, update, delete | Activity type CRUD |
| list, get | Activity type categories (read-only) |
| list, get, create, update, delete | Call log CRUD |
| list, get, create, update, delete, list_messages, add_message, update_message, delete_message | Conversation + message threading |
Productivity
Tool | Actions | Description |
| list, get, create, update, delete | Note CRUD |
| list, get, create, update, delete | Task CRUD |
| list, get, create, update, delete | Reminder CRUD |
| list, get, create, update, delete | Tag CRUD |
| list, get, create, update, delete | Journal entry CRUD |
Professional & Financial
Tool | Actions | Description |
| list, get, create, update, delete | Relationship CRUD |
| list, get | Relationship types (read-only per API) |
| list, get | Relationship type groups (read-only per API) |
| list, get, create, update, delete, associate_photo | Gift CRUD + photo association |
| list, get, create, update, delete | Debt CRUD |
Reference Data (read-only)
Tool | Actions | Description |
| list, get | Countries |
| list, get | Currencies |
| list, get | Genders |
| list | Audit logs |
| get | Authenticated user info |
| list, get | Photos (upload not supported by Monica API) |
| list, get | Documents (upload not supported by Monica API) |
API Limitations
Feature | Status | Reason |
Photo upload | Not supported | Monica API returns 405 |
Document upload | Not supported | Monica API returns 405 |
Tech Stack
Node.js 18+ — runtime
TypeScript — type safety
@modelcontextprotocol/sdk — MCP protocol implementation
Zod — input validation
Vitest — testing
Development
npm run dev # Start with hot reload (tsx watch)
npm run typecheck # Type-check without emitting
npm test # Run tests (26 tests)
npm test -- --coverage # Run tests with coverageRoadmap
Automated integration tests — spin up a fresh Monica Docker container in CI, run tools against it, tear it down. This would catch API regressions before they affect users.
Rate limiting — respect Monica's 60 req/min limit with client-side throttling
Photo/document upload — if Monica's API ever supports these, add the tools back
npm release cadence — publish new versions automatically when the version watchdog detects a Monica release that passes integration tests
Publishing to npm
This package is published to npmjs.com for npx usage.
First-time setup
# 1. Create an npm account at https://www.npmjs.com/signup
# 2. Login on the CLI
npm login
# 3. Verify you're logged in
npm whoamiPublishing a new version
# 1. Bump the version in package.json
npm version patch # 0.1.0 → 0.1.1 (bug fixes)
npm version minor # 0.1.0 → 0.2.0 (new features, backwards compatible)
npm version major # 0.1.0 → 1.0.0 (breaking changes)
# 2. Build and publish
npm run build
npm publish
# Or dry-run first to see what gets published:
npm publish --dry-runCI/CD auto-publish
The included GitHub Actions workflow (.github/workflows/release.yml) auto-publishes to npm when a tag v*.*.* is pushed. To use this:
Create an npm Automation access token at https://www.npmjs.com/settings/~/tokens (type must be Automation, not "Publish" — Automation tokens bypass 2FA)
Add it as a GitHub secret:
NPM_TOKENTag and push:
npm version patch git push origin main --tags
License
MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/philipp-mlr/monica-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server