teamleader-mcp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +91 -0
- package/LICENSE +21 -0
- package/README.md +458 -0
- package/dist/auth/auth-server.d.ts +17 -0
- package/dist/auth/auth-server.d.ts.map +1 -0
- package/dist/auth/auth-server.js +341 -0
- package/dist/auth/auth-server.js.map +1 -0
- package/dist/auth/oauth.d.ts +111 -0
- package/dist/auth/oauth.d.ts.map +1 -0
- package/dist/auth/oauth.js +195 -0
- package/dist/auth/oauth.js.map +1 -0
- package/dist/auth/token-manager.d.ts +70 -0
- package/dist/auth/token-manager.d.ts.map +1 -0
- package/dist/auth/token-manager.js +206 -0
- package/dist/auth/token-manager.js.map +1 -0
- package/dist/cli.d.ts +11 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +224 -0
- package/dist/cli.js.map +1 -0
- package/dist/client/teamleader.d.ts +89 -0
- package/dist/client/teamleader.d.ts.map +1 -0
- package/dist/client/teamleader.js +114 -0
- package/dist/client/teamleader.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +41 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +18 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +1009 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/calendar.d.ts +124 -0
- package/dist/tools/calendar.d.ts.map +1 -0
- package/dist/tools/calendar.js +188 -0
- package/dist/tools/calendar.js.map +1 -0
- package/dist/tools/companies.d.ts +478 -0
- package/dist/tools/companies.d.ts.map +1 -0
- package/dist/tools/companies.js +169 -0
- package/dist/tools/companies.js.map +1 -0
- package/dist/tools/contacts.d.ts +154 -0
- package/dist/tools/contacts.d.ts.map +1 -0
- package/dist/tools/contacts.js +158 -0
- package/dist/tools/contacts.js.map +1 -0
- package/dist/tools/deals.d.ts +466 -0
- package/dist/tools/deals.d.ts.map +1 -0
- package/dist/tools/deals.js +205 -0
- package/dist/tools/deals.js.map +1 -0
- package/dist/tools/email.d.ts +128 -0
- package/dist/tools/email.d.ts.map +1 -0
- package/dist/tools/email.js +111 -0
- package/dist/tools/email.js.map +1 -0
- package/dist/tools/invoices.d.ts +802 -0
- package/dist/tools/invoices.d.ts.map +1 -0
- package/dist/tools/invoices.js +228 -0
- package/dist/tools/invoices.js.map +1 -0
- package/dist/tools/products.d.ts +411 -0
- package/dist/tools/products.d.ts.map +1 -0
- package/dist/tools/products.js +126 -0
- package/dist/tools/products.js.map +1 -0
- package/dist/tools/quotations.d.ts +667 -0
- package/dist/tools/quotations.d.ts.map +1 -0
- package/dist/tools/quotations.js +223 -0
- package/dist/tools/quotations.js.map +1 -0
- package/dist/tools/timetracking.d.ts +242 -0
- package/dist/tools/timetracking.d.ts.map +1 -0
- package/dist/tools/timetracking.js +168 -0
- package/dist/tools/timetracking.js.map +1 -0
- package/package.json +65 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.0.0] - 2026-01-31
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
#### CRM Module
|
|
13
|
+
- **Companies** - Full CRUD operations
|
|
14
|
+
- `teamleader_companies_list` - List companies with filters (name, VAT, tags, status)
|
|
15
|
+
- `teamleader_company_info` - Get company details by ID
|
|
16
|
+
- `teamleader_company_create` - Create a new company
|
|
17
|
+
- `teamleader_company_update` - Update an existing company
|
|
18
|
+
|
|
19
|
+
- **Contacts** - List and read operations
|
|
20
|
+
- `teamleader_contacts_list` - List contacts with filters
|
|
21
|
+
- `teamleader_contact_info` - Get contact details by ID
|
|
22
|
+
|
|
23
|
+
#### Deals Module
|
|
24
|
+
- **Deals** - Complete pipeline management
|
|
25
|
+
- `teamleader_deals_list` - List deals with filters (status, customer, phase)
|
|
26
|
+
- `teamleader_deal_info` - Get deal details by ID
|
|
27
|
+
- `teamleader_deal_create` - Create a new deal
|
|
28
|
+
- `teamleader_deal_update` - Update an existing deal
|
|
29
|
+
- `teamleader_deal_move` - Move deal to a different phase
|
|
30
|
+
- `teamleader_deal_win` - Mark deal as won
|
|
31
|
+
- `teamleader_deal_lose` - Mark deal as lost with optional reason
|
|
32
|
+
|
|
33
|
+
#### Invoicing Module
|
|
34
|
+
- **Invoices** - Complete invoice lifecycle
|
|
35
|
+
- `teamleader_invoices_list` - List invoices with filters
|
|
36
|
+
- `teamleader_invoice_info` - Get invoice details by ID
|
|
37
|
+
- `teamleader_invoice_draft` - Create a draft invoice
|
|
38
|
+
- `teamleader_invoice_send` - Send invoice via email
|
|
39
|
+
- `teamleader_invoice_book` - Book (finalize) a draft invoice
|
|
40
|
+
- `teamleader_invoice_delete` - Delete an invoice
|
|
41
|
+
- `teamleader_invoice_register_payment` - Register a payment
|
|
42
|
+
|
|
43
|
+
- **Quotations** - Complete quotation management
|
|
44
|
+
- `teamleader_quotations_list` - List quotations
|
|
45
|
+
- `teamleader_quotation_info` - Get quotation details
|
|
46
|
+
- `teamleader_quotation_create` - Create a new quotation
|
|
47
|
+
- `teamleader_quotation_send` - Send quotation via email
|
|
48
|
+
- `teamleader_quotation_accept` - Mark quotation as accepted
|
|
49
|
+
- `teamleader_quotation_delete` - Delete a quotation
|
|
50
|
+
- `teamleader_quotation_download` - Get PDF download link
|
|
51
|
+
|
|
52
|
+
#### Products Module
|
|
53
|
+
- **Products** - Product catalog management
|
|
54
|
+
- `teamleader_products_list` - List products with filters
|
|
55
|
+
- `teamleader_product_info` - Get product details
|
|
56
|
+
- `teamleader_product_create` - Create a new product
|
|
57
|
+
- `teamleader_product_update` - Update a product
|
|
58
|
+
|
|
59
|
+
#### Time Tracking Module
|
|
60
|
+
- **Time Tracking** - Track billable and non-billable time
|
|
61
|
+
- `teamleader_timetracking_list` - List time entries
|
|
62
|
+
- `teamleader_timetracking_info` - Get time entry details
|
|
63
|
+
- `teamleader_timetracking_add` - Add a time entry
|
|
64
|
+
- `teamleader_timetracking_update` - Update a time entry
|
|
65
|
+
- `teamleader_timetracking_delete` - Delete a time entry
|
|
66
|
+
|
|
67
|
+
#### Calendar Module
|
|
68
|
+
- **Calendar Events** - Event management
|
|
69
|
+
- `teamleader_events_list` - List calendar events
|
|
70
|
+
- `teamleader_event_info` - Get event details
|
|
71
|
+
- `teamleader_event_create` - Create a new event
|
|
72
|
+
|
|
73
|
+
#### Email Module
|
|
74
|
+
- **Email Tracking** - Log emails to CRM entities
|
|
75
|
+
- `teamleader_email_track` - Log an email to an entity
|
|
76
|
+
- `teamleader_emails_list` - List tracked emails
|
|
77
|
+
|
|
78
|
+
### Technical
|
|
79
|
+
- Full TypeScript implementation with strict typing
|
|
80
|
+
- Zod schemas for input validation
|
|
81
|
+
- 259 unit tests with 100% pass rate
|
|
82
|
+
- MCP SDK integration
|
|
83
|
+
- OAuth 2.0 authentication support
|
|
84
|
+
|
|
85
|
+
## [0.1.0] - 2026-01-30
|
|
86
|
+
|
|
87
|
+
### Added
|
|
88
|
+
- Initial project setup
|
|
89
|
+
- Basic calendar, contacts, and email tracking tools
|
|
90
|
+
- Teamleader API client with authentication
|
|
91
|
+
- Test infrastructure with Vitest
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://www.teamleader.eu/hs-fs/hubfs/Logos/logo-teamleader-focus.png" alt="Teamleader Focus" width="300">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">Teamleader MCP Server</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Control Teamleader Focus with natural language through the Model Context Protocol</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="#features">Features</a> •
|
|
13
|
+
<a href="#quick-start">Quick Start</a> •
|
|
14
|
+
<a href="#installation">Installation</a> •
|
|
15
|
+
<a href="#tools">Tools</a> •
|
|
16
|
+
<a href="#examples">Examples</a> •
|
|
17
|
+
<a href="#contributing">Contributing</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
<a href="https://www.npmjs.com/package/teamleader-mcp"><img src="https://img.shields.io/npm/v/teamleader-mcp" alt="npm version"></a>
|
|
22
|
+
<img src="https://img.shields.io/badge/tools-42-blue" alt="42 Tools">
|
|
23
|
+
<img src="https://img.shields.io/badge/license-MIT-green" alt="MIT License">
|
|
24
|
+
<img src="https://img.shields.io/badge/MCP-compatible-purple" alt="MCP Compatible">
|
|
25
|
+
<img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen" alt="Node >= 18">
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## What is this?
|
|
31
|
+
|
|
32
|
+
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that connects AI assistants like Claude to [Teamleader Focus](https://www.teamleader.eu/) - the all-in-one CRM, invoicing, and project management platform.
|
|
33
|
+
|
|
34
|
+
**Instead of clicking through menus, just ask:**
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
"Find all open deals for Acme Corporation"
|
|
38
|
+
"Create an invoice for 20 hours of consulting at €125/hour"
|
|
39
|
+
"Schedule a meeting with Sarah from TechStart next Tuesday at 2pm"
|
|
40
|
+
"Log 3 hours to the website project with description: frontend development"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Screenshots
|
|
46
|
+
|
|
47
|
+
<!-- TODO: Add screenshots before public launch -->
|
|
48
|
+
|
|
49
|
+
<p align="center">
|
|
50
|
+
<i>🖼️ Screenshots coming soon</i>
|
|
51
|
+
</p>
|
|
52
|
+
|
|
53
|
+
<details>
|
|
54
|
+
<summary>Screenshot placeholders</summary>
|
|
55
|
+
|
|
56
|
+
| Description | Image |
|
|
57
|
+
|-------------|-------|
|
|
58
|
+
| Claude Desktop with deal lookup | `screenshots/deal-lookup.png` |
|
|
59
|
+
| Invoice creation conversation | `screenshots/invoice-creation.png` |
|
|
60
|
+
| Multi-step workflow example | `screenshots/workflow.png` |
|
|
61
|
+
| Claude Desktop config | `screenshots/config.png` |
|
|
62
|
+
|
|
63
|
+
</details>
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Features
|
|
68
|
+
|
|
69
|
+
### 🏢 CRM
|
|
70
|
+
- **Companies** - List, search, create, and update companies
|
|
71
|
+
- **Contacts** - Full contact management with company linking
|
|
72
|
+
- **Deals** - Pipeline management, move phases, win/lose tracking
|
|
73
|
+
|
|
74
|
+
### 💰 Finance
|
|
75
|
+
- **Invoices** - Draft, send, book, register payments
|
|
76
|
+
- **Quotations** - Create, send, accept, download PDFs
|
|
77
|
+
- **Products** - Product catalog management
|
|
78
|
+
|
|
79
|
+
### ⏱️ Operations
|
|
80
|
+
- **Time Tracking** - Log hours, manage entries, billable tracking
|
|
81
|
+
- **Calendar Events** - Create and manage meetings linked to contacts/deals
|
|
82
|
+
- **Email Tracking** - Log emails to entities
|
|
83
|
+
|
|
84
|
+
### 🔐 Security
|
|
85
|
+
- OAuth 2.0 with automatic token refresh
|
|
86
|
+
- Secure credential storage
|
|
87
|
+
- Rate limiting respect
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Quick Start
|
|
92
|
+
|
|
93
|
+
### 1. Authenticate with Teamleader
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npx teamleader-mcp auth
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
This opens a browser for OAuth login. Your credentials are saved automatically.
|
|
100
|
+
|
|
101
|
+
### 2. Configure Claude Desktop
|
|
102
|
+
|
|
103
|
+
Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"mcpServers": {
|
|
108
|
+
"teamleader": {
|
|
109
|
+
"command": "npx",
|
|
110
|
+
"args": ["-y", "teamleader-mcp"]
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 3. Start Using!
|
|
117
|
+
|
|
118
|
+
Restart Claude Desktop and ask: *"What Teamleader tools do you have access to?"*
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Installation
|
|
123
|
+
|
|
124
|
+
### Prerequisites
|
|
125
|
+
- Node.js 18 or higher
|
|
126
|
+
- A Teamleader Focus account
|
|
127
|
+
- OAuth 2.0 credentials from [Teamleader Marketplace](https://marketplace.focus.teamleader.eu/build)
|
|
128
|
+
|
|
129
|
+
### Via npx (Recommended)
|
|
130
|
+
No installation needed - runs directly:
|
|
131
|
+
```bash
|
|
132
|
+
npx teamleader-mcp auth # One-time OAuth setup
|
|
133
|
+
npx teamleader-mcp # Start the MCP server
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Global Install
|
|
137
|
+
```bash
|
|
138
|
+
npm install -g teamleader-mcp
|
|
139
|
+
teamleader-mcp auth
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### From Source
|
|
143
|
+
```bash
|
|
144
|
+
git clone https://github.com/Weichie-com/teamleader-mcp.git
|
|
145
|
+
cd teamleader-mcp
|
|
146
|
+
npm install
|
|
147
|
+
npm run build
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## OAuth Setup
|
|
153
|
+
|
|
154
|
+
### 1. Register Your Integration
|
|
155
|
+
|
|
156
|
+
1. Go to [Teamleader Marketplace](https://marketplace.focus.teamleader.eu/build)
|
|
157
|
+
2. Create a new integration
|
|
158
|
+
3. Note your `client_id` and `client_secret`
|
|
159
|
+
4. Set redirect URI: `http://localhost:3000/callback`
|
|
160
|
+
5. Required scopes: `contacts`, `companies`, `deals`, `invoices`, `products`, `timetracking`, `events`, `users`
|
|
161
|
+
|
|
162
|
+
### 2. Generate Tokens
|
|
163
|
+
|
|
164
|
+
The easiest way:
|
|
165
|
+
```bash
|
|
166
|
+
node scripts/generate-token.js
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Or manually via OAuth authorization code flow - see [OAUTH_CLAUDE_SETUP.md](OAUTH_CLAUDE_SETUP.md).
|
|
170
|
+
|
|
171
|
+
### 3. Configure Environment
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
cp .env.example .env
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Edit `.env`:
|
|
178
|
+
```bash
|
|
179
|
+
TEAMLEADER_ACCESS_TOKEN=your_access_token
|
|
180
|
+
TEAMLEADER_CLIENT_ID=your_client_id
|
|
181
|
+
TEAMLEADER_CLIENT_SECRET=your_client_secret
|
|
182
|
+
TEAMLEADER_REFRESH_TOKEN=your_refresh_token
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Tools
|
|
188
|
+
|
|
189
|
+
This server provides **42 tools** across all major Teamleader Focus features:
|
|
190
|
+
|
|
191
|
+
### Companies (4 tools)
|
|
192
|
+
| Tool | Description |
|
|
193
|
+
|------|-------------|
|
|
194
|
+
| `teamleader_companies_list` | List/search companies |
|
|
195
|
+
| `teamleader_company_info` | Get company details |
|
|
196
|
+
| `teamleader_company_create` | Create a company |
|
|
197
|
+
| `teamleader_company_update` | Update a company |
|
|
198
|
+
|
|
199
|
+
### Contacts (2 tools)
|
|
200
|
+
| Tool | Description |
|
|
201
|
+
|------|-------------|
|
|
202
|
+
| `teamleader_contacts_list` | List/search contacts |
|
|
203
|
+
| `teamleader_contact_info` | Get contact details |
|
|
204
|
+
|
|
205
|
+
### Deals (7 tools)
|
|
206
|
+
| Tool | Description |
|
|
207
|
+
|------|-------------|
|
|
208
|
+
| `teamleader_deals_list` | List deals with filters |
|
|
209
|
+
| `teamleader_deal_info` | Get deal details |
|
|
210
|
+
| `teamleader_deal_create` | Create a deal |
|
|
211
|
+
| `teamleader_deal_update` | Update a deal |
|
|
212
|
+
| `teamleader_deal_move` | Move to different phase |
|
|
213
|
+
| `teamleader_deal_win` | Mark as won |
|
|
214
|
+
| `teamleader_deal_lose` | Mark as lost |
|
|
215
|
+
|
|
216
|
+
### Invoices (7 tools)
|
|
217
|
+
| Tool | Description |
|
|
218
|
+
|------|-------------|
|
|
219
|
+
| `teamleader_invoices_list` | List invoices |
|
|
220
|
+
| `teamleader_invoice_info` | Get invoice details |
|
|
221
|
+
| `teamleader_invoice_draft` | Create draft invoice |
|
|
222
|
+
| `teamleader_invoice_update` | Update invoice |
|
|
223
|
+
| `teamleader_invoice_send` | Send via email |
|
|
224
|
+
| `teamleader_invoice_book` | Book/finalize |
|
|
225
|
+
| `teamleader_invoice_register_payment` | Register payment |
|
|
226
|
+
| `teamleader_invoice_delete` | Delete invoice |
|
|
227
|
+
|
|
228
|
+
### Quotations (7 tools)
|
|
229
|
+
| Tool | Description |
|
|
230
|
+
|------|-------------|
|
|
231
|
+
| `teamleader_quotations_list` | List quotations |
|
|
232
|
+
| `teamleader_quotation_info` | Get quotation details |
|
|
233
|
+
| `teamleader_quotation_create` | Create quotation |
|
|
234
|
+
| `teamleader_quotation_update` | Update quotation |
|
|
235
|
+
| `teamleader_quotation_send` | Send via email |
|
|
236
|
+
| `teamleader_quotation_accept` | Mark as accepted |
|
|
237
|
+
| `teamleader_quotation_delete` | Delete quotation |
|
|
238
|
+
| `teamleader_quotation_download` | Get PDF link |
|
|
239
|
+
|
|
240
|
+
### Products (4 tools)
|
|
241
|
+
| Tool | Description |
|
|
242
|
+
|------|-------------|
|
|
243
|
+
| `teamleader_products_list` | List products |
|
|
244
|
+
| `teamleader_product_info` | Get product details |
|
|
245
|
+
| `teamleader_product_create` | Create product |
|
|
246
|
+
| `teamleader_product_update` | Update product |
|
|
247
|
+
|
|
248
|
+
### Time Tracking (5 tools)
|
|
249
|
+
| Tool | Description |
|
|
250
|
+
|------|-------------|
|
|
251
|
+
| `teamleader_timetracking_list` | List time entries |
|
|
252
|
+
| `teamleader_timetracking_info` | Get entry details |
|
|
253
|
+
| `teamleader_timetracking_add` | Add time entry |
|
|
254
|
+
| `teamleader_timetracking_update` | Update entry |
|
|
255
|
+
| `teamleader_timetracking_delete` | Delete entry |
|
|
256
|
+
|
|
257
|
+
### Calendar Events (3 tools)
|
|
258
|
+
| Tool | Description |
|
|
259
|
+
|------|-------------|
|
|
260
|
+
| `teamleader_events_list` | List events |
|
|
261
|
+
| `teamleader_event_info` | Get event details |
|
|
262
|
+
| `teamleader_event_create` | Create event |
|
|
263
|
+
|
|
264
|
+
### Email Tracking (2 tools)
|
|
265
|
+
| Tool | Description |
|
|
266
|
+
|------|-------------|
|
|
267
|
+
| `teamleader_emails_list` | List tracked emails |
|
|
268
|
+
| `teamleader_email_track` | Log an email |
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Examples
|
|
273
|
+
|
|
274
|
+
### Natural Language → Actions
|
|
275
|
+
|
|
276
|
+
**"Find all open deals worth more than €10,000"**
|
|
277
|
+
```
|
|
278
|
+
→ teamleader_deals_list(status: ["open"])
|
|
279
|
+
→ Filters results by value
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**"Create an invoice for Acme Corp: 20 hours consulting at €125/hour, 30 days payment term"**
|
|
283
|
+
```
|
|
284
|
+
→ teamleader_companies_list(term: "Acme Corp")
|
|
285
|
+
→ teamleader_invoice_draft(customer_id: "...", grouped_lines: [...])
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**"Schedule a meeting with John from DataFlow next Tuesday at 2pm"**
|
|
289
|
+
```
|
|
290
|
+
→ teamleader_contacts_list(term: "John DataFlow")
|
|
291
|
+
→ teamleader_event_create(title: "Meeting", starts_at: "...", contact_ids: [...])
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Direct Tool Calls
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
# List open deals
|
|
298
|
+
mcporter call teamleader.teamleader_deals_list status='["open"]'
|
|
299
|
+
|
|
300
|
+
# Get company info
|
|
301
|
+
mcporter call teamleader.teamleader_company_info id="uuid-here"
|
|
302
|
+
|
|
303
|
+
# Create a time entry
|
|
304
|
+
mcporter call teamleader.teamleader_timetracking_add \
|
|
305
|
+
started_at="2026-01-31T09:00:00+01:00" \
|
|
306
|
+
ended_at="2026-01-31T12:00:00+01:00" \
|
|
307
|
+
description="Development work"
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Configuration Options
|
|
313
|
+
|
|
314
|
+
### Environment Variables
|
|
315
|
+
|
|
316
|
+
| Variable | Required | Description |
|
|
317
|
+
|----------|----------|-------------|
|
|
318
|
+
| `TEAMLEADER_ACCESS_TOKEN` | Yes | OAuth access token |
|
|
319
|
+
| `TEAMLEADER_CLIENT_ID` | No* | OAuth client ID |
|
|
320
|
+
| `TEAMLEADER_CLIENT_SECRET` | No* | OAuth client secret |
|
|
321
|
+
| `TEAMLEADER_REFRESH_TOKEN` | No* | OAuth refresh token |
|
|
322
|
+
| `TEAMLEADER_TOKEN_STORAGE` | No | Custom token storage path |
|
|
323
|
+
|
|
324
|
+
*Required for automatic token refresh (recommended)
|
|
325
|
+
|
|
326
|
+
### Token Refresh Modes
|
|
327
|
+
|
|
328
|
+
**Static Mode:** Only `ACCESS_TOKEN` set. Token expires after 1 hour. Manual refresh needed.
|
|
329
|
+
|
|
330
|
+
**Auto Refresh Mode (Recommended):** All four OAuth variables set. Tokens refresh automatically 5 minutes before expiry.
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## Troubleshooting
|
|
335
|
+
|
|
336
|
+
<details>
|
|
337
|
+
<summary><strong>Server hangs or times out</strong></summary>
|
|
338
|
+
|
|
339
|
+
Make sure your config includes the `args` array:
|
|
340
|
+
|
|
341
|
+
```json
|
|
342
|
+
{
|
|
343
|
+
"command": "node",
|
|
344
|
+
"args": ["/path/to/teamleader-mcp/dist/index.js"] // ← Required!
|
|
345
|
+
}
|
|
346
|
+
```
|
|
347
|
+
</details>
|
|
348
|
+
|
|
349
|
+
<details>
|
|
350
|
+
<summary><strong>"Unknown tool" error</strong></summary>
|
|
351
|
+
|
|
352
|
+
Tool names are prefixed with `teamleader_`. Use `teamleader_deal_info`, not `get-deal`.
|
|
353
|
+
|
|
354
|
+
Run `mcporter list teamleader` to see all tools.
|
|
355
|
+
</details>
|
|
356
|
+
|
|
357
|
+
<details>
|
|
358
|
+
<summary><strong>401 Unauthorized</strong></summary>
|
|
359
|
+
|
|
360
|
+
Access tokens expire after 1 hour. Set up automatic refresh with all OAuth variables, or manually refresh your token.
|
|
361
|
+
</details>
|
|
362
|
+
|
|
363
|
+
<details>
|
|
364
|
+
<summary><strong>Rate limiting errors</strong></summary>
|
|
365
|
+
|
|
366
|
+
Teamleader allows 200 requests/minute. The server respects rate limit headers. Wait and retry, or reduce request frequency.
|
|
367
|
+
</details>
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
## Development
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
# Build
|
|
375
|
+
npm run build
|
|
376
|
+
|
|
377
|
+
# Watch mode
|
|
378
|
+
npm run dev
|
|
379
|
+
|
|
380
|
+
# Test
|
|
381
|
+
npm test # Watch mode
|
|
382
|
+
npm run test:run # Single run
|
|
383
|
+
|
|
384
|
+
# Lint
|
|
385
|
+
npm run lint
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## Contributing
|
|
391
|
+
|
|
392
|
+
We welcome contributions! Here's how to help:
|
|
393
|
+
|
|
394
|
+
### Bug Reports & Feature Requests
|
|
395
|
+
- Open an issue with a clear description
|
|
396
|
+
- Include steps to reproduce for bugs
|
|
397
|
+
- For features, explain the use case
|
|
398
|
+
|
|
399
|
+
### Pull Requests
|
|
400
|
+
1. Fork the repository
|
|
401
|
+
2. Create a feature branch: `git checkout -b feature/amazing-feature`
|
|
402
|
+
3. Make your changes
|
|
403
|
+
4. Run tests: `npm test`
|
|
404
|
+
5. Commit: `git commit -m 'Add amazing feature'`
|
|
405
|
+
6. Push: `git push origin feature/amazing-feature`
|
|
406
|
+
7. Open a Pull Request
|
|
407
|
+
|
|
408
|
+
### Code Style
|
|
409
|
+
- TypeScript with strict mode
|
|
410
|
+
- Prettier for formatting
|
|
411
|
+
- ESLint for linting
|
|
412
|
+
- Descriptive commit messages
|
|
413
|
+
|
|
414
|
+
### Adding New Tools
|
|
415
|
+
1. Add the tool definition in `src/tools/`
|
|
416
|
+
2. Implement the handler
|
|
417
|
+
3. Add tests in `tests/`
|
|
418
|
+
4. Update this README
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
## Roadmap
|
|
423
|
+
|
|
424
|
+
- [x] npm package publication
|
|
425
|
+
- [ ] Project management tools (milestones, tasks)
|
|
426
|
+
- [ ] Webhook support for real-time updates
|
|
427
|
+
- [ ] Batch operations
|
|
428
|
+
- [ ] More filter options
|
|
429
|
+
- [ ] Credit notes support
|
|
430
|
+
|
|
431
|
+
See [ROADMAP.md](ROADMAP.md) for details.
|
|
432
|
+
|
|
433
|
+
---
|
|
434
|
+
|
|
435
|
+
## Related Resources
|
|
436
|
+
|
|
437
|
+
- [Teamleader Focus API Documentation](https://developer.teamleader.eu/)
|
|
438
|
+
- [Model Context Protocol](https://modelcontextprotocol.io/)
|
|
439
|
+
- [Teamleader Marketplace](https://marketplace.focus.teamleader.eu/)
|
|
440
|
+
- [Claude Desktop](https://claude.ai/download)
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
## License
|
|
445
|
+
|
|
446
|
+
MIT License - see [LICENSE](LICENSE) file.
|
|
447
|
+
|
|
448
|
+
---
|
|
449
|
+
|
|
450
|
+
## Acknowledgments
|
|
451
|
+
|
|
452
|
+
Built with ❤️ using the [Model Context Protocol](https://modelcontextprotocol.io/) by Anthropic.
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
<p align="center">
|
|
457
|
+
<sub>Made by <a href="https://weichie.com">Weichie</a> • Star ⭐ if you find this useful!</sub>
|
|
458
|
+
</p>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local HTTP server for OAuth callback
|
|
3
|
+
*
|
|
4
|
+
* Starts a temporary server to receive the OAuth callback,
|
|
5
|
+
* exchanges the code for tokens, and shuts down.
|
|
6
|
+
*/
|
|
7
|
+
import { type OAuthConfig } from './oauth.js';
|
|
8
|
+
export interface AuthServerResult {
|
|
9
|
+
accessToken: string;
|
|
10
|
+
refreshToken: string;
|
|
11
|
+
expiresIn: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Start a local server and wait for the OAuth callback
|
|
15
|
+
*/
|
|
16
|
+
export declare function startAuthServer(config: OAuthConfig, port?: number): Promise<AuthServerResult>;
|
|
17
|
+
//# sourceMappingURL=auth-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-server.d.ts","sourceRoot":"","sources":["../../src/auth/auth-server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAyB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,IAAI,GAAE,MAAa,GAClB,OAAO,CAAC,gBAAgB,CAAC,CAsE3B"}
|