tradify-mcp 1.1.0__tar.gz
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.
- tradify_mcp-1.1.0/.cursor/mcp.json +10 -0
- tradify_mcp-1.1.0/.cursor/rules/tradify.mdc +13 -0
- tradify_mcp-1.1.0/.gitignore +3 -0
- tradify_mcp-1.1.0/Dockerfile +6 -0
- tradify_mcp-1.1.0/LICENSE +93 -0
- tradify_mcp-1.1.0/PKG-INFO +215 -0
- tradify_mcp-1.1.0/README.md +200 -0
- tradify_mcp-1.1.0/examples/prompts.md +7 -0
- tradify_mcp-1.1.0/glama.json +1 -0
- tradify_mcp-1.1.0/mcp.json +17 -0
- tradify_mcp-1.1.0/pyproject.toml +29 -0
- tradify_mcp-1.1.0/skills/tradify/SKILL.md +25 -0
- tradify_mcp-1.1.0/tradify_agent.py +240 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Work in Tradify through Cotlet.dev
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Tradify through Cotlet.dev
|
|
8
|
+
|
|
9
|
+
- First call `cotlet_app_guide` with app "tradify".
|
|
10
|
+
- Then use `cotlet_browser_open`, `cotlet_browser_read` and `cotlet_browser_click`, one call at a time. Wait for each answer.
|
|
11
|
+
- At a sign-in page or CAPTCHA, stop and give the user the browser link.
|
|
12
|
+
- Ask the user before sending, publishing, deleting or paying.
|
|
13
|
+
- Close the browser with `cotlet_browser_close` when done.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Elastic License 2.0
|
|
2
|
+
|
|
3
|
+
URL: https://www.elastic.co/licensing/elastic-license
|
|
4
|
+
|
|
5
|
+
## Acceptance
|
|
6
|
+
|
|
7
|
+
By using the software, you agree to all of the terms and conditions below.
|
|
8
|
+
|
|
9
|
+
## Copyright License
|
|
10
|
+
|
|
11
|
+
The licensor grants you a non-exclusive, royalty-free, worldwide,
|
|
12
|
+
non-sublicensable, non-transferable license to use, copy, distribute, make
|
|
13
|
+
available, and prepare derivative works of the software, in each case subject to
|
|
14
|
+
the limitations and conditions below.
|
|
15
|
+
|
|
16
|
+
## Limitations
|
|
17
|
+
|
|
18
|
+
You may not provide the software to third parties as a hosted or managed
|
|
19
|
+
service, where the service provides users with access to any substantial set of
|
|
20
|
+
the features or functionality of the software.
|
|
21
|
+
|
|
22
|
+
You may not move, change, disable, or circumvent the license key functionality
|
|
23
|
+
in the software, and you may not remove or obscure any functionality in the
|
|
24
|
+
software that is protected by the license key.
|
|
25
|
+
|
|
26
|
+
You may not alter, remove, or obscure any licensing, copyright, or other notices
|
|
27
|
+
of the licensor in the software. Any use of the licensor’s trademarks is subject
|
|
28
|
+
to applicable law.
|
|
29
|
+
|
|
30
|
+
## Patents
|
|
31
|
+
|
|
32
|
+
The licensor grants you a license, under any patent claims the licensor can
|
|
33
|
+
license, or becomes able to license, to make, have made, use, sell, offer for
|
|
34
|
+
sale, import and have imported the software, in each case subject to the
|
|
35
|
+
limitations and conditions in this license. This license does not cover any
|
|
36
|
+
patent claims that you cause to be infringed by modifications or additions to
|
|
37
|
+
the software. If you or your company make any written claim that the software
|
|
38
|
+
infringes or contributes to infringement of any patent, your patent license for
|
|
39
|
+
the software granted under these terms ends immediately. If your company makes
|
|
40
|
+
such a claim, your patent license ends immediately for work on behalf of your
|
|
41
|
+
company.
|
|
42
|
+
|
|
43
|
+
## Notices
|
|
44
|
+
|
|
45
|
+
You must ensure that anyone who gets a copy of any part of the software from you
|
|
46
|
+
also gets a copy of these terms.
|
|
47
|
+
|
|
48
|
+
If you modify the software, you must include in any modified copies of the
|
|
49
|
+
software prominent notices stating that you have modified the software.
|
|
50
|
+
|
|
51
|
+
## No Other Rights
|
|
52
|
+
|
|
53
|
+
These terms do not imply any licenses other than those expressly granted in
|
|
54
|
+
these terms.
|
|
55
|
+
|
|
56
|
+
## Termination
|
|
57
|
+
|
|
58
|
+
If you use the software in violation of these terms, such use is not licensed,
|
|
59
|
+
and your licenses will automatically terminate. If the licensor provides you
|
|
60
|
+
with a notice of your violation, and you cease all violation of this license no
|
|
61
|
+
later than 30 days after you receive that notice, your licenses will be
|
|
62
|
+
reinstated retroactively. However, if you violate these terms after such
|
|
63
|
+
reinstatement, any additional violation of these terms will cause your licenses
|
|
64
|
+
to terminate automatically and permanently.
|
|
65
|
+
|
|
66
|
+
## No Liability
|
|
67
|
+
|
|
68
|
+
*As far as the law allows, the software comes as is, without any warranty or
|
|
69
|
+
condition, and the licensor will not be liable to you for any damages arising
|
|
70
|
+
out of these terms or the use or nature of the software, under any kind of
|
|
71
|
+
legal claim.*
|
|
72
|
+
|
|
73
|
+
## Definitions
|
|
74
|
+
|
|
75
|
+
The **licensor** is the entity offering these terms, and the **software** is the
|
|
76
|
+
software the licensor makes available under these terms, including any portion
|
|
77
|
+
of it.
|
|
78
|
+
|
|
79
|
+
**you** refers to the individual or entity agreeing to these terms.
|
|
80
|
+
|
|
81
|
+
**your company** is any legal entity, sole proprietorship, or other kind of
|
|
82
|
+
organization that you work for, plus all organizations that have control over,
|
|
83
|
+
are under the control of, or are under common control with that
|
|
84
|
+
organization. **control** means ownership of substantially all the assets of an
|
|
85
|
+
entity, or the power to direct its management and policies by vote, contract, or
|
|
86
|
+
otherwise. Control can be direct or indirect.
|
|
87
|
+
|
|
88
|
+
**your licenses** are all the licenses granted to you for the software under
|
|
89
|
+
these terms.
|
|
90
|
+
|
|
91
|
+
**use** means anything you do with the software requiring one of your licenses.
|
|
92
|
+
|
|
93
|
+
**trademark** means trademarks, service marks, and similar rights.
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: tradify-mcp
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: Connect Tradify to Claude Code, ChatGPT and any AI agent through Cotlet.dev, a hosted MCP server. No Tradify API key needed.
|
|
5
|
+
Project-URL: Homepage, https://cotlet.dev/integrations/tradify-api-mcp-server?utm_source=pypi&utm_medium=package&utm_campaign=tradify
|
|
6
|
+
Project-URL: Source, https://github.com/cotlet-connect/tradify-mcp
|
|
7
|
+
Author-email: "Cotlet.dev" <contact@cotlet.dev>
|
|
8
|
+
License-Expression: Elastic-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: ai agent,chatgpt,claude,cotlet,mcp server,tradify,tradify api,tradify mcp
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Topic :: Office/Business
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# How to connect Tradify to Claude Code, ChatGPT and any AI agent
|
|
17
|
+
|
|
18
|
+
**Yes, Claude, ChatGPT and other AI agents can work in your Tradify account.** Tradify has no public API, no API keys and no official ChatGPT or Claude app. Cotlet.dev connects your own signed-in Tradify account to any AI agent, so you can ask in plain words and the AI creates the job, writes the quote, turns it into an invoice, records the payment and books your staff. It shows you the draft first and sends nothing to a customer until you say so.
|
|
19
|
+
|
|
20
|
+
## What you can ask
|
|
21
|
+
|
|
22
|
+
> New job for Sam Lee at 12 Oak St: replace the hot water cylinder. Book Mike for Thursday morning.
|
|
23
|
+
|
|
24
|
+
> Quote the bathroom rewire at 14 Elm Rd from my notes: 6 hours labour, 6 LED downlights at $24, one extractor fan at $85. Show me before you send it.
|
|
25
|
+
|
|
26
|
+
> Turn every quote accepted this week into a 30% deposit invoice.
|
|
27
|
+
|
|
28
|
+
> Which invoices are overdue? Total them per customer, oldest first.
|
|
29
|
+
|
|
30
|
+
> What is on tomorrow's schedule, per staff member?
|
|
31
|
+
|
|
32
|
+
## Connect in 2 minutes
|
|
33
|
+
|
|
34
|
+
Get your API key at https://cotlet.dev/app and export it as `COTLET_API_KEY`.
|
|
35
|
+
|
|
36
|
+
### Claude Code
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
claude mcp add --transport http cotlet https://cotlet.dev/mcp/v1 --header "Authorization: Bearer $COTLET_API_KEY"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### ChatGPT
|
|
43
|
+
|
|
44
|
+
Settings → Apps → add connector URL `https://cotlet.dev/mcp/v1`, then sign in with Cotlet.dev. No API key needed.
|
|
45
|
+
|
|
46
|
+
### Cursor
|
|
47
|
+
|
|
48
|
+
Copy `.cursor/mcp.json` from this repo into your project:
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"cotlet": {
|
|
54
|
+
"url": "https://cotlet.dev/mcp/v1",
|
|
55
|
+
"headers": {
|
|
56
|
+
"Authorization": "Bearer ${COTLET_API_KEY}"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Run it locally (stdio)
|
|
64
|
+
|
|
65
|
+
This repo is a real MCP server. It speaks MCP over stdio, lists its Tradify tools without any key, and forwards every tool call to the hosted Cotlet.dev server. The hosted URL above stays the recommended way. Use this when your client only starts local servers.
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{"mcpServers":{"tradify":{"command":"uvx","args":["tradify-mcp"],"env":{"COTLET_API_KEY":"your-key"}}}}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Or with Docker:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
docker build -t tradify-mcp .
|
|
75
|
+
docker run -i --rm -e COTLET_API_KEY tradify-mcp
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Tools: `tradify_guide`, `tradify_status`, `tradify_open`, `tradify_read`, `tradify_click`, `tradify_type`, `tradify_close`. Without `COTLET_API_KEY` a tool call answers: "Set COTLET_API_KEY. Get a key at https://cotlet.dev/app".
|
|
79
|
+
|
|
80
|
+
## Command line
|
|
81
|
+
|
|
82
|
+
Python 3.10+, nothing else to install. From PyPI:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pip install tradify-mcp # or run it once: uvx tradify-mcp connect
|
|
86
|
+
tradify-mcp connect
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Or straight from this repo:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
export COTLET_API_KEY="your-key"
|
|
93
|
+
python3 tradify_agent.py connect # ready config for Claude Code, Cursor, ChatGPT
|
|
94
|
+
python3 tradify_agent.py status # is Tradify ready in your Cotlet.dev account
|
|
95
|
+
python3 tradify_agent.py guide # Tradify screens and sign-in link
|
|
96
|
+
python3 tradify_agent.py read # open Tradify, read the page, close the browser
|
|
97
|
+
python3 tradify_agent.py tools # list Cotlet.dev tools
|
|
98
|
+
python3 tradify_agent.py serve # start the stdio MCP server (same as no argument)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Questions from Tradify users
|
|
102
|
+
|
|
103
|
+
**Does Tradify have an API?**
|
|
104
|
+
|
|
105
|
+
Not a public one. Tradify offers no public API, no self-service API keys and no webhooks, only built-in integrations such as Xero, QuickBooks, MYOB and Stripe. Cotlet.dev works in your Tradify account directly, so your AI agent can handle jobs, quotes, invoices and the Scheduler without one.
|
|
106
|
+
|
|
107
|
+
**How do I connect Tradify to ChatGPT?**
|
|
108
|
+
|
|
109
|
+
Add Cotlet.dev as an app in ChatGPT (Settings → Apps, connector URL `https://cotlet.dev/mcp/v1/tradify`), sign in to Tradify once in your Cotlet.dev Cloud Browser, and ask ChatGPT in plain words. No code and no Tradify API key.
|
|
110
|
+
|
|
111
|
+
**Is there a way to use Claude with Tradify?**
|
|
112
|
+
|
|
113
|
+
Yes. In Claude Code run the one-line `claude mcp add` command above; in the Claude app add `https://cotlet.dev/mcp/v1/tradify` as a custom connector. Claude then works in your own Tradify account.
|
|
114
|
+
|
|
115
|
+
**Can AI do my Tradify quotes and invoices?**
|
|
116
|
+
|
|
117
|
+
Yes. Give it your notes and it writes a draft quote with labour and materials lines, turns an accepted quote into a full or deposit invoice, records payments and lists what is overdue. Nothing reaches a customer before your OK, and invoices still sync to Xero or QuickBooks as you set it up.
|
|
118
|
+
|
|
119
|
+
**Is there a Tradify MCP server?**
|
|
120
|
+
|
|
121
|
+
Tradify has no official MCP server. Cotlet.dev is a hosted MCP server that works in Tradify for you, 24/7, with Claude, ChatGPT, Cursor, Codex, n8n, Make and Zapier. A self-hosted version for developers is on GitHub.
|
|
122
|
+
|
|
123
|
+
## Find it on
|
|
124
|
+
|
|
125
|
+
- [Tradify on Cotlet.dev](https://cotlet.dev/integrations/tradify-mcp-server?utm_source=github&utm_medium=readme&utm_campaign=tradify&utm_content=find)
|
|
126
|
+
- [PyPI package tradify-mcp](https://pypi.org/project/tradify-mcp/)
|
|
127
|
+
- [Glama](https://glama.ai/mcp/servers/cotlet-connect/tradify-mcp)
|
|
128
|
+
- [LobeHub](https://lobehub.com/mcp/cotlet-connect-tradify-mcp)
|
|
129
|
+
- [Odel](https://odel.app/modules/cotlet/tradify)
|
|
130
|
+
- [mcpbeat](https://mcpbeat.com/mcp-servers/cotlet/tradify/)
|
|
131
|
+
- [Step-by-step guide (PDF) on Internet Archive](https://archive.org/details/cotlet-connect-tradify-to-ai-agents-guide)
|
|
132
|
+
|
|
133
|
+
## Also works with
|
|
134
|
+
|
|
135
|
+
- [Mangomint MCP](https://github.com/cotlet-connect/mangomint-mcp)
|
|
136
|
+
- [Wanderlog MCP](https://github.com/cotlet-connect/wanderlog-mcp)
|
|
137
|
+
- [SmugMug MCP](https://github.com/cotlet-connect/smugmug-mcp)
|
|
138
|
+
- [Garmin Connect MCP](https://github.com/cotlet-connect/garmin-mcp)
|
|
139
|
+
- [Housecall Pro MCP](https://github.com/cotlet-connect/housecall-pro-mcp)
|
|
140
|
+
- [Medium MCP](https://github.com/cotlet-connect/medium-mcp)
|
|
141
|
+
- [Crexi MCP](https://github.com/cotlet-connect/crexi-mcp)
|
|
142
|
+
- [DistroKid MCP](https://github.com/cotlet-connect/distrokid-mcp)
|
|
143
|
+
- [LinkedIn MCP](https://github.com/cotlet-connect/linkedin-mcp)
|
|
144
|
+
- [EstimateOne MCP](https://github.com/cotlet-connect/estimateone-mcp)
|
|
145
|
+
- [Google Search Console MCP](https://github.com/cotlet-connect/google-search-console-mcp)
|
|
146
|
+
- [Lichess MCP](https://github.com/cotlet-connect/lichess-mcp)
|
|
147
|
+
- [Strava MCP](https://github.com/cotlet-connect/strava-mcp)
|
|
148
|
+
- [StreamElements MCP](https://github.com/cotlet-connect/streamelements-mcp)
|
|
149
|
+
- [Meetup MCP](https://github.com/cotlet-connect/meetup-mcp)
|
|
150
|
+
- [AccuRanker MCP](https://github.com/cotlet-connect/accuranker-mcp)
|
|
151
|
+
- [GetYourGuide MCP](https://github.com/cotlet-connect/getyourguide-mcp)
|
|
152
|
+
- [Idealista MCP](https://github.com/cotlet-connect/idealista-mcp)
|
|
153
|
+
- [Riverside MCP](https://github.com/cotlet-connect/riverside-mcp)
|
|
154
|
+
- [Udemy MCP](https://github.com/cotlet-connect/udemy-mcp)
|
|
155
|
+
- [Faire MCP](https://github.com/cotlet-connect/faire-mcp)
|
|
156
|
+
- [Teachable MCP](https://github.com/cotlet-connect/teachable-mcp)
|
|
157
|
+
- [Vagaro MCP](https://github.com/cotlet-connect/vagaro-mcp)
|
|
158
|
+
- [Buildertrend MCP](https://github.com/cotlet-connect/buildertrend-mcp)
|
|
159
|
+
- [Zoopla MCP](https://github.com/cotlet-connect/zoopla-mcp)
|
|
160
|
+
- [Dribbble MCP](https://github.com/cotlet-connect/dribbble-mcp)
|
|
161
|
+
- [Hostelworld MCP](https://github.com/cotlet-connect/hostelworld-mcp)
|
|
162
|
+
- [Mashvisor MCP](https://github.com/cotlet-connect/mashvisor-mcp)
|
|
163
|
+
- [Rent Manager MCP](https://github.com/cotlet-connect/rent-manager-mcp)
|
|
164
|
+
- [ThriveCart MCP](https://github.com/cotlet-connect/thrivecart-mcp)
|
|
165
|
+
- [Fresha MCP](https://github.com/cotlet-connect/fresha-mcp)
|
|
166
|
+
- [Booksy MCP](https://github.com/cotlet-connect/booksy-mcp)
|
|
167
|
+
- [BookingKoala MCP](https://github.com/cotlet-connect/bookingkoala-mcp)
|
|
168
|
+
- [Milanote MCP](https://github.com/cotlet-connect/milanote-mcp)
|
|
169
|
+
- [Partiful MCP](https://github.com/cotlet-connect/partiful-mcp)
|
|
170
|
+
- [Contractor Foreman MCP](https://github.com/cotlet-connect/contractor-foreman-mcp)
|
|
171
|
+
- [Pixieset MCP](https://github.com/cotlet-connect/pixieset-mcp)
|
|
172
|
+
- [GlossGenius MCP](https://github.com/cotlet-connect/glossgenius-mcp)
|
|
173
|
+
- [ZenMaid MCP](https://github.com/cotlet-connect/zenmaid-mcp)
|
|
174
|
+
- [AroFlo MCP](https://github.com/cotlet-connect/aroflo-mcp)
|
|
175
|
+
- [Simpro MCP](https://github.com/cotlet-connect/simpro-mcp)
|
|
176
|
+
- [Workiz MCP](https://github.com/cotlet-connect/workiz-mcp)
|
|
177
|
+
- [Kickserv MCP](https://github.com/cotlet-connect/kickserv-mcp)
|
|
178
|
+
- [Service Autopilot MCP](https://github.com/cotlet-connect/service-autopilot-mcp)
|
|
179
|
+
- [Boulevard MCP](https://github.com/cotlet-connect/boulevard-mcp)
|
|
180
|
+
- [Mindbody MCP](https://github.com/cotlet-connect/mindbody-mcp)
|
|
181
|
+
- [Meevo MCP](https://github.com/cotlet-connect/meevo-mcp)
|
|
182
|
+
- [DaySmart MCP](https://github.com/cotlet-connect/daysmart-mcp)
|
|
183
|
+
- [Acuity Scheduling MCP](https://github.com/cotlet-connect/acuity-scheduling-mcp)
|
|
184
|
+
- [Jane App MCP](https://github.com/cotlet-connect/jane-app-mcp)
|
|
185
|
+
- [FieldEdge MCP](https://github.com/cotlet-connect/fieldedge-mcp)
|
|
186
|
+
- [Phorest MCP](https://github.com/cotlet-connect/phorest-mcp)
|
|
187
|
+
- [DINGG MCP](https://github.com/cotlet-connect/dingg-mcp)
|
|
188
|
+
- [Invoice Simple MCP](https://github.com/cotlet-connect/invoice-simple-mcp)
|
|
189
|
+
- [PhotoShelter MCP](https://github.com/cotlet-connect/photoshelter-mcp)
|
|
190
|
+
- [RazorSync MCP](https://github.com/cotlet-connect/razorsync-mcp)
|
|
191
|
+
- [ShootProof MCP](https://github.com/cotlet-connect/shootproof-mcp)
|
|
192
|
+
- [Invoice2go MCP](https://github.com/cotlet-connect/invoice2go-mcp)
|
|
193
|
+
- [Appointy MCP](https://github.com/cotlet-connect/appointy-mcp)
|
|
194
|
+
- [Contractor+ MCP](https://github.com/cotlet-connect/contractor-plus-mcp)
|
|
195
|
+
- [Petpooja MCP](https://github.com/cotlet-connect/petpooja-mcp)
|
|
196
|
+
- [Teachers Pay Teachers MCP](https://github.com/cotlet-connect/teachers-pay-teachers-mcp)
|
|
197
|
+
- [Bloom MCP](https://github.com/cotlet-connect/bloom-mcp)
|
|
198
|
+
- [AestheticsPro MCP](https://github.com/cotlet-connect/aestheticspro-mcp)
|
|
199
|
+
- [Club OS MCP](https://github.com/cotlet-connect/club-os-mcp)
|
|
200
|
+
- [EZ Lawn Biller MCP](https://github.com/cotlet-connect/ez-lawn-biller-mcp)
|
|
201
|
+
- [Eversports Studio Manager MCP](https://github.com/cotlet-connect/eversports-studio-manager-mcp)
|
|
202
|
+
- [Exercise.com MCP](https://github.com/cotlet-connect/exercise-com-mcp)
|
|
203
|
+
- [Gymdesk MCP](https://github.com/cotlet-connect/gymdesk-mcp)
|
|
204
|
+
- [Iris Works MCP](https://github.com/cotlet-connect/iris-works-mcp)
|
|
205
|
+
- [CoachingPortal MCP](https://github.com/cotlet-connect/coachingportal-mcp)
|
|
206
|
+
- [CrewNest MCP](https://github.com/cotlet-connect/crewnest-mcp)
|
|
207
|
+
- [Paired Plus MCP](https://github.com/cotlet-connect/paired-plus-mcp)
|
|
208
|
+
- [ClubReady MCP](https://github.com/cotlet-connect/clubready-mcp)
|
|
209
|
+
- [All apps connected through Cotlet.dev](https://github.com/cotlet-connect)
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
More: https://cotlet.dev/integrations/tradify-mcp-server?utm_source=github&utm_medium=readme&utm_campaign=tradify
|
|
214
|
+
|
|
215
|
+
Start free: https://cotlet.dev/signup?app=tradify&utm_source=github&utm_medium=readme&utm_campaign=tradify
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# How to connect Tradify to Claude Code, ChatGPT and any AI agent
|
|
2
|
+
|
|
3
|
+
**Yes, Claude, ChatGPT and other AI agents can work in your Tradify account.** Tradify has no public API, no API keys and no official ChatGPT or Claude app. Cotlet.dev connects your own signed-in Tradify account to any AI agent, so you can ask in plain words and the AI creates the job, writes the quote, turns it into an invoice, records the payment and books your staff. It shows you the draft first and sends nothing to a customer until you say so.
|
|
4
|
+
|
|
5
|
+
## What you can ask
|
|
6
|
+
|
|
7
|
+
> New job for Sam Lee at 12 Oak St: replace the hot water cylinder. Book Mike for Thursday morning.
|
|
8
|
+
|
|
9
|
+
> Quote the bathroom rewire at 14 Elm Rd from my notes: 6 hours labour, 6 LED downlights at $24, one extractor fan at $85. Show me before you send it.
|
|
10
|
+
|
|
11
|
+
> Turn every quote accepted this week into a 30% deposit invoice.
|
|
12
|
+
|
|
13
|
+
> Which invoices are overdue? Total them per customer, oldest first.
|
|
14
|
+
|
|
15
|
+
> What is on tomorrow's schedule, per staff member?
|
|
16
|
+
|
|
17
|
+
## Connect in 2 minutes
|
|
18
|
+
|
|
19
|
+
Get your API key at https://cotlet.dev/app and export it as `COTLET_API_KEY`.
|
|
20
|
+
|
|
21
|
+
### Claude Code
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
claude mcp add --transport http cotlet https://cotlet.dev/mcp/v1 --header "Authorization: Bearer $COTLET_API_KEY"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### ChatGPT
|
|
28
|
+
|
|
29
|
+
Settings → Apps → add connector URL `https://cotlet.dev/mcp/v1`, then sign in with Cotlet.dev. No API key needed.
|
|
30
|
+
|
|
31
|
+
### Cursor
|
|
32
|
+
|
|
33
|
+
Copy `.cursor/mcp.json` from this repo into your project:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"mcpServers": {
|
|
38
|
+
"cotlet": {
|
|
39
|
+
"url": "https://cotlet.dev/mcp/v1",
|
|
40
|
+
"headers": {
|
|
41
|
+
"Authorization": "Bearer ${COTLET_API_KEY}"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Run it locally (stdio)
|
|
49
|
+
|
|
50
|
+
This repo is a real MCP server. It speaks MCP over stdio, lists its Tradify tools without any key, and forwards every tool call to the hosted Cotlet.dev server. The hosted URL above stays the recommended way. Use this when your client only starts local servers.
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{"mcpServers":{"tradify":{"command":"uvx","args":["tradify-mcp"],"env":{"COTLET_API_KEY":"your-key"}}}}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Or with Docker:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
docker build -t tradify-mcp .
|
|
60
|
+
docker run -i --rm -e COTLET_API_KEY tradify-mcp
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Tools: `tradify_guide`, `tradify_status`, `tradify_open`, `tradify_read`, `tradify_click`, `tradify_type`, `tradify_close`. Without `COTLET_API_KEY` a tool call answers: "Set COTLET_API_KEY. Get a key at https://cotlet.dev/app".
|
|
64
|
+
|
|
65
|
+
## Command line
|
|
66
|
+
|
|
67
|
+
Python 3.10+, nothing else to install. From PyPI:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pip install tradify-mcp # or run it once: uvx tradify-mcp connect
|
|
71
|
+
tradify-mcp connect
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Or straight from this repo:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
export COTLET_API_KEY="your-key"
|
|
78
|
+
python3 tradify_agent.py connect # ready config for Claude Code, Cursor, ChatGPT
|
|
79
|
+
python3 tradify_agent.py status # is Tradify ready in your Cotlet.dev account
|
|
80
|
+
python3 tradify_agent.py guide # Tradify screens and sign-in link
|
|
81
|
+
python3 tradify_agent.py read # open Tradify, read the page, close the browser
|
|
82
|
+
python3 tradify_agent.py tools # list Cotlet.dev tools
|
|
83
|
+
python3 tradify_agent.py serve # start the stdio MCP server (same as no argument)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Questions from Tradify users
|
|
87
|
+
|
|
88
|
+
**Does Tradify have an API?**
|
|
89
|
+
|
|
90
|
+
Not a public one. Tradify offers no public API, no self-service API keys and no webhooks, only built-in integrations such as Xero, QuickBooks, MYOB and Stripe. Cotlet.dev works in your Tradify account directly, so your AI agent can handle jobs, quotes, invoices and the Scheduler without one.
|
|
91
|
+
|
|
92
|
+
**How do I connect Tradify to ChatGPT?**
|
|
93
|
+
|
|
94
|
+
Add Cotlet.dev as an app in ChatGPT (Settings → Apps, connector URL `https://cotlet.dev/mcp/v1/tradify`), sign in to Tradify once in your Cotlet.dev Cloud Browser, and ask ChatGPT in plain words. No code and no Tradify API key.
|
|
95
|
+
|
|
96
|
+
**Is there a way to use Claude with Tradify?**
|
|
97
|
+
|
|
98
|
+
Yes. In Claude Code run the one-line `claude mcp add` command above; in the Claude app add `https://cotlet.dev/mcp/v1/tradify` as a custom connector. Claude then works in your own Tradify account.
|
|
99
|
+
|
|
100
|
+
**Can AI do my Tradify quotes and invoices?**
|
|
101
|
+
|
|
102
|
+
Yes. Give it your notes and it writes a draft quote with labour and materials lines, turns an accepted quote into a full or deposit invoice, records payments and lists what is overdue. Nothing reaches a customer before your OK, and invoices still sync to Xero or QuickBooks as you set it up.
|
|
103
|
+
|
|
104
|
+
**Is there a Tradify MCP server?**
|
|
105
|
+
|
|
106
|
+
Tradify has no official MCP server. Cotlet.dev is a hosted MCP server that works in Tradify for you, 24/7, with Claude, ChatGPT, Cursor, Codex, n8n, Make and Zapier. A self-hosted version for developers is on GitHub.
|
|
107
|
+
|
|
108
|
+
## Find it on
|
|
109
|
+
|
|
110
|
+
- [Tradify on Cotlet.dev](https://cotlet.dev/integrations/tradify-mcp-server?utm_source=github&utm_medium=readme&utm_campaign=tradify&utm_content=find)
|
|
111
|
+
- [PyPI package tradify-mcp](https://pypi.org/project/tradify-mcp/)
|
|
112
|
+
- [Glama](https://glama.ai/mcp/servers/cotlet-connect/tradify-mcp)
|
|
113
|
+
- [LobeHub](https://lobehub.com/mcp/cotlet-connect-tradify-mcp)
|
|
114
|
+
- [Odel](https://odel.app/modules/cotlet/tradify)
|
|
115
|
+
- [mcpbeat](https://mcpbeat.com/mcp-servers/cotlet/tradify/)
|
|
116
|
+
- [Step-by-step guide (PDF) on Internet Archive](https://archive.org/details/cotlet-connect-tradify-to-ai-agents-guide)
|
|
117
|
+
|
|
118
|
+
## Also works with
|
|
119
|
+
|
|
120
|
+
- [Mangomint MCP](https://github.com/cotlet-connect/mangomint-mcp)
|
|
121
|
+
- [Wanderlog MCP](https://github.com/cotlet-connect/wanderlog-mcp)
|
|
122
|
+
- [SmugMug MCP](https://github.com/cotlet-connect/smugmug-mcp)
|
|
123
|
+
- [Garmin Connect MCP](https://github.com/cotlet-connect/garmin-mcp)
|
|
124
|
+
- [Housecall Pro MCP](https://github.com/cotlet-connect/housecall-pro-mcp)
|
|
125
|
+
- [Medium MCP](https://github.com/cotlet-connect/medium-mcp)
|
|
126
|
+
- [Crexi MCP](https://github.com/cotlet-connect/crexi-mcp)
|
|
127
|
+
- [DistroKid MCP](https://github.com/cotlet-connect/distrokid-mcp)
|
|
128
|
+
- [LinkedIn MCP](https://github.com/cotlet-connect/linkedin-mcp)
|
|
129
|
+
- [EstimateOne MCP](https://github.com/cotlet-connect/estimateone-mcp)
|
|
130
|
+
- [Google Search Console MCP](https://github.com/cotlet-connect/google-search-console-mcp)
|
|
131
|
+
- [Lichess MCP](https://github.com/cotlet-connect/lichess-mcp)
|
|
132
|
+
- [Strava MCP](https://github.com/cotlet-connect/strava-mcp)
|
|
133
|
+
- [StreamElements MCP](https://github.com/cotlet-connect/streamelements-mcp)
|
|
134
|
+
- [Meetup MCP](https://github.com/cotlet-connect/meetup-mcp)
|
|
135
|
+
- [AccuRanker MCP](https://github.com/cotlet-connect/accuranker-mcp)
|
|
136
|
+
- [GetYourGuide MCP](https://github.com/cotlet-connect/getyourguide-mcp)
|
|
137
|
+
- [Idealista MCP](https://github.com/cotlet-connect/idealista-mcp)
|
|
138
|
+
- [Riverside MCP](https://github.com/cotlet-connect/riverside-mcp)
|
|
139
|
+
- [Udemy MCP](https://github.com/cotlet-connect/udemy-mcp)
|
|
140
|
+
- [Faire MCP](https://github.com/cotlet-connect/faire-mcp)
|
|
141
|
+
- [Teachable MCP](https://github.com/cotlet-connect/teachable-mcp)
|
|
142
|
+
- [Vagaro MCP](https://github.com/cotlet-connect/vagaro-mcp)
|
|
143
|
+
- [Buildertrend MCP](https://github.com/cotlet-connect/buildertrend-mcp)
|
|
144
|
+
- [Zoopla MCP](https://github.com/cotlet-connect/zoopla-mcp)
|
|
145
|
+
- [Dribbble MCP](https://github.com/cotlet-connect/dribbble-mcp)
|
|
146
|
+
- [Hostelworld MCP](https://github.com/cotlet-connect/hostelworld-mcp)
|
|
147
|
+
- [Mashvisor MCP](https://github.com/cotlet-connect/mashvisor-mcp)
|
|
148
|
+
- [Rent Manager MCP](https://github.com/cotlet-connect/rent-manager-mcp)
|
|
149
|
+
- [ThriveCart MCP](https://github.com/cotlet-connect/thrivecart-mcp)
|
|
150
|
+
- [Fresha MCP](https://github.com/cotlet-connect/fresha-mcp)
|
|
151
|
+
- [Booksy MCP](https://github.com/cotlet-connect/booksy-mcp)
|
|
152
|
+
- [BookingKoala MCP](https://github.com/cotlet-connect/bookingkoala-mcp)
|
|
153
|
+
- [Milanote MCP](https://github.com/cotlet-connect/milanote-mcp)
|
|
154
|
+
- [Partiful MCP](https://github.com/cotlet-connect/partiful-mcp)
|
|
155
|
+
- [Contractor Foreman MCP](https://github.com/cotlet-connect/contractor-foreman-mcp)
|
|
156
|
+
- [Pixieset MCP](https://github.com/cotlet-connect/pixieset-mcp)
|
|
157
|
+
- [GlossGenius MCP](https://github.com/cotlet-connect/glossgenius-mcp)
|
|
158
|
+
- [ZenMaid MCP](https://github.com/cotlet-connect/zenmaid-mcp)
|
|
159
|
+
- [AroFlo MCP](https://github.com/cotlet-connect/aroflo-mcp)
|
|
160
|
+
- [Simpro MCP](https://github.com/cotlet-connect/simpro-mcp)
|
|
161
|
+
- [Workiz MCP](https://github.com/cotlet-connect/workiz-mcp)
|
|
162
|
+
- [Kickserv MCP](https://github.com/cotlet-connect/kickserv-mcp)
|
|
163
|
+
- [Service Autopilot MCP](https://github.com/cotlet-connect/service-autopilot-mcp)
|
|
164
|
+
- [Boulevard MCP](https://github.com/cotlet-connect/boulevard-mcp)
|
|
165
|
+
- [Mindbody MCP](https://github.com/cotlet-connect/mindbody-mcp)
|
|
166
|
+
- [Meevo MCP](https://github.com/cotlet-connect/meevo-mcp)
|
|
167
|
+
- [DaySmart MCP](https://github.com/cotlet-connect/daysmart-mcp)
|
|
168
|
+
- [Acuity Scheduling MCP](https://github.com/cotlet-connect/acuity-scheduling-mcp)
|
|
169
|
+
- [Jane App MCP](https://github.com/cotlet-connect/jane-app-mcp)
|
|
170
|
+
- [FieldEdge MCP](https://github.com/cotlet-connect/fieldedge-mcp)
|
|
171
|
+
- [Phorest MCP](https://github.com/cotlet-connect/phorest-mcp)
|
|
172
|
+
- [DINGG MCP](https://github.com/cotlet-connect/dingg-mcp)
|
|
173
|
+
- [Invoice Simple MCP](https://github.com/cotlet-connect/invoice-simple-mcp)
|
|
174
|
+
- [PhotoShelter MCP](https://github.com/cotlet-connect/photoshelter-mcp)
|
|
175
|
+
- [RazorSync MCP](https://github.com/cotlet-connect/razorsync-mcp)
|
|
176
|
+
- [ShootProof MCP](https://github.com/cotlet-connect/shootproof-mcp)
|
|
177
|
+
- [Invoice2go MCP](https://github.com/cotlet-connect/invoice2go-mcp)
|
|
178
|
+
- [Appointy MCP](https://github.com/cotlet-connect/appointy-mcp)
|
|
179
|
+
- [Contractor+ MCP](https://github.com/cotlet-connect/contractor-plus-mcp)
|
|
180
|
+
- [Petpooja MCP](https://github.com/cotlet-connect/petpooja-mcp)
|
|
181
|
+
- [Teachers Pay Teachers MCP](https://github.com/cotlet-connect/teachers-pay-teachers-mcp)
|
|
182
|
+
- [Bloom MCP](https://github.com/cotlet-connect/bloom-mcp)
|
|
183
|
+
- [AestheticsPro MCP](https://github.com/cotlet-connect/aestheticspro-mcp)
|
|
184
|
+
- [Club OS MCP](https://github.com/cotlet-connect/club-os-mcp)
|
|
185
|
+
- [EZ Lawn Biller MCP](https://github.com/cotlet-connect/ez-lawn-biller-mcp)
|
|
186
|
+
- [Eversports Studio Manager MCP](https://github.com/cotlet-connect/eversports-studio-manager-mcp)
|
|
187
|
+
- [Exercise.com MCP](https://github.com/cotlet-connect/exercise-com-mcp)
|
|
188
|
+
- [Gymdesk MCP](https://github.com/cotlet-connect/gymdesk-mcp)
|
|
189
|
+
- [Iris Works MCP](https://github.com/cotlet-connect/iris-works-mcp)
|
|
190
|
+
- [CoachingPortal MCP](https://github.com/cotlet-connect/coachingportal-mcp)
|
|
191
|
+
- [CrewNest MCP](https://github.com/cotlet-connect/crewnest-mcp)
|
|
192
|
+
- [Paired Plus MCP](https://github.com/cotlet-connect/paired-plus-mcp)
|
|
193
|
+
- [ClubReady MCP](https://github.com/cotlet-connect/clubready-mcp)
|
|
194
|
+
- [All apps connected through Cotlet.dev](https://github.com/cotlet-connect)
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
More: https://cotlet.dev/integrations/tradify-mcp-server?utm_source=github&utm_medium=readme&utm_campaign=tradify
|
|
199
|
+
|
|
200
|
+
Start free: https://cotlet.dev/signup?app=tradify&utm_source=github&utm_medium=readme&utm_campaign=tradify
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Example prompts for Tradify
|
|
2
|
+
|
|
3
|
+
- New job for Sam Lee at 12 Oak St: replace the hot water cylinder. Book Mike for Thursday morning.
|
|
4
|
+
- Quote the bathroom rewire at 14 Elm Rd from my notes: 6 hours labour, 6 LED downlights at $24, one extractor fan at $85. Show me before you send it.
|
|
5
|
+
- Turn every quote accepted this week into a 30% deposit invoice.
|
|
6
|
+
- Which invoices are overdue? Total them per customer, oldest first.
|
|
7
|
+
- What is on tomorrow's schedule, per staff member?
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"$schema": "https://glama.ai/mcp/schemas/server.json", "maintainers": ["cotlet-connect"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"cotlet": {
|
|
4
|
+
"url": "https://cotlet.dev/mcp/v1",
|
|
5
|
+
"headers": {
|
|
6
|
+
"Authorization": "Bearer ${COTLET_API_KEY}"
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"tradify": {
|
|
10
|
+
"command": "uvx",
|
|
11
|
+
"args": ["tradify-api-mcp"],
|
|
12
|
+
"env": {
|
|
13
|
+
"COTLET_API_KEY": "${COTLET_API_KEY}"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "tradify-mcp"
|
|
3
|
+
version = "1.1.0"
|
|
4
|
+
description = "Connect Tradify to Claude Code, ChatGPT and any AI agent through Cotlet.dev, a hosted MCP server. No Tradify API key needed."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "Elastic-2.0"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
requires-python = ">=3.10"
|
|
9
|
+
authors = [{ name = "Cotlet.dev", email = "contact@cotlet.dev" }]
|
|
10
|
+
keywords = ["tradify", "tradify api", "tradify mcp", "mcp server", "claude", "chatgpt", "ai agent", "cotlet"]
|
|
11
|
+
classifiers = ["Programming Language :: Python :: 3", "Topic :: Office/Business"]
|
|
12
|
+
dependencies = []
|
|
13
|
+
|
|
14
|
+
[project.urls]
|
|
15
|
+
Homepage = "https://cotlet.dev/integrations/tradify-api-mcp-server?utm_source=pypi&utm_medium=package&utm_campaign=tradify"
|
|
16
|
+
Source = "https://github.com/cotlet-connect/tradify-mcp"
|
|
17
|
+
|
|
18
|
+
[project.scripts]
|
|
19
|
+
tradify-mcp = "tradify_agent:main"
|
|
20
|
+
|
|
21
|
+
[build-system]
|
|
22
|
+
requires = ["hatchling>=1.27"]
|
|
23
|
+
build-backend = "hatchling.build"
|
|
24
|
+
|
|
25
|
+
[tool.hatch.build.targets.wheel.force-include]
|
|
26
|
+
"tradify_agent.py" = "tradify_agent.py"
|
|
27
|
+
|
|
28
|
+
[tool.hatch.build.targets.sdist]
|
|
29
|
+
include = ["tradify_agent.py", "README.md", "LICENSE", "mcp.json", "Dockerfile", "glama.json", "skills", "examples", ".cursor"]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tradify-cotlet
|
|
3
|
+
description: Connect Tradify to Claude Code, ChatGPT and any AI agent through Cotlet.dev, so the agent can create jobs, quotes and invoices and book staff in your own signed-in Tradify account.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Tradify through Cotlet.dev
|
|
7
|
+
|
|
8
|
+
## What it does
|
|
9
|
+
|
|
10
|
+
Cotlet.dev runs your own Chrome in the cloud. The agent works in Tradify (go.tradifyhq.com) there, signed in as you.
|
|
11
|
+
|
|
12
|
+
## Setup
|
|
13
|
+
|
|
14
|
+
1. Get an API key at https://cotlet.dev/app.
|
|
15
|
+
2. Add the MCP server `https://cotlet.dev/mcp/v1` with header `Authorization: Bearer <your key>`.
|
|
16
|
+
|
|
17
|
+
## Working rules
|
|
18
|
+
|
|
19
|
+
- First call `cotlet_app_guide` with app "tradify".
|
|
20
|
+
- Then use `cotlet_browser_open`, `cotlet_browser_read` and `cotlet_browser_click`, one call at a time. Wait for each answer.
|
|
21
|
+
- At a sign-in page or CAPTCHA, stop and give the user the browser link.
|
|
22
|
+
- Ask the user before sending, publishing, deleting or paying.
|
|
23
|
+
- Close the browser with `cotlet_browser_close` when done.
|
|
24
|
+
|
|
25
|
+
More: https://cotlet.dev/integrations/tradify-api-mcp-server?utm_source=clawhub&utm_medium=skill&utm_campaign=tradify
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Tradify through Cotlet.dev: stdio MCP server and small CLI over the hosted Cotlet.dev MCP server (stdlib only)."""
|
|
3
|
+
import argparse
|
|
4
|
+
import json
|
|
5
|
+
import os
|
|
6
|
+
import sys
|
|
7
|
+
import urllib.error
|
|
8
|
+
import urllib.request
|
|
9
|
+
|
|
10
|
+
START_URL = "https://go.tradifyhq.com"
|
|
11
|
+
SLUG = "tradify"
|
|
12
|
+
URL = "https://cotlet.dev/mcp/v1"
|
|
13
|
+
GUIDE_FIELD = "app"
|
|
14
|
+
KEY_HELP = "Set COTLET_API_KEY. Get a key at https://cotlet.dev/app"
|
|
15
|
+
NAME = "Tradify"
|
|
16
|
+
JOB = "create jobs, quotes and invoices and book staff"
|
|
17
|
+
VERSION = "1.1.0"
|
|
18
|
+
PREFIX = "tradify"
|
|
19
|
+
PROTOCOLS = ("2025-06-18", "2025-03-26", "2024-11-05")
|
|
20
|
+
|
|
21
|
+
CONFIG = {"mcpServers": {"cotlet": {"url": URL, "headers": {"Authorization": "Bearer ${COTLET_API_KEY}"}}}}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class Client:
|
|
25
|
+
def __init__(self, key):
|
|
26
|
+
self.key = key
|
|
27
|
+
self.session = None
|
|
28
|
+
self.next_id = 0
|
|
29
|
+
|
|
30
|
+
def _post(self, payload):
|
|
31
|
+
headers = {
|
|
32
|
+
"Authorization": "Bearer " + self.key,
|
|
33
|
+
"Accept": "application/json, text/event-stream",
|
|
34
|
+
"Content-Type": "application/json",
|
|
35
|
+
}
|
|
36
|
+
if self.session:
|
|
37
|
+
headers["Mcp-Session-Id"] = self.session
|
|
38
|
+
req = urllib.request.Request(URL, json.dumps(payload).encode(), headers, method="POST")
|
|
39
|
+
try:
|
|
40
|
+
with urllib.request.urlopen(req, timeout=120) as resp:
|
|
41
|
+
self.session = resp.headers.get("Mcp-Session-Id") or self.session
|
|
42
|
+
return resp.read().decode(), resp.headers.get("Content-Type", "")
|
|
43
|
+
except urllib.error.HTTPError as e:
|
|
44
|
+
raise RuntimeError("HTTP %s: %s" % (e.code, e.read().decode(errors="replace")[:300]))
|
|
45
|
+
|
|
46
|
+
@staticmethod
|
|
47
|
+
def _parse(body, ctype, rid):
|
|
48
|
+
if "text/event-stream" in ctype:
|
|
49
|
+
for line in body.splitlines():
|
|
50
|
+
if line.startswith("data:"):
|
|
51
|
+
try:
|
|
52
|
+
msg = json.loads(line[5:].strip())
|
|
53
|
+
except ValueError:
|
|
54
|
+
continue
|
|
55
|
+
if msg.get("id") == rid:
|
|
56
|
+
return msg
|
|
57
|
+
raise RuntimeError("No JSON-RPC answer in stream")
|
|
58
|
+
return json.loads(body)
|
|
59
|
+
|
|
60
|
+
def rpc(self, method, params=None):
|
|
61
|
+
self.next_id += 1
|
|
62
|
+
rid = self.next_id
|
|
63
|
+
body, ctype = self._post({"jsonrpc": "2.0", "id": rid, "method": method, "params": params or {}})
|
|
64
|
+
msg = self._parse(body, ctype, rid)
|
|
65
|
+
if "error" in msg:
|
|
66
|
+
raise RuntimeError(msg["error"].get("message", str(msg["error"])))
|
|
67
|
+
return msg.get("result", {})
|
|
68
|
+
|
|
69
|
+
def start(self):
|
|
70
|
+
self.rpc("initialize", {
|
|
71
|
+
"protocolVersion": "2025-06-18",
|
|
72
|
+
"capabilities": {},
|
|
73
|
+
"clientInfo": {"name": SLUG + "-mcp", "version": "1.0.0"},
|
|
74
|
+
})
|
|
75
|
+
self._post({"jsonrpc": "2.0", "method": "notifications/initialized"})
|
|
76
|
+
|
|
77
|
+
def call(self, tool, args):
|
|
78
|
+
res = self.rpc("tools/call", {"name": tool, "arguments": args})
|
|
79
|
+
text = "\n".join(c.get("text", "") for c in res.get("content", []) if c.get("type") == "text")
|
|
80
|
+
if res.get("isError"):
|
|
81
|
+
raise RuntimeError(text or "tool error")
|
|
82
|
+
return text
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def _obj(props, required=()):
|
|
86
|
+
schema = {"type": "object", "properties": props, "additionalProperties": False}
|
|
87
|
+
if required:
|
|
88
|
+
schema["required"] = list(required)
|
|
89
|
+
return schema
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
# Static tool list: answers tools/list without any key. Each tool forwards to one Cotlet.dev tool.
|
|
93
|
+
TOOLS = [
|
|
94
|
+
(PREFIX + "_guide", "How to work in %s (%s): its screens and the sign-in link. Call this first." % (NAME, JOB),
|
|
95
|
+
_obj({"task": {"type": "string", "description": "What you want done in %s, in your words." % NAME}})),
|
|
96
|
+
(PREFIX + "_status", "Check that your Cotlet.dev account and %s are ready: account, credits and %s connection." % (NAME, NAME),
|
|
97
|
+
_obj({})),
|
|
98
|
+
(PREFIX + "_open", "Open a %s page in your signed-in Cloud Browser (default %s) to work with %s." % (NAME, START_URL, JOB),
|
|
99
|
+
_obj({"url": {"type": "string", "description": "Page to open. Default: " + START_URL}})),
|
|
100
|
+
(PREFIX + "_read", "Read the current %s page: its text and numbered buttons, links and fields." % NAME,
|
|
101
|
+
_obj({"element": {"type": "integer", "minimum": 1, "description": "Read only inside this element."}})),
|
|
102
|
+
(PREFIX + "_click", "Click a numbered element on the current %s page." % NAME,
|
|
103
|
+
_obj({"element": {"type": "integer", "minimum": 1, "description": "Element number from the last read."}}, ["element"])),
|
|
104
|
+
(PREFIX + "_type", "Type text into a numbered field on the current %s page." % NAME,
|
|
105
|
+
_obj({"element": {"type": "integer", "minimum": 1, "description": "Field number from the last read."},
|
|
106
|
+
"text": {"type": "string", "description": "Text to type."}}, ["element", "text"])),
|
|
107
|
+
(PREFIX + "_close", "Close the %s browser session when the work is done, so credits stop running." % NAME,
|
|
108
|
+
_obj({})),
|
|
109
|
+
]
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def _forward(client, short, args):
|
|
113
|
+
"""Run one static tool against the hosted server; returns text."""
|
|
114
|
+
if short == "guide":
|
|
115
|
+
up = {GUIDE_FIELD: SLUG}
|
|
116
|
+
if args.get("task"):
|
|
117
|
+
up["task"] = str(args["task"])
|
|
118
|
+
return client.call("cotlet_app_guide", up)
|
|
119
|
+
if short == "status":
|
|
120
|
+
return client.call("cotlet_whoami", {}) + "\n\n" + client.call("cotlet_apps", {"app": SLUG})
|
|
121
|
+
if short == "open":
|
|
122
|
+
return client.call("cotlet_browser_open", {"url": args.get("url") or START_URL})
|
|
123
|
+
if short == "read":
|
|
124
|
+
return client.call("cotlet_browser_read", {k: args[k] for k in ("element",) if k in args})
|
|
125
|
+
if short == "click":
|
|
126
|
+
return client.call("cotlet_browser_click", {"element": args["element"]})
|
|
127
|
+
if short == "type":
|
|
128
|
+
return client.call("cotlet_browser_type", {"element": args["element"], "text": args["text"]})
|
|
129
|
+
return client.call("cotlet_browser_close", {})
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class Server:
|
|
133
|
+
def __init__(self):
|
|
134
|
+
self.client = None
|
|
135
|
+
|
|
136
|
+
def call_tool(self, name, args):
|
|
137
|
+
short = name[len(PREFIX) + 1:] if name.startswith(PREFIX + "_") else ""
|
|
138
|
+
if short not in [t[0][len(PREFIX) + 1:] for t in TOOLS]:
|
|
139
|
+
return {"content": [{"type": "text", "text": "Unknown tool: %s" % name}], "isError": True}
|
|
140
|
+
key = os.environ.get("COTLET_API_KEY")
|
|
141
|
+
if not key:
|
|
142
|
+
return {"content": [{"type": "text", "text": KEY_HELP}], "isError": True}
|
|
143
|
+
try:
|
|
144
|
+
if self.client is None:
|
|
145
|
+
self.client = Client(key)
|
|
146
|
+
self.client.start()
|
|
147
|
+
text = _forward(self.client, short, args or {})
|
|
148
|
+
return {"content": [{"type": "text", "text": text}]}
|
|
149
|
+
except Exception as e:
|
|
150
|
+
self.client = None
|
|
151
|
+
return {"content": [{"type": "text", "text": str(e)}], "isError": True}
|
|
152
|
+
|
|
153
|
+
def handle(self, msg):
|
|
154
|
+
method, rid, params = msg.get("method"), msg.get("id"), msg.get("params") or {}
|
|
155
|
+
if rid is None:
|
|
156
|
+
return None # notification
|
|
157
|
+
if method == "initialize":
|
|
158
|
+
want = params.get("protocolVersion")
|
|
159
|
+
result = {
|
|
160
|
+
"protocolVersion": want if want in PROTOCOLS else PROTOCOLS[0],
|
|
161
|
+
"capabilities": {"tools": {"listChanged": False}},
|
|
162
|
+
"serverInfo": {"name": SLUG + "-mcp", "version": VERSION},
|
|
163
|
+
"instructions": "%s through Cotlet.dev. Call %s_guide first. Set COTLET_API_KEY (https://cotlet.dev/app)." % (NAME, PREFIX),
|
|
164
|
+
}
|
|
165
|
+
elif method == "ping":
|
|
166
|
+
result = {}
|
|
167
|
+
elif method == "tools/list":
|
|
168
|
+
result = {"tools": [{"name": n, "description": d, "inputSchema": s} for n, d, s in TOOLS]}
|
|
169
|
+
elif method == "tools/call":
|
|
170
|
+
result = self.call_tool(params.get("name", ""), params.get("arguments"))
|
|
171
|
+
else:
|
|
172
|
+
return {"jsonrpc": "2.0", "id": rid, "error": {"code": -32601, "message": "Method not found: %s" % method}}
|
|
173
|
+
return {"jsonrpc": "2.0", "id": rid, "result": result}
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def serve():
|
|
177
|
+
"""MCP stdio transport: one JSON-RPC message per line on stdin/stdout, logs on stderr."""
|
|
178
|
+
server = Server()
|
|
179
|
+
for line in sys.stdin:
|
|
180
|
+
line = line.strip()
|
|
181
|
+
if not line:
|
|
182
|
+
continue
|
|
183
|
+
try:
|
|
184
|
+
msg = json.loads(line)
|
|
185
|
+
reply = server.handle(msg) if isinstance(msg, dict) else None
|
|
186
|
+
except ValueError:
|
|
187
|
+
reply = {"jsonrpc": "2.0", "id": None, "error": {"code": -32700, "message": "Parse error"}}
|
|
188
|
+
except Exception as e:
|
|
189
|
+
print("Error: %s" % e, file=sys.stderr)
|
|
190
|
+
reply = {"jsonrpc": "2.0", "id": msg.get("id"), "error": {"code": -32603, "message": str(e)}}
|
|
191
|
+
if reply is not None:
|
|
192
|
+
sys.stdout.write(json.dumps(reply) + "\n")
|
|
193
|
+
sys.stdout.flush()
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
def connect():
|
|
197
|
+
print("Claude Code:\n claude mcp add --transport http cotlet %s --header \"Authorization: Bearer $COTLET_API_KEY\"\n" % URL)
|
|
198
|
+
print("Cursor (.cursor/mcp.json):\n" + json.dumps(CONFIG, indent=2) + "\n")
|
|
199
|
+
print("ChatGPT:\n Settings -> Apps -> add connector URL %s, sign in with Cotlet.dev (no API key)." % URL)
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def main():
|
|
203
|
+
p = argparse.ArgumentParser(description="Tradify through Cotlet.dev")
|
|
204
|
+
sub = p.add_subparsers(dest="cmd")
|
|
205
|
+
for name in ("serve", "connect", "status", "guide", "tools"):
|
|
206
|
+
sub.add_parser(name)
|
|
207
|
+
r = sub.add_parser("read")
|
|
208
|
+
r.add_argument("url", nargs="?")
|
|
209
|
+
args = p.parse_args()
|
|
210
|
+
if args.cmd in (None, "serve"):
|
|
211
|
+
return serve()
|
|
212
|
+
if args.cmd == "connect":
|
|
213
|
+
return connect()
|
|
214
|
+
key = os.environ.get("COTLET_API_KEY")
|
|
215
|
+
if not key:
|
|
216
|
+
print(KEY_HELP)
|
|
217
|
+
sys.exit(2)
|
|
218
|
+
try:
|
|
219
|
+
c = Client(key)
|
|
220
|
+
c.start()
|
|
221
|
+
if args.cmd == "tools":
|
|
222
|
+
print("\n".join(t["name"] for t in c.rpc("tools/list").get("tools", [])))
|
|
223
|
+
elif args.cmd == "status":
|
|
224
|
+
print(c.call("cotlet_apps", {"app": SLUG}))
|
|
225
|
+
elif args.cmd == "guide":
|
|
226
|
+
print(c.call("cotlet_app_guide", {GUIDE_FIELD: SLUG}))
|
|
227
|
+
elif args.cmd == "read":
|
|
228
|
+
# Works in the user's Web browser, where they sign in to the app once.
|
|
229
|
+
c.call("cotlet_browser_open", {"url": args.url or START_URL})
|
|
230
|
+
try:
|
|
231
|
+
print(c.call("cotlet_browser_read", {}))
|
|
232
|
+
finally:
|
|
233
|
+
c.call("cotlet_browser_close", {})
|
|
234
|
+
except Exception as e:
|
|
235
|
+
print("Error: %s" % e, file=sys.stderr)
|
|
236
|
+
sys.exit(1)
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
if __name__ == "__main__":
|
|
240
|
+
main()
|