propstack-mcp-server 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.
Files changed (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +321 -0
  3. package/dist/index.d.ts +3 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +55 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/propstack-client.d.ts +24 -0
  8. package/dist/propstack-client.d.ts.map +1 -0
  9. package/dist/propstack-client.js +99 -0
  10. package/dist/propstack-client.js.map +1 -0
  11. package/dist/tools/activities.d.ts +4 -0
  12. package/dist/tools/activities.d.ts.map +1 -0
  13. package/dist/tools/activities.js +177 -0
  14. package/dist/tools/activities.js.map +1 -0
  15. package/dist/tools/admin.d.ts +4 -0
  16. package/dist/tools/admin.d.ts.map +1 -0
  17. package/dist/tools/admin.js +148 -0
  18. package/dist/tools/admin.js.map +1 -0
  19. package/dist/tools/composites.d.ts +4 -0
  20. package/dist/tools/composites.d.ts.map +1 -0
  21. package/dist/tools/composites.js +807 -0
  22. package/dist/tools/composites.js.map +1 -0
  23. package/dist/tools/contacts.d.ts +4 -0
  24. package/dist/tools/contacts.d.ts.map +1 -0
  25. package/dist/tools/contacts.js +386 -0
  26. package/dist/tools/contacts.js.map +1 -0
  27. package/dist/tools/deals.d.ts +4 -0
  28. package/dist/tools/deals.d.ts.map +1 -0
  29. package/dist/tools/deals.js +230 -0
  30. package/dist/tools/deals.js.map +1 -0
  31. package/dist/tools/documents.d.ts +4 -0
  32. package/dist/tools/documents.d.ts.map +1 -0
  33. package/dist/tools/documents.js +109 -0
  34. package/dist/tools/documents.js.map +1 -0
  35. package/dist/tools/emails.d.ts +4 -0
  36. package/dist/tools/emails.d.ts.map +1 -0
  37. package/dist/tools/emails.js +111 -0
  38. package/dist/tools/emails.js.map +1 -0
  39. package/dist/tools/helpers.d.ts +39 -0
  40. package/dist/tools/helpers.d.ts.map +1 -0
  41. package/dist/tools/helpers.js +160 -0
  42. package/dist/tools/helpers.js.map +1 -0
  43. package/dist/tools/lookups.d.ts +4 -0
  44. package/dist/tools/lookups.d.ts.map +1 -0
  45. package/dist/tools/lookups.js +333 -0
  46. package/dist/tools/lookups.js.map +1 -0
  47. package/dist/tools/projects.d.ts +4 -0
  48. package/dist/tools/projects.d.ts.map +1 -0
  49. package/dist/tools/projects.js +104 -0
  50. package/dist/tools/projects.js.map +1 -0
  51. package/dist/tools/properties.d.ts +4 -0
  52. package/dist/tools/properties.d.ts.map +1 -0
  53. package/dist/tools/properties.js +397 -0
  54. package/dist/tools/properties.js.map +1 -0
  55. package/dist/tools/relationships.d.ts +4 -0
  56. package/dist/tools/relationships.d.ts.map +1 -0
  57. package/dist/tools/relationships.js +55 -0
  58. package/dist/tools/relationships.js.map +1 -0
  59. package/dist/tools/search-profiles.d.ts +4 -0
  60. package/dist/tools/search-profiles.d.ts.map +1 -0
  61. package/dist/tools/search-profiles.js +345 -0
  62. package/dist/tools/search-profiles.js.map +1 -0
  63. package/dist/tools/tasks.d.ts +4 -0
  64. package/dist/tools/tasks.d.ts.map +1 -0
  65. package/dist/tools/tasks.js +251 -0
  66. package/dist/tools/tasks.js.map +1 -0
  67. package/dist/types/propstack.d.ts +444 -0
  68. package/dist/types/propstack.d.ts.map +1 -0
  69. package/dist/types/propstack.js +3 -0
  70. package/dist/types/propstack.js.map +1 -0
  71. package/package.json +54 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 propstack-mcp-server contributors
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,321 @@
1
+ # Propstack MCP Server
2
+
3
+ Connect AI assistants (Claude, ChatGPT) to your Propstack real estate CRM.
4
+
5
+ > **Verbinden Sie KI-Assistenten mit Ihrem Propstack-CRM** — Kontakte verwalten, Objekte durchsuchen, Deals pflegen, Besichtigungen planen und Suchprofile erstellen, alles per Sprache oder Chat.
6
+
7
+ ## What you can do / Was Sie damit machen koennen
8
+
9
+ - **Contact management** — search, create, update, and tag contacts with GDPR tracking
10
+ - **Property search & management** — filter by price, rooms, area, status; create and update listings
11
+ - **Deal pipeline** — create deals, move through stages, track win/loss rates
12
+ - **Buyer matching** — create search profiles from natural language ("3-Zimmer in Berlin, bis 400k, mit Balkon") and auto-match to new listings
13
+ - **Task & calendar** — log call notes, set follow-up reminders, schedule viewings
14
+ - **Email** — send templated emails linked to contacts and properties
15
+ - **360-degree contact view** — get a complete briefing before every call
16
+ - **Pipeline dashboards** — deal counts and values per stage, stale deal alerts
17
+ - **Lead intake** — one-call workflow: dedup, create contact, log notes, create deal, set reminder
18
+ - **Bulk export** — full data dumps for reporting, backup, or migration
19
+
20
+ ## Quick Start
21
+
22
+ ### 1. Set your API key
23
+
24
+ ```bash
25
+ export PROPSTACK_API_KEY=your_api_key_here
26
+ ```
27
+
28
+ ### 2a. Claude Desktop
29
+
30
+ Add to your Claude Desktop config (`claude_desktop_config.json`):
31
+
32
+ ```json
33
+ {
34
+ "mcpServers": {
35
+ "propstack": {
36
+ "command": "npx",
37
+ "args": ["-y", "propstack-mcp-server"],
38
+ "env": {
39
+ "PROPSTACK_API_KEY": "your_api_key_here"
40
+ }
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ ### 2b. Claude Code (CLI)
47
+
48
+ Add to your project's `.mcp.json`:
49
+
50
+ ```json
51
+ {
52
+ "mcpServers": {
53
+ "propstack": {
54
+ "command": "npx",
55
+ "args": ["-y", "propstack-mcp-server"],
56
+ "env": {
57
+ "PROPSTACK_API_KEY": "your_api_key_here"
58
+ }
59
+ }
60
+ }
61
+ }
62
+ ```
63
+
64
+ ### 2c. ChatGPT
65
+
66
+ 1. Go to **Settings > Connectors > Developer Mode**
67
+ 2. Add a new MCP connector
68
+ 3. Set the command to `npx -y propstack-mcp-server`
69
+ 4. Add environment variable `PROPSTACK_API_KEY`
70
+
71
+ ### 2d. Cursor IDE
72
+
73
+ 1. Open **Settings** (Ctrl+,) → search "MCP"
74
+ 2. Edit **MCP Servers** JSON, or add `mcp.json` in project root / `.cursor/`
75
+
76
+ **Option A — local project** (after `npm run build`):
77
+
78
+ ```json
79
+ {
80
+ "mcpServers": {
81
+ "propstack": {
82
+ "command": "node",
83
+ "args": ["./dist/index.js"],
84
+ "cwd": "C:/Users/you/path/to/propstack_mcp",
85
+ "env": {
86
+ "PROPSTACK_API_KEY": "your_api_key_here"
87
+ }
88
+ }
89
+ }
90
+ }
91
+ ```
92
+
93
+ Or use `.env` in project root — the server loads it automatically; you can omit the `env` block.
94
+
95
+ **Option B — npx** (published package or `npx` from local):
96
+
97
+ ```json
98
+ {
99
+ "mcpServers": {
100
+ "propstack": {
101
+ "command": "npx",
102
+ "args": ["-y", "propstack-mcp-server"],
103
+ "env": {
104
+ "PROPSTACK_API_KEY": "your_api_key_here"
105
+ }
106
+ }
107
+ }
108
+ }
109
+ ```
110
+
111
+ ### 2e. Run directly
112
+
113
+ ```bash
114
+ npm install propstack-mcp-server
115
+ PROPSTACK_API_KEY=your_key npx propstack-mcp-server
116
+ ```
117
+
118
+ ## API Key / API-Schluessel
119
+
120
+ Get your Propstack API key:
121
+
122
+ 1. Log in to [crm.propstack.de](https://crm.propstack.de)
123
+ 2. Go to **Verwaltung > API-Schluessel** (Administration > API Keys)
124
+ 3. Create or copy your V1 API key
125
+
126
+ > **Hinweis:** Der API-Schluessel bestimmt die Berechtigungen. Stellen Sie sicher, dass Lese- und Schreibzugriff fuer die benoetigten Endpunkte aktiviert ist.
127
+
128
+ ## Available Tools (50)
129
+
130
+ ### Contacts (Kontakte)
131
+
132
+ | Tool | Description |
133
+ |---|---|
134
+ | `search_contacts` | Search and filter contacts by name, email, phone, status, tags, broker, GDPR status |
135
+ | `get_contact` | Get full details of a single contact with related data |
136
+ | `create_contact` | Create a new contact (auto-dedup by email) |
137
+ | `update_contact` | Update contact details, tags, GDPR status, broker assignment |
138
+ | `delete_contact` | Soft-delete a contact (30-day recycle bin) |
139
+ | `get_contact_sources` | List lead sources (ImmoScout24, Website, Empfehlung, etc.) |
140
+ | `search_contacts_by_phone` | Look up a contact by phone number (formatting-insensitive) |
141
+
142
+ ### Properties (Objekte)
143
+
144
+ | Tool | Description |
145
+ |---|---|
146
+ | `search_properties` | Search properties with 11 range filters, 17 sort fields |
147
+ | `get_property` | Get full property details including media and custom fields |
148
+ | `create_property` | Create a new property listing |
149
+ | `update_property` | Update price, status, description, broker assignment |
150
+ | `get_property_statuses` | List property statuses (Verfuegbar, Reserviert, Verkauft, etc.) |
151
+
152
+ ### Tasks (Aufgaben & Notizen)
153
+
154
+ | Tool | Description |
155
+ |---|---|
156
+ | `create_task` | Create a note, to-do, appointment, or cancellation (polymorphic) |
157
+ | `update_task` | Mark done, reschedule, update notes |
158
+ | `get_task` | Get task details with linked contacts, properties, projects |
159
+
160
+ ### Deals (Pipeline)
161
+
162
+ | Tool | Description |
163
+ |---|---|
164
+ | `search_deals` | Search deals by stage, pipeline, category, broker, feeling score |
165
+ | `create_deal` | Link a contact to a property at a pipeline stage |
166
+ | `update_deal` | Move deal through pipeline stages, update price/notes |
167
+
168
+ ### Search Profiles (Suchprofile)
169
+
170
+ | Tool | Description |
171
+ |---|---|
172
+ | `list_search_profiles` | List what buyers/renters are looking for |
173
+ | `create_search_profile` | Capture buyer criteria from natural language |
174
+ | `update_search_profile` | Adjust budget, cities, room count, features |
175
+ | `delete_search_profile` | Remove a search profile |
176
+
177
+ ### Projects (Projekte)
178
+
179
+ | Tool | Description |
180
+ |---|---|
181
+ | `list_projects` | List development projects with unit counts |
182
+ | `get_project` | Get project details with all units, media, documents |
183
+
184
+ ### Activities & Events (Aktivitaeten & Termine)
185
+
186
+ | Tool | Description |
187
+ |---|---|
188
+ | `search_activities` | Full activity timeline for a contact, property, or project |
189
+ | `list_events` | Calendar events — viewings, meetings, filtered by date/state |
190
+
191
+ ### Emails (E-Mails)
192
+
193
+ | Tool | Description |
194
+ |---|---|
195
+ | `send_email` | Send email using a Propstack template (snippet) |
196
+ | `update_email` | Mark read/archived, categorize, link to CRM records |
197
+
198
+ ### Documents (Dokumente)
199
+
200
+ | Tool | Description |
201
+ |---|---|
202
+ | `list_documents` | List files attached to a property, project, or contact |
203
+ | `upload_document` | Upload a document (base64 data URI) |
204
+
205
+ ### Relationships (Beziehungen)
206
+
207
+ | Tool | Description |
208
+ |---|---|
209
+ | `create_ownership` | Link a contact as property owner (Eigentuemer) |
210
+ | `create_partnership` | Link a contact as buyer, tenant, etc. (Kaeufer, Mieter) |
211
+
212
+ ### Lookups (Konfiguration)
213
+
214
+ | Tool | Description |
215
+ |---|---|
216
+ | `list_pipelines` | Get deal pipelines with stages (IDs, names, positions) |
217
+ | `get_pipeline` | Get a single pipeline with stage details |
218
+ | `list_tags` | List tags/groups (Merkmale) — filter contacts by group IDs |
219
+ | `create_tag` | Create a new tag for contacts, properties, or activities |
220
+ | `list_activity_types` | List note/todo/event templates for create_task |
221
+ | `list_contact_statuses` | List contact statuses for search/assign |
222
+ | `list_reservation_reasons` | List deal cancellation reasons |
223
+ | `list_custom_fields` | Discover custom field definitions (names, types, options) |
224
+ | `list_users` | List all brokers/agents with contact info |
225
+ | `list_teams` | List teams/departments with member assignments |
226
+ | `list_locations` | List geographic areas (Geolagen) for location matching |
227
+
228
+ ### Smart Composites (Intelligente Workflows)
229
+
230
+ | Tool | Description |
231
+ |---|---|
232
+ | `full_contact_360` | Complete contact dossier — info, search profiles, deals, activity |
233
+ | `property_performance_report` | Days on market, inquiry count, pipeline breakdown, activity summary |
234
+ | `pipeline_summary` | Deals per stage, total values, stale deals needing attention |
235
+ | `smart_lead_intake` | Full lead workflow: dedup, create/update, log notes, deal, reminder |
236
+ | `match_contacts_to_property` | Find buyers whose search profiles match a property |
237
+
238
+ ### Admin (Verwaltung)
239
+
240
+ | Tool | Description |
241
+ |---|---|
242
+ | `list_webhooks` | List all configured webhook subscriptions |
243
+ | `create_webhook` | Subscribe to CRM events (CLIENT_CREATED, PROPERTY_UPDATED, etc.) |
244
+ | `delete_webhook` | Remove a webhook subscription |
245
+ | `export_data` | Bulk export an entire data table as JSON |
246
+ | `get_contact_favorites` | Get properties a contact has favorited |
247
+
248
+ ## Example Conversations / Beispiel-Konversationen
249
+
250
+ ### Morning Briefing / Morgen-Briefing
251
+
252
+ > **You:** What's on my calendar today?
253
+ >
254
+ > **AI:** *calls `list_events` with today's date range* — You have 3 viewings scheduled...
255
+
256
+ > **Du:** Gibt es neue Leads seit gestern?
257
+ >
258
+ > **KI:** *ruft `search_contacts` mit created_at_from=gestern auf* — 5 neue Kontakte...
259
+
260
+ ### Lead Intake / Leaderfassung
261
+
262
+ > **You:** I just got off the phone with Maria Schmidt, +49 157 1234 5678. She's looking for a 3-room apartment in Berlin, budget 300-400k, must have a balcony. She found us on ImmoScout.
263
+ >
264
+ > **AI:** *calls `smart_lead_intake`* — Contact created (ID: 4521), call note logged, follow-up reminder set for tomorrow 9:00. Would you like me to create a search profile for her criteria?
265
+
266
+ ### Property Matching / Objekt-Matching
267
+
268
+ > **Du:** Wir haben ein neues Listing: 3-Zimmer-Wohnung in Charlottenburg, 385.000 EUR. Wer kommt als Kaeufer in Frage?
269
+ >
270
+ > **KI:** *ruft `match_contacts_to_property` auf* — 12 passende Suchprofile gefunden. Top 3: Herr Weber (Score 95%), Frau Mueller (Score 88%), Herr Kim (Score 85%)...
271
+
272
+ ### Pipeline Review
273
+
274
+ > **You:** How's our sales pipeline looking? Any stale deals?
275
+ >
276
+ > **AI:** *calls `pipeline_summary`* — 47 active deals, total value 12.3M EUR. 5 deals haven't been updated in 14+ days...
277
+
278
+ ### Pre-Call Briefing / Vor dem Anruf
279
+
280
+ > **Du:** Gib mir alles ueber Kontakt 3847 — ich rufe gleich an.
281
+ >
282
+ > **KI:** *ruft `full_contact_360` auf* — Herr Weber, Rating 3 Sterne, sucht 3-Zimmer in Berlin/Potsdam bis 400k. 2 aktive Deals, letzte Aktivitaet vor 3 Tagen...
283
+
284
+ ## Development
285
+
286
+ ```bash
287
+ git clone <repo-url>
288
+ cd propstack-mcp-server
289
+ npm install
290
+ npm run build # tsc → dist/
291
+ npm start # requires PROPSTACK_API_KEY
292
+ ```
293
+
294
+ ### Project Structure
295
+
296
+ ```
297
+ src/
298
+ index.ts # Server entry point (stdio transport)
299
+ propstack-client.ts # HTTP client with auth, retry, error handling
300
+ types/
301
+ propstack.ts # TypeScript interfaces for all API responses
302
+ tools/
303
+ helpers.ts # Shared formatting utilities
304
+ contacts.ts # 7 contact tools
305
+ properties.ts # 5 property tools
306
+ tasks.ts # 3 task tools (polymorphic: note/todo/event/cancel)
307
+ deals.ts # 3 deal pipeline tools
308
+ search-profiles.ts # 4 search profile tools
309
+ projects.ts # 2 project tools
310
+ activities.ts # 2 activity/event tools
311
+ emails.ts # 2 email tools
312
+ documents.ts # 2 document tools
313
+ relationships.ts # 2 relationship tools (ownership/partnership)
314
+ lookups.ts # 8 lookup/config tools
315
+ composites.ts # 5 smart composite tools
316
+ admin.ts # 5 admin tools (webhooks, export, favorites)
317
+ ```
318
+
319
+ ## License
320
+
321
+ MIT
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import "dotenv/config";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env node
2
+ import "dotenv/config";
3
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
+ import { PropstackClient } from "./propstack-client.js";
6
+ import { registerContactTools } from "./tools/contacts.js";
7
+ import { registerPropertyTools } from "./tools/properties.js";
8
+ import { registerTaskTools } from "./tools/tasks.js";
9
+ import { registerDealTools } from "./tools/deals.js";
10
+ import { registerSearchProfileTools } from "./tools/search-profiles.js";
11
+ import { registerProjectTools } from "./tools/projects.js";
12
+ import { registerActivityTools } from "./tools/activities.js";
13
+ import { registerEmailTools } from "./tools/emails.js";
14
+ import { registerDocumentTools } from "./tools/documents.js";
15
+ import { registerRelationshipTools } from "./tools/relationships.js";
16
+ import { registerLookupTools } from "./tools/lookups.js";
17
+ import { registerCompositeTools } from "./tools/composites.js";
18
+ import { registerAdminTools } from "./tools/admin.js";
19
+ const PROPSTACK_API_KEY = process.env["PROPSTACK_API_KEY"];
20
+ if (!PROPSTACK_API_KEY) {
21
+ console.error("Error: PROPSTACK_API_KEY environment variable is required");
22
+ process.exit(1);
23
+ }
24
+ const client = new PropstackClient(PROPSTACK_API_KEY);
25
+ const server = new McpServer({
26
+ name: "propstack-mcp-server",
27
+ version: "0.1.0",
28
+ }, {
29
+ capabilities: {
30
+ tools: {},
31
+ },
32
+ });
33
+ registerContactTools(server, client);
34
+ registerPropertyTools(server, client);
35
+ registerTaskTools(server, client);
36
+ registerDealTools(server, client);
37
+ registerSearchProfileTools(server, client);
38
+ registerProjectTools(server, client);
39
+ registerActivityTools(server, client);
40
+ registerEmailTools(server, client);
41
+ registerDocumentTools(server, client);
42
+ registerRelationshipTools(server, client);
43
+ registerLookupTools(server, client);
44
+ registerCompositeTools(server, client);
45
+ registerAdminTools(server, client);
46
+ async function main() {
47
+ const transport = new StdioServerTransport();
48
+ await server.connect(transport);
49
+ console.error("Propstack MCP server running on stdio");
50
+ }
51
+ main().catch((err) => {
52
+ console.error("Fatal:", err);
53
+ process.exit(1);
54
+ });
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,sBA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M,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;AACzD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ export type { PropstackPaginatedResponse } from "./types/propstack.js";
2
+ export interface PropstackRequestOptions {
3
+ params?: Record<string, string | number | boolean | string[] | number[] | undefined>;
4
+ body?: unknown;
5
+ }
6
+ export declare class PropstackError extends Error {
7
+ readonly status: number;
8
+ readonly statusText: string;
9
+ readonly detail: string;
10
+ readonly path: string;
11
+ constructor(status: number, statusText: string, detail: string, path?: string);
12
+ }
13
+ export declare class PropstackClient {
14
+ private readonly apiKey;
15
+ private readonly baseUrl;
16
+ constructor(apiKey: string, baseUrl?: string);
17
+ get<T>(path: string, opts?: PropstackRequestOptions): Promise<T>;
18
+ post<T>(path: string, opts?: PropstackRequestOptions): Promise<T>;
19
+ put<T>(path: string, opts?: PropstackRequestOptions): Promise<T>;
20
+ delete<T>(path: string, opts?: PropstackRequestOptions): Promise<T>;
21
+ private buildUrl;
22
+ private request;
23
+ }
24
+ //# sourceMappingURL=propstack-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propstack-client.d.ts","sourceRoot":"","sources":["../src/propstack-client.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAOvE,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;IACrF,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,qBAAa,cAAe,SAAQ,KAAK;aAErB,MAAM,EAAE,MAAM;aACd,UAAU,EAAE,MAAM;aAClB,MAAM,EAAE,MAAM;aACd,IAAI,EAAE,MAAM;gBAHZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAW;CAKpC;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,MAAgB;IAK/C,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,CAAC,CAAC;IAIhE,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,CAAC,CAAC;IAIjE,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,CAAC,CAAC;IAIhE,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,CAAC,CAAC;IAIzE,OAAO,CAAC,QAAQ;YAiBF,OAAO;CAyDtB"}
@@ -0,0 +1,99 @@
1
+ const V1_BASE = "https://api.propstack.de/v1";
2
+ const MAX_RETRIES = 3;
3
+ const RETRY_BASE_MS = 1000;
4
+ export class PropstackError extends Error {
5
+ status;
6
+ statusText;
7
+ detail;
8
+ path;
9
+ constructor(status, statusText, detail, path = "") {
10
+ super(`Propstack API ${status} ${statusText}: ${detail}`);
11
+ this.status = status;
12
+ this.statusText = statusText;
13
+ this.detail = detail;
14
+ this.path = path;
15
+ this.name = "PropstackError";
16
+ }
17
+ }
18
+ export class PropstackClient {
19
+ apiKey;
20
+ baseUrl;
21
+ constructor(apiKey, baseUrl = V1_BASE) {
22
+ this.apiKey = apiKey;
23
+ this.baseUrl = baseUrl;
24
+ }
25
+ async get(path, opts) {
26
+ return this.request("GET", path, opts);
27
+ }
28
+ async post(path, opts) {
29
+ return this.request("POST", path, opts);
30
+ }
31
+ async put(path, opts) {
32
+ return this.request("PUT", path, opts);
33
+ }
34
+ async delete(path, opts) {
35
+ return this.request("DELETE", path, opts);
36
+ }
37
+ buildUrl(path, params) {
38
+ const url = new URL(`${this.baseUrl}${path}`);
39
+ if (params) {
40
+ for (const [key, value] of Object.entries(params)) {
41
+ if (value === undefined)
42
+ continue;
43
+ if (Array.isArray(value)) {
44
+ for (const item of value) {
45
+ url.searchParams.append(`${key}[]`, String(item));
46
+ }
47
+ }
48
+ else {
49
+ url.searchParams.set(key, String(value));
50
+ }
51
+ }
52
+ }
53
+ return url.toString();
54
+ }
55
+ async request(method, path, opts) {
56
+ const url = this.buildUrl(path, opts?.params);
57
+ const headers = {
58
+ "X-API-KEY": this.apiKey,
59
+ "Accept": "application/json",
60
+ };
61
+ const init = { method, headers };
62
+ if (opts?.body !== undefined && (method === "POST" || method === "PUT" || method === "PATCH")) {
63
+ headers["Content-Type"] = "application/json";
64
+ init.body = JSON.stringify(opts.body);
65
+ }
66
+ let lastError;
67
+ for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {
68
+ if (attempt > 0) {
69
+ const delay = RETRY_BASE_MS * 2 ** (attempt - 1);
70
+ await new Promise((resolve) => setTimeout(resolve, delay));
71
+ }
72
+ let res;
73
+ try {
74
+ res = await fetch(url, init);
75
+ }
76
+ catch (err) {
77
+ lastError = err instanceof Error ? err : new Error(String(err));
78
+ continue;
79
+ }
80
+ if (res.status === 429 && attempt < MAX_RETRIES) {
81
+ const retryAfter = res.headers.get("Retry-After");
82
+ if (retryAfter) {
83
+ await new Promise((resolve) => setTimeout(resolve, Number(retryAfter) * 1000));
84
+ }
85
+ continue;
86
+ }
87
+ if (!res.ok) {
88
+ const body = await res.text();
89
+ throw new PropstackError(res.status, res.statusText, body, path);
90
+ }
91
+ if (res.status === 204) {
92
+ return undefined;
93
+ }
94
+ return (await res.json());
95
+ }
96
+ throw lastError ?? new Error(`Request to ${path} failed after ${MAX_RETRIES} retries`);
97
+ }
98
+ }
99
+ //# sourceMappingURL=propstack-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propstack-client.js","sourceRoot":"","sources":["../src/propstack-client.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAG,6BAA6B,CAAC;AAE9C,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,aAAa,GAAG,IAAI,CAAC;AAO3B,MAAM,OAAO,cAAe,SAAQ,KAAK;IAErB;IACA;IACA;IACA;IAJlB,YACkB,MAAc,EACd,UAAkB,EAClB,MAAc,EACd,OAAe,EAAE;QAEjC,KAAK,CAAC,iBAAiB,MAAM,IAAI,UAAU,KAAK,MAAM,EAAE,CAAC,CAAC;QAL1C,WAAM,GAAN,MAAM,CAAQ;QACd,eAAU,GAAV,UAAU,CAAQ;QAClB,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAa;QAGjC,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED,MAAM,OAAO,eAAe;IACT,MAAM,CAAS;IACf,OAAO,CAAS;IAEjC,YAAY,MAAc,EAAE,UAAkB,OAAO;QACnD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,GAAG,CAAI,IAAY,EAAE,IAA8B;QACvD,OAAO,IAAI,CAAC,OAAO,CAAI,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,IAAI,CAAI,IAAY,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AAG,WAAW,EAAE,CAAC;gBAChD,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;gBAClD,IAAI,UAAU,EAAE,CAAC;oBACf,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;gBACjF,CAAC;gBACD,SAAS;YACX,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBACZ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;gBAC9B,MAAM,IAAI,cAAc,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YACnE,CAAC;YAED,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACvB,OAAO,SAAc,CAAC;YACxB,CAAC;YAED,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAM,CAAC;QACjC,CAAC;QAED,MAAM,SAAS,IAAI,IAAI,KAAK,CAAC,cAAc,IAAI,iBAAiB,WAAW,UAAU,CAAC,CAAC;IACzF,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { PropstackClient } from "../propstack-client.js";
3
+ export declare function registerActivityTools(server: McpServer, client: PropstackClient): void;
4
+ //# sourceMappingURL=activities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activities.d.ts","sourceRoot":"","sources":["../../src/tools/activities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAyE9D,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAqItF"}