loading…
Search for a command to run...
loading…
Enables AI agents to interact with Twenty CRM data through GraphQL and REST APIs to manage persons, companies, opportunities, and tasks. It supports both core e
Enables AI agents to interact with Twenty CRM data through GraphQL and REST APIs to manage persons, companies, opportunities, and tasks. It supports both core entities and custom objects, providing a comprehensive interface for CRM automation.
This repository contains a Twenty CRM MCP (Model Context Protocol) server that enables AI agents to interact with Twenty CRM data through both GraphQL and REST APIs. This MCP server provides comprehensive CRM capabilities including:
The server follows the Model Context Protocol specification, allowing AI agents to seamlessly integrate Twenty CRM functionality into their workflows using both GraphQL and REST endpoints.
The fastest way to get started is using the provided Makefile:
# Initial setup (installs dependencies and creates .env)
make setup
# Edit .env with your Twenty CRM API key
nano .env
# Start development server
make dev
Visit http://localhost:5008 to access the interactive interface.
For detailed instructions, see QUICKSTART.md.
This project includes a comprehensive Makefile for all common operations:
# View all available commands
make help
# Development
make dev # Start development server
make build # Build TypeScript project
make test # Run tests
make test-coverage # Run tests with coverage
# Docker
make docker-build # Build Docker image
make docker-run # Run container
make docker-stop # Stop container
make docker-logs # View container logs
# Kubernetes
make deploy # Deploy to Kubernetes
make k8s-status # Check deployment status
make k8s-logs # View pod logs
make k8s-restart # Restart deployment
# Utilities
make clean # Clean build artifacts
make info # Show project info
make health # Check server health
Run make help to see all available commands.
Create a .env file in the root directory:
# Twenty CRM Configuration
TWENTY_API_URL=https://api.twenty.com # or your self-hosted URL
TWENTY_API_KEY=your_api_key_here
# Server Configuration
PORT=5008
For self-hosted instances, use your domain:
TWENTY_API_URL=https://your-domain.com
# Initial setup - installs dependencies and creates .env
make setup
# Edit .env with your API key
nano .env # or your preferred editor
# Start development server
make dev
# Open MCP Inspector (in new terminal)
make inspect
Clone the repository
Install dependencies:
npm install
Create and configure .env:
cp .env.example .env
# Edit .env with your Twenty CRM API key
Build the TypeScript project:
npm run build
Start the MCP server:
npm run mcp
Access the server:
(Optional) Open the MCP Inspector:
npm run mcp-inspect
The MCP Inspector will open at http://localhost:6274 for advanced debugging.
The home page provides an interactive testing interface with:
Quick Test Workflow:
All curl commands shown on the home page work from any host - they dynamically use the server's actual URL.
create-person - Create a new person recordget-person - Retrieve person by IDupdate-person - Update person informationdelete-person - Delete a person recordlist-persons - List all persons with optional filteringcreate-company - Create a new companyget-company - Retrieve company by IDupdate-company - Update company informationdelete-company - Delete a company recordlist-companies - List all companies with optional filteringcreate-opportunity - Create a new sales opportunityget-opportunity - Retrieve opportunity by IDupdate-opportunity - Update opportunity detailsdelete-opportunity - Delete an opportunitylist-opportunities - List all opportunities with filteringcreate-note - Create a note attached to any entitylist-notes - List notes with filtering optionscreate-task - Create a taskupdate-task - Update task status and detailslist-tasks - List tasks with filtering/graphql/restBoth APIs support the same core operations - choose based on your needs.
-p 5008:8080 maps external port 5008 to internal port 8080Build the Docker image:
npm run docker-build
Run the Docker container:
npm run docker-run
This runs the container in detached mode with port mapping 5008:8080.
Stop the Docker container:
npm run docker-stop
Access the running server:
# Interactive home page with testing interface
open http://localhost:5008/
# MCP protocol endpoint
curl http://localhost:5008/mcp
# Health check
curl http://localhost:5008/health
| Command | Description |
|---|---|
npm run build |
Build TypeScript project to build/ directory |
npm start |
Start MCP server (port 5008) |
npm run mcp |
Start MCP server with Inspector |
npm run mcp-inspect |
Open MCP Inspector only |
npm test |
Run test suite |
npm run test:coverage |
Run tests with coverage report |
| Command | Description |
|---|---|
npm run docker-build |
Build Docker image |
npm run docker-run |
Run container (detached, port 5008:8080) |
npm run docker-stop |
Stop and remove running container |
npm run build:k3d |
Build and import into k3d cluster |
| Command | Description |
|---|---|
npm run deploy |
Deploy to Kubernetes using k8s/deployment.yaml |
npm run deploy:watch |
Deploy and watch rollout status |
npm run build:deploy |
Complete workflow: build → deploy → monitor |
Visit http://localhost:5008/ for the interactive testing interface.
The home page provides:
Use the MCP Inspector for advanced debugging:
npx @modelcontextprotocol/inspector --transport http --server-url http://localhost:5008/mcp
The server follows a clean architecture pattern:
src/
├── application/ # Application layer (tools, handlers)
│ └── tools/ # MCP tools for each entity
├── domain/ # Domain logic (business rules)
├── infrastructure/ # External services (API clients, logging)
│ └── clients/ # Twenty CRM API clients
└── types/ # TypeScript type definitions
Copyright © 2025. All rights reserved.
.env files to version controlДобавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"twenty-crm-mcp-server": {
"command": "npx",
"args": []
}
}
}