@studiometa/productive-mcp 0.10.10 → 0.10.12

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 (74) hide show
  1. package/README.md +120 -0
  2. package/dist/api-reference/generated.d.ts +3 -0
  3. package/dist/api-reference/generated.d.ts.map +1 -0
  4. package/dist/api-reference/types.d.ts +31 -0
  5. package/dist/api-reference/types.d.ts.map +1 -0
  6. package/dist/auth.js.map +1 -1
  7. package/dist/crypto.js +3 -3
  8. package/dist/crypto.js.map +1 -1
  9. package/dist/errors.d.ts.map +1 -1
  10. package/dist/handlers/activities.d.ts +3 -99
  11. package/dist/handlers/activities.d.ts.map +1 -1
  12. package/dist/handlers/api-read.d.ts +14 -0
  13. package/dist/handlers/api-read.d.ts.map +1 -0
  14. package/dist/handlers/api-utils.d.ts +27 -0
  15. package/dist/handlers/api-utils.d.ts.map +1 -0
  16. package/dist/handlers/api-write.d.ts +10 -0
  17. package/dist/handlers/api-write.d.ts.map +1 -0
  18. package/dist/handlers/attachments.d.ts +3 -99
  19. package/dist/handlers/attachments.d.ts.map +1 -1
  20. package/dist/handlers/bookings.d.ts +3 -99
  21. package/dist/handlers/bookings.d.ts.map +1 -1
  22. package/dist/handlers/comments.d.ts +3 -99
  23. package/dist/handlers/comments.d.ts.map +1 -1
  24. package/dist/handlers/companies.d.ts +3 -99
  25. package/dist/handlers/companies.d.ts.map +1 -1
  26. package/dist/handlers/custom-fields.d.ts +3 -99
  27. package/dist/handlers/custom-fields.d.ts.map +1 -1
  28. package/dist/handlers/deals.d.ts +3 -99
  29. package/dist/handlers/deals.d.ts.map +1 -1
  30. package/dist/handlers/discussions.d.ts +3 -99
  31. package/dist/handlers/discussions.d.ts.map +1 -1
  32. package/dist/handlers/index.d.ts.map +1 -1
  33. package/dist/handlers/pages.d.ts +3 -99
  34. package/dist/handlers/pages.d.ts.map +1 -1
  35. package/dist/handlers/projects.d.ts +3 -99
  36. package/dist/handlers/projects.d.ts.map +1 -1
  37. package/dist/handlers/search.d.ts +1 -1
  38. package/dist/handlers/search.d.ts.map +1 -1
  39. package/dist/handlers/services.d.ts +3 -99
  40. package/dist/handlers/services.d.ts.map +1 -1
  41. package/dist/handlers/tasks.d.ts +3 -99
  42. package/dist/handlers/tasks.d.ts.map +1 -1
  43. package/dist/handlers/time.d.ts +3 -99
  44. package/dist/handlers/time.d.ts.map +1 -1
  45. package/dist/handlers/timers.d.ts +3 -99
  46. package/dist/handlers/timers.d.ts.map +1 -1
  47. package/dist/handlers-DonE83xo.js +41289 -0
  48. package/dist/handlers-DonE83xo.js.map +1 -0
  49. package/dist/handlers.js +1 -1
  50. package/dist/http-QQVUnV2e.js +3238 -0
  51. package/dist/http-QQVUnV2e.js.map +1 -0
  52. package/dist/http.d.ts.map +1 -1
  53. package/dist/http.js +1 -1
  54. package/dist/index.js +2 -2
  55. package/dist/index.js.map +1 -1
  56. package/dist/oauth.js.map +1 -1
  57. package/dist/schema.d.ts +32 -1
  58. package/dist/schema.d.ts.map +1 -1
  59. package/dist/server.js +2 -2
  60. package/dist/server.js.map +1 -1
  61. package/dist/{stdio-BFK9AcdQ.js → stdio-CRD2nJPs.js} +2 -2
  62. package/dist/{stdio-BFK9AcdQ.js.map → stdio-CRD2nJPs.js.map} +1 -1
  63. package/dist/stdio.js +1 -1
  64. package/dist/tools.d.ts.map +1 -1
  65. package/dist/tools.js +193 -119
  66. package/dist/tools.js.map +1 -1
  67. package/dist/{version-Cy8UEAT1.js → version-DMEaGciu.js} +3 -3
  68. package/dist/{version-Cy8UEAT1.js.map → version-DMEaGciu.js.map} +1 -1
  69. package/package.json +6 -6
  70. package/skills/SKILL.md +113 -1
  71. package/dist/handlers-vtRpc-Lx.js +0 -4301
  72. package/dist/handlers-vtRpc-Lx.js.map +0 -1
  73. package/dist/http-CVE4qtko.js +0 -6541
  74. package/dist/http-CVE4qtko.js.map +0 -1
package/dist/tools.js CHANGED
@@ -34,129 +34,203 @@ function generateDescription() {
34
34
  * - idempotentHint: false - Create actions are not idempotent
35
35
  * - openWorldHint: true - Tool interacts with external Productive.io API
36
36
  */
37
- var TOOLS = [{
38
- name: "productive",
39
- description: generateDescription(),
40
- annotations: {
41
- title: "Productive.io",
42
- readOnlyHint: false,
43
- destructiveHint: false,
44
- idempotentHint: false,
45
- openWorldHint: true
46
- },
47
- inputSchema: {
48
- type: "object",
49
- properties: {
50
- resource: {
51
- type: "string",
52
- enum: [...RESOURCES]
53
- },
54
- action: {
55
- type: "string",
56
- enum: [...ACTIONS],
57
- description: "Use \"help\" for resource documentation"
58
- },
59
- id: { type: "string" },
60
- filter: { type: "object" },
61
- page: { type: "number" },
62
- per_page: { type: "number" },
63
- compact: {
64
- type: "boolean",
65
- description: "Compact output (default: true for list, false for get)"
66
- },
67
- include: {
68
- type: "array",
69
- items: { type: "string" },
70
- description: "Related data to include (e.g. [\"project\",\"assignee\"])"
71
- },
72
- query: {
73
- type: "string",
74
- description: "Text search for list actions"
75
- },
76
- resources: {
77
- type: "array",
78
- items: { type: "string" },
79
- description: "Resource types to search (for resource=search). Defaults to [projects, companies, people, tasks]. Valid values: projects, companies, people, tasks, deals."
80
- },
81
- person_id: { type: "string" },
82
- service_id: { type: "string" },
83
- task_id: { type: "string" },
84
- company_id: { type: "string" },
85
- time: { type: "number" },
86
- date: { type: "string" },
87
- note: { type: "string" },
88
- title: { type: "string" },
89
- project_id: { type: "string" },
90
- task_list_id: { type: "string" },
91
- description: { type: "string" },
92
- assignee_id: { type: "string" },
93
- name: { type: "string" },
94
- page_id: {
95
- type: "string",
96
- description: "Page ID (list pages to find)"
97
- },
98
- parent_page_id: {
99
- type: "string",
100
- description: "Parent page ID for sub-pages"
101
- },
102
- body: {
103
- type: "string",
104
- description: "Comment/page body content"
105
- },
106
- hidden: {
107
- type: "boolean",
108
- description: "Set to true to hide comment from client (comments only)"
109
- },
110
- deal_id: { type: "string" },
111
- comment_id: {
112
- type: "string",
113
- description: "Comment ID (for attachments)"
114
- },
115
- time_entry_id: { type: "string" },
116
- started_on: {
117
- type: "string",
118
- description: "Booking date (YYYY-MM-DD)"
119
- },
120
- ended_on: {
121
- type: "string",
122
- description: "Booking end date (YYYY-MM-DD)"
123
- },
124
- event_id: { type: "string" },
125
- report_type: {
126
- type: "string",
127
- enum: [...REPORT_TYPES],
128
- description: "Required for resource=reports action=get"
129
- },
130
- group: {
131
- type: "string",
132
- description: "Report grouping: person, project, service"
133
- },
134
- from: {
135
- type: "string",
136
- description: "Report start (YYYY-MM-DD); filter.after for time"
137
- },
138
- to: {
139
- type: "string",
140
- description: "Report end (YYYY-MM-DD); filter.before for time"
141
- },
142
- status: { type: "string" },
143
- operations: {
144
- type: "array",
145
- items: {
146
- type: "object",
147
- properties: {
148
- resource: { type: "string" },
149
- action: { type: "string" }
37
+ var TOOLS = [
38
+ {
39
+ name: "productive",
40
+ description: generateDescription(),
41
+ annotations: {
42
+ title: "Productive.io",
43
+ readOnlyHint: false,
44
+ destructiveHint: false,
45
+ idempotentHint: false,
46
+ openWorldHint: true
47
+ },
48
+ inputSchema: {
49
+ type: "object",
50
+ properties: {
51
+ resource: {
52
+ type: "string",
53
+ enum: [...RESOURCES]
54
+ },
55
+ action: {
56
+ type: "string",
57
+ enum: [...ACTIONS],
58
+ description: "Use \"help\" for resource documentation"
59
+ },
60
+ id: { type: "string" },
61
+ filter: { type: "object" },
62
+ page: { type: "number" },
63
+ per_page: { type: "number" },
64
+ compact: {
65
+ type: "boolean",
66
+ description: "Compact output (default: true for list, false for get)"
67
+ },
68
+ include: {
69
+ type: "array",
70
+ items: { type: "string" },
71
+ description: "Related data to include (e.g. [\"project\",\"assignee\"])"
72
+ },
73
+ query: {
74
+ type: "string",
75
+ description: "Text search for list actions"
76
+ },
77
+ resources: {
78
+ type: "array",
79
+ items: { type: "string" },
80
+ description: "Resource types to search (for resource=search). Defaults to [projects, companies, people, tasks]. Valid values: projects, companies, people, tasks, deals."
81
+ },
82
+ person_id: { type: "string" },
83
+ service_id: { type: "string" },
84
+ task_id: { type: "string" },
85
+ company_id: { type: "string" },
86
+ time: { type: "number" },
87
+ date: { type: "string" },
88
+ note: { type: "string" },
89
+ title: { type: "string" },
90
+ project_id: { type: "string" },
91
+ task_list_id: { type: "string" },
92
+ description: { type: "string" },
93
+ assignee_id: { type: "string" },
94
+ name: { type: "string" },
95
+ page_id: {
96
+ type: "string",
97
+ description: "Page ID (list pages to find)"
98
+ },
99
+ parent_page_id: {
100
+ type: "string",
101
+ description: "Parent page ID for sub-pages"
102
+ },
103
+ body: {
104
+ type: "string",
105
+ description: "Comment/page body content"
106
+ },
107
+ hidden: {
108
+ type: "boolean",
109
+ description: "Set to true to hide comment from client (comments only)"
110
+ },
111
+ deal_id: { type: "string" },
112
+ comment_id: {
113
+ type: "string",
114
+ description: "Comment ID (for attachments)"
115
+ },
116
+ time_entry_id: { type: "string" },
117
+ started_on: {
118
+ type: "string",
119
+ description: "Booking date (YYYY-MM-DD)"
120
+ },
121
+ ended_on: {
122
+ type: "string",
123
+ description: "Booking end date (YYYY-MM-DD)"
124
+ },
125
+ event_id: { type: "string" },
126
+ report_type: {
127
+ type: "string",
128
+ enum: [...REPORT_TYPES],
129
+ description: "Required for resource=reports action=get"
130
+ },
131
+ group: {
132
+ type: "string",
133
+ description: "Report grouping: person, project, service"
134
+ },
135
+ from: {
136
+ type: "string",
137
+ description: "Report start (YYYY-MM-DD); filter.after for time"
138
+ },
139
+ to: {
140
+ type: "string",
141
+ description: "Report end (YYYY-MM-DD); filter.before for time"
142
+ },
143
+ status: { type: "string" },
144
+ operations: {
145
+ type: "array",
146
+ items: {
147
+ type: "object",
148
+ properties: {
149
+ resource: { type: "string" },
150
+ action: { type: "string" }
151
+ },
152
+ required: ["resource", "action"]
150
153
  },
151
- required: ["resource", "action"]
154
+ maxItems: 10,
155
+ description: "Array of operations for batch execution (max 10). Each operation needs resource, action, and any additional params."
156
+ }
157
+ },
158
+ required: ["resource", "action"]
159
+ }
160
+ },
161
+ {
162
+ name: "api_read",
163
+ description: "Read-only raw Productive API access for documented GET endpoints. Supports describe=true for endpoint docs, filter/include/sort, and optional safe pagination.",
164
+ annotations: {
165
+ title: "Productive API Read",
166
+ readOnlyHint: true,
167
+ destructiveHint: false,
168
+ idempotentHint: true,
169
+ openWorldHint: true
170
+ },
171
+ inputSchema: {
172
+ type: "object",
173
+ properties: {
174
+ path: {
175
+ type: "string",
176
+ description: "Relative Productive API path, e.g. /invoices"
177
+ },
178
+ describe: {
179
+ type: "boolean",
180
+ description: "Return endpoint documentation instead of calling the API"
181
+ },
182
+ filter: { type: "object" },
183
+ include: {
184
+ type: "array",
185
+ items: { type: "string" }
152
186
  },
153
- maxItems: 10,
154
- description: "Array of operations for batch execution (max 10). Each operation needs resource, action, and any additional params."
155
- }
187
+ sort: {
188
+ type: "array",
189
+ items: { type: "string" }
190
+ },
191
+ page: { type: "number" },
192
+ per_page: { type: "number" },
193
+ paginate: { type: "boolean" },
194
+ max_pages: { type: "number" }
195
+ },
196
+ required: ["path"]
197
+ }
198
+ },
199
+ {
200
+ name: "api_write",
201
+ description: "Gated raw Productive API write access for documented endpoints. Disabled by default, requires PRODUCTIVE_MCP_ENABLE_API_WRITE=true and confirm=true. Supports dry_run=true.",
202
+ annotations: {
203
+ title: "Productive API Write",
204
+ readOnlyHint: false,
205
+ destructiveHint: true,
206
+ idempotentHint: false,
207
+ openWorldHint: true
156
208
  },
157
- required: ["resource", "action"]
209
+ inputSchema: {
210
+ type: "object",
211
+ properties: {
212
+ method: {
213
+ type: "string",
214
+ enum: [
215
+ "POST",
216
+ "PATCH",
217
+ "PUT",
218
+ "DELETE"
219
+ ]
220
+ },
221
+ path: { type: "string" },
222
+ body: { type: "object" },
223
+ confirm: { type: "boolean" },
224
+ dry_run: { type: "boolean" }
225
+ },
226
+ required: [
227
+ "method",
228
+ "path",
229
+ "confirm"
230
+ ]
231
+ }
158
232
  }
159
- }];
233
+ ];
160
234
  /**
161
235
  * Additional tools only available in stdio mode (local execution)
162
236
  * These tools manage persistent configuration
package/dist/tools.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tools.js","names":[],"sources":["../src/tools.ts"],"sourcesContent":["import type { Tool } from '@modelcontextprotocol/sdk/types.js';\n\nimport { RESOURCES, ACTIONS, REPORT_TYPES } from '@studiometa/productive-core';\n\n/**\n * Generate the tool description dynamically from the constants.\n * Adding a resource or action to constants.ts automatically updates this description.\n */\nfunction generateDescription(): string {\n return [\n 'Productive.io API.',\n `Resources: ${RESOURCES.join(', ')}.`,\n `Actions: ${ACTIONS.join(', ')} (varies by resource).`,\n 'Discovery: action=help with any resource for filters, fields, examples. action=schema for compact machine-readable spec.',\n 'Filters: filter:{key:value}. Common: project_id, person_id, after/before (YYYY-MM-DD).',\n 'Includes: include:[...] for related data (e.g. [\"project\",\"assignee\"]).',\n 'Output: compact=false for full detail (default for get; list defaults true).',\n 'Search: query for text search on list actions. Cross-resource: resource=search action=run with query searches projects, companies, people, tasks simultaneously.',\n 'Reports: resource=reports action=get with report_type, from, to.',\n 'Batch: resource=batch action=run with operations=[{resource,action,...}] executes up to 10 ops in parallel.',\n 'Rich context: action=context on tasks/projects/deals for full context in one call.',\n ].join('\\n');\n}\n\n/**\n * Single consolidated tool for Productive.io MCP server\n *\n * The resource/action/report_type enums and description are derived from\n * the shared constants in constants.ts — the single source of truth for both\n * the MCP tool definition and the Zod validation schemas.\n * Adding a new resource, action, or report type there automatically updates\n * both the tool exposed to clients and the validation layer.\n *\n * MCP Annotations (for MCP directory compliance):\n * - readOnlyHint: false - Tool can create/update data\n * - destructiveHint: false - Tool does not permanently delete data\n * - idempotentHint: false - Create actions are not idempotent\n * - openWorldHint: true - Tool interacts with external Productive.io API\n */\nexport const TOOLS: Tool[] = [\n {\n name: 'productive',\n description: generateDescription(),\n annotations: {\n title: 'Productive.io',\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n inputSchema: {\n type: 'object',\n properties: {\n resource: {\n type: 'string',\n enum: [...RESOURCES],\n },\n action: {\n type: 'string',\n enum: [...ACTIONS],\n description: 'Use \"help\" for resource documentation',\n },\n id: { type: 'string' },\n filter: { type: 'object' },\n page: { type: 'number' },\n per_page: { type: 'number' },\n compact: {\n type: 'boolean',\n description: 'Compact output (default: true for list, false for get)',\n },\n include: {\n type: 'array',\n items: { type: 'string' },\n description: 'Related data to include (e.g. [\"project\",\"assignee\"])',\n },\n query: { type: 'string', description: 'Text search for list actions' },\n resources: {\n type: 'array',\n items: { type: 'string' },\n description:\n 'Resource types to search (for resource=search). Defaults to [projects, companies, people, tasks]. Valid values: projects, companies, people, tasks, deals.',\n },\n // Common fields\n person_id: { type: 'string' },\n service_id: { type: 'string' },\n task_id: { type: 'string' },\n company_id: { type: 'string' },\n time: { type: 'number' },\n date: { type: 'string' },\n note: { type: 'string' },\n // Task fields\n title: { type: 'string' },\n project_id: { type: 'string' },\n task_list_id: { type: 'string' },\n description: { type: 'string' },\n assignee_id: { type: 'string' },\n // Company fields\n name: { type: 'string' },\n // Page fields\n page_id: { type: 'string', description: 'Page ID (list pages to find)' },\n parent_page_id: { type: 'string', description: 'Parent page ID for sub-pages' },\n // Comment fields\n body: { type: 'string', description: 'Comment/page body content' },\n hidden: {\n type: 'boolean',\n description: 'Set to true to hide comment from client (comments only)',\n },\n deal_id: { type: 'string' },\n // Attachment fields\n comment_id: { type: 'string', description: 'Comment ID (for attachments)' },\n // Timer fields\n time_entry_id: { type: 'string' },\n // Booking fields\n started_on: { type: 'string', description: 'Booking date (YYYY-MM-DD)' },\n ended_on: { type: 'string', description: 'Booking end date (YYYY-MM-DD)' },\n event_id: { type: 'string' },\n // Report fields\n report_type: {\n type: 'string',\n enum: [...REPORT_TYPES],\n description: 'Required for resource=reports action=get',\n },\n group: { type: 'string', description: 'Report grouping: person, project, service' },\n from: { type: 'string', description: 'Report start (YYYY-MM-DD); filter.after for time' },\n to: { type: 'string', description: 'Report end (YYYY-MM-DD); filter.before for time' },\n status: { type: 'string' },\n // Batch fields\n operations: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n resource: { type: 'string' },\n action: { type: 'string' },\n },\n required: ['resource', 'action'],\n },\n maxItems: 10,\n description:\n 'Array of operations for batch execution (max 10). Each operation needs resource, action, and any additional params.',\n },\n },\n required: ['resource', 'action'],\n },\n },\n];\n\n/**\n * Additional tools only available in stdio mode (local execution)\n * These tools manage persistent configuration\n */\nexport const STDIO_ONLY_TOOLS: Tool[] = [\n {\n name: 'productive_configure',\n description: 'Configure Productive.io credentials',\n annotations: {\n title: 'Configure Productive',\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n inputSchema: {\n type: 'object',\n properties: {\n organizationId: { type: 'string' },\n apiToken: { type: 'string' },\n userId: { type: 'string' },\n },\n required: ['organizationId', 'apiToken'],\n },\n },\n {\n name: 'productive_get_config',\n description: 'Get current configuration',\n annotations: {\n title: 'Get Productive Config',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n];\n"],"mappings":";;;;;;AAQA,SAAS,sBAA8B;AACrC,QAAO;EACL;EACA,cAAc,UAAU,KAAK,KAAK,CAAC;EACnC,YAAY,QAAQ,KAAK,KAAK,CAAC;EAC/B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;;;;;;;;;;;;;;;;AAkBd,IAAa,QAAgB,CAC3B;CACE,MAAM;CACN,aAAa,qBAAqB;CAClC,aAAa;EACX,OAAO;EACP,cAAc;EACd,iBAAiB;EACjB,gBAAgB;EAChB,eAAe;EAChB;CACD,aAAa;EACX,MAAM;EACN,YAAY;GACV,UAAU;IACR,MAAM;IACN,MAAM,CAAC,GAAG,UAAU;IACrB;GACD,QAAQ;IACN,MAAM;IACN,MAAM,CAAC,GAAG,QAAQ;IAClB,aAAa;IACd;GACD,IAAI,EAAE,MAAM,UAAU;GACtB,QAAQ,EAAE,MAAM,UAAU;GAC1B,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;IAAE,MAAM;IAAU,aAAa;IAAmD;GACtF,QAAQ,EAAE,MAAM,UAAU;GAE1B,YAAY;IACV,MAAM;IACN,OAAO;KACL,MAAM;KACN,YAAY;MACV,UAAU,EAAE,MAAM,UAAU;MAC5B,QAAQ,EAAE,MAAM,UAAU;MAC3B;KACD,UAAU,CAAC,YAAY,SAAS;KACjC;IACD,UAAU;IACV,aACE;IACH;GACF;EACD,UAAU,CAAC,YAAY,SAAS;EACjC;CACF,CACF;;;;;AAMD,IAAa,mBAA2B,CACtC;CACE,MAAM;CACN,aAAa;CACb,aAAa;EACX,OAAO;EACP,cAAc;EACd,iBAAiB;EACjB,gBAAgB;EAChB,eAAe;EAChB;CACD,aAAa;EACX,MAAM;EACN,YAAY;GACV,gBAAgB,EAAE,MAAM,UAAU;GAClC,UAAU,EAAE,MAAM,UAAU;GAC5B,QAAQ,EAAE,MAAM,UAAU;GAC3B;EACD,UAAU,CAAC,kBAAkB,WAAW;EACzC;CACF,EACD;CACE,MAAM;CACN,aAAa;CACb,aAAa;EACX,OAAO;EACP,cAAc;EACd,iBAAiB;EACjB,gBAAgB;EAChB,eAAe;EAChB;CACD,aAAa;EACX,MAAM;EACN,YAAY,EAAE;EACf;CACF,CACF"}
1
+ {"version":3,"file":"tools.js","names":[],"sources":["../src/tools.ts"],"sourcesContent":["import type { Tool } from '@modelcontextprotocol/sdk/types.js';\n\nimport { RESOURCES, ACTIONS, REPORT_TYPES } from '@studiometa/productive-core';\n\n/**\n * Generate the tool description dynamically from the constants.\n * Adding a resource or action to constants.ts automatically updates this description.\n */\nfunction generateDescription(): string {\n return [\n 'Productive.io API.',\n `Resources: ${RESOURCES.join(', ')}.`,\n `Actions: ${ACTIONS.join(', ')} (varies by resource).`,\n 'Discovery: action=help with any resource for filters, fields, examples. action=schema for compact machine-readable spec.',\n 'Filters: filter:{key:value}. Common: project_id, person_id, after/before (YYYY-MM-DD).',\n 'Includes: include:[...] for related data (e.g. [\"project\",\"assignee\"]).',\n 'Output: compact=false for full detail (default for get; list defaults true).',\n 'Search: query for text search on list actions. Cross-resource: resource=search action=run with query searches projects, companies, people, tasks simultaneously.',\n 'Reports: resource=reports action=get with report_type, from, to.',\n 'Batch: resource=batch action=run with operations=[{resource,action,...}] executes up to 10 ops in parallel.',\n 'Rich context: action=context on tasks/projects/deals for full context in one call.',\n ].join('\\n');\n}\n\n/**\n * Single consolidated tool for Productive.io MCP server\n *\n * The resource/action/report_type enums and description are derived from\n * the shared constants in constants.ts — the single source of truth for both\n * the MCP tool definition and the Zod validation schemas.\n * Adding a new resource, action, or report type there automatically updates\n * both the tool exposed to clients and the validation layer.\n *\n * MCP Annotations (for MCP directory compliance):\n * - readOnlyHint: false - Tool can create/update data\n * - destructiveHint: false - Tool does not permanently delete data\n * - idempotentHint: false - Create actions are not idempotent\n * - openWorldHint: true - Tool interacts with external Productive.io API\n */\nexport const TOOLS: Tool[] = [\n {\n name: 'productive',\n description: generateDescription(),\n annotations: {\n title: 'Productive.io',\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n inputSchema: {\n type: 'object',\n properties: {\n resource: {\n type: 'string',\n enum: [...RESOURCES],\n },\n action: {\n type: 'string',\n enum: [...ACTIONS],\n description: 'Use \"help\" for resource documentation',\n },\n id: { type: 'string' },\n filter: { type: 'object' },\n page: { type: 'number' },\n per_page: { type: 'number' },\n compact: {\n type: 'boolean',\n description: 'Compact output (default: true for list, false for get)',\n },\n include: {\n type: 'array',\n items: { type: 'string' },\n description: 'Related data to include (e.g. [\"project\",\"assignee\"])',\n },\n query: { type: 'string', description: 'Text search for list actions' },\n resources: {\n type: 'array',\n items: { type: 'string' },\n description:\n 'Resource types to search (for resource=search). Defaults to [projects, companies, people, tasks]. Valid values: projects, companies, people, tasks, deals.',\n },\n // Common fields\n person_id: { type: 'string' },\n service_id: { type: 'string' },\n task_id: { type: 'string' },\n company_id: { type: 'string' },\n time: { type: 'number' },\n date: { type: 'string' },\n note: { type: 'string' },\n // Task fields\n title: { type: 'string' },\n project_id: { type: 'string' },\n task_list_id: { type: 'string' },\n description: { type: 'string' },\n assignee_id: { type: 'string' },\n // Company fields\n name: { type: 'string' },\n // Page fields\n page_id: { type: 'string', description: 'Page ID (list pages to find)' },\n parent_page_id: { type: 'string', description: 'Parent page ID for sub-pages' },\n // Comment fields\n body: { type: 'string', description: 'Comment/page body content' },\n hidden: {\n type: 'boolean',\n description: 'Set to true to hide comment from client (comments only)',\n },\n deal_id: { type: 'string' },\n // Attachment fields\n comment_id: { type: 'string', description: 'Comment ID (for attachments)' },\n // Timer fields\n time_entry_id: { type: 'string' },\n // Booking fields\n started_on: { type: 'string', description: 'Booking date (YYYY-MM-DD)' },\n ended_on: { type: 'string', description: 'Booking end date (YYYY-MM-DD)' },\n event_id: { type: 'string' },\n // Report fields\n report_type: {\n type: 'string',\n enum: [...REPORT_TYPES],\n description: 'Required for resource=reports action=get',\n },\n group: { type: 'string', description: 'Report grouping: person, project, service' },\n from: { type: 'string', description: 'Report start (YYYY-MM-DD); filter.after for time' },\n to: { type: 'string', description: 'Report end (YYYY-MM-DD); filter.before for time' },\n status: { type: 'string' },\n // Batch fields\n operations: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n resource: { type: 'string' },\n action: { type: 'string' },\n },\n required: ['resource', 'action'],\n },\n maxItems: 10,\n description:\n 'Array of operations for batch execution (max 10). Each operation needs resource, action, and any additional params.',\n },\n },\n required: ['resource', 'action'],\n },\n },\n {\n name: 'api_read',\n description:\n 'Read-only raw Productive API access for documented GET endpoints. Supports describe=true for endpoint docs, filter/include/sort, and optional safe pagination.',\n annotations: {\n title: 'Productive API Read',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n inputSchema: {\n type: 'object',\n properties: {\n path: { type: 'string', description: 'Relative Productive API path, e.g. /invoices' },\n describe: {\n type: 'boolean',\n description: 'Return endpoint documentation instead of calling the API',\n },\n filter: { type: 'object' },\n include: { type: 'array', items: { type: 'string' } },\n sort: { type: 'array', items: { type: 'string' } },\n page: { type: 'number' },\n per_page: { type: 'number' },\n paginate: { type: 'boolean' },\n max_pages: { type: 'number' },\n },\n required: ['path'],\n },\n },\n {\n name: 'api_write',\n description:\n 'Gated raw Productive API write access for documented endpoints. Disabled by default, requires PRODUCTIVE_MCP_ENABLE_API_WRITE=true and confirm=true. Supports dry_run=true.',\n annotations: {\n title: 'Productive API Write',\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: true,\n },\n inputSchema: {\n type: 'object',\n properties: {\n method: { type: 'string', enum: ['POST', 'PATCH', 'PUT', 'DELETE'] },\n path: { type: 'string' },\n body: { type: 'object' },\n confirm: { type: 'boolean' },\n dry_run: { type: 'boolean' },\n },\n required: ['method', 'path', 'confirm'],\n },\n },\n];\n\n/**\n * Additional tools only available in stdio mode (local execution)\n * These tools manage persistent configuration\n */\nexport const STDIO_ONLY_TOOLS: Tool[] = [\n {\n name: 'productive_configure',\n description: 'Configure Productive.io credentials',\n annotations: {\n title: 'Configure Productive',\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n inputSchema: {\n type: 'object',\n properties: {\n organizationId: { type: 'string' },\n apiToken: { type: 'string' },\n userId: { type: 'string' },\n },\n required: ['organizationId', 'apiToken'],\n },\n },\n {\n name: 'productive_get_config',\n description: 'Get current configuration',\n annotations: {\n title: 'Get Productive Config',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n];\n"],"mappings":";;;;;;AAQA,SAAS,sBAA8B;CACrC,OAAO;EACL;EACA,cAAc,UAAU,KAAK,IAAI,EAAE;EACnC,YAAY,QAAQ,KAAK,IAAI,EAAE;EAC/B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,EAAE,KAAK,IAAI;AACb;;;;;;;;;;;;;;;;AAiBA,IAAa,QAAgB;CAC3B;EACE,MA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jB,gBAAgB;GAChB,eAAe;EACjB;EACA,aAAa;GACX,MAAM;GACN,YAAY;IACV,QAAQ;KAAE,MAAM;KAAU,MAAM;MAAC;MAAQ;MAAS;MAAO;KAAQ;IAAE;IACnE,MAAM,EAAE,MAAM,SAAS;IACvB,MAAM,EAAE,MAAM,SAAS;IACvB,SAAS,EAAE,MAAM,UAAU;IAC3B,SAAS,EAAE,MAAM,UAAU;GAC7B;GACA,UAAU;IAAC;IAAU;IAAQ;GAAS;EACxC;CACF;AACF;;;;;AAMA,IAAa,mBAA2B,CACtC;CACE,MAAM;CACN,aAAa;CACb,aAAa;EACX,OAAO;EACP,cAAc;EACd,iBAAiB;EACjB,gBAAgB;EAChB,eAAe;CACjB;CACA,aAAa;EACX,MAAM;EACN,YAAY;GACV,gBAAgB,EAAE,MAAM,SAAS;GACjC,UAAU,EAAE,MAAM,SAAS;GAC3B,QAAQ,EAAE,MAAM,SAAS;EAC3B;EACA,UAAU,CAAC,kBAAkB,UAAU;CACzC;AACF,GACA;CACE,MAAM;CACN,aAAa;CACb,aAAa;EACX,OAAO;EACP,cAAc;EACd,iBAAiB;EACjB,gBAAgB;EAChB,eAAe;CACjB;CACA,aAAa;EACX,MAAM;EACN,YAAY,CAAC;CACf;AACF,CACF"}
@@ -1,4 +1,4 @@
1
- import { a as handleSchemaOverview, c as handleDeals, i as handleServices, n as handleTasks, o as handleProjects, r as handleSummaries, s as handlePeople } from "./handlers-vtRpc-Lx.js";
1
+ import { C as handleSchemaOverview, E as handleDeals, S as handleServices, T as handlePeople, b as handleTasks, w as handleProjects, x as handleSummaries } from "./handlers-DonE83xo.js";
2
2
  import { ProductiveApi } from "@studiometa/productive-api";
3
3
  import { readFileSync } from "node:fs";
4
4
  import { dirname, join } from "node:path";
@@ -235,8 +235,8 @@ async function readResource(uri, credentials) {
235
235
  }
236
236
  //#endregion
237
237
  //#region src/version.ts
238
- var VERSION = "0.10.10";
238
+ var VERSION = "0.10.12";
239
239
  //#endregion
240
240
  export { INSTRUCTIONS as a, readResource as i, listResourceTemplates as n, listResources as r, VERSION as t };
241
241
 
242
- //# sourceMappingURL=version-Cy8UEAT1.js.map
242
+ //# sourceMappingURL=version-DMEaGciu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version-Cy8UEAT1.js","names":[],"sources":["../src/instructions.ts","../src/resources.ts","../src/version.ts"],"sourcesContent":["/**\n * MCP Server Instructions\n *\n * These instructions are sent to Claude Desktop during initialization\n * and used as context/hints for the LLM. This ensures the AI agent\n * knows how to properly use the Productive.io MCP server.\n *\n * The content is derived from skills/SKILL.md (without YAML frontmatter).\n */\n\nimport { readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\n/**\n * Load instructions from SKILL.md file\n * Removes YAML frontmatter (content between --- markers)\n */\nfunction loadInstructions(): string {\n try {\n // In dist/, go up to package root, then to skills/\n const skillPath = join(__dirname, '..', 'skills', 'SKILL.md');\n const content = readFileSync(skillPath, 'utf-8');\n\n // Remove YAML frontmatter (between --- markers at start of file)\n const withoutFrontmatter = content.replace(/^---\\n[\\s\\S]*?\\n---\\n+/, '');\n\n return withoutFrontmatter.trim();\n } catch {\n // Fallback if file not found (shouldn't happen in production)\n return 'Productive.io MCP Server - Use the productive tool with resource and action parameters.';\n }\n}\n\nexport const INSTRUCTIONS = loadInstructions();\n","/**\n * MCP Resources handlers for Productive MCP Server\n *\n * Exposes Productive data via MCP resources/ capability so clients can browse\n * and read data without tool calls.\n *\n * Static resources (always available):\n * productive://schema — full resource schema overview\n * productive://instructions — server instructions / SKILL.md content\n *\n * Resource templates (parameterized, require API calls):\n * productive://projects/{id} — project details\n * productive://tasks/{id} — task details\n * productive://people/{id} — person details\n * productive://deals/{id} — deal details\n * productive://projects/{id}/tasks — tasks for a project\n * productive://projects/{id}/services — services for a project\n *\n * Dynamic resources (computed):\n * productive://summaries/my_day — personal dashboard\n * productive://summaries/team_pulse — team activity\n */\n\nimport type { ReadResourceResult as McpReadResourceResult } from '@modelcontextprotocol/sdk/types.js';\n\nimport { ProductiveApi } from '@studiometa/productive-api';\nimport { fromHandlerContext } from '@studiometa/productive-core';\n\nimport type { ProductiveCredentials } from './auth.js';\nimport type { HandlerContext } from './handlers/types.js';\n\nimport { handleDeals } from './handlers/deals.js';\nimport { handlePeople } from './handlers/people.js';\nimport { handleProjects } from './handlers/projects.js';\nimport { handleSchemaOverview } from './handlers/schema.js';\nimport { handleServices } from './handlers/services.js';\nimport { handleSummaries } from './handlers/summaries.js';\nimport { handleTasks } from './handlers/tasks.js';\nimport { INSTRUCTIONS } from './instructions.js';\n\n/** MIME type used for all resource content */\nconst MIME_TYPE = 'application/json';\n\n/**\n * A single resource content item returned in resources/read responses\n */\nexport interface ResourceContent {\n uri: string;\n mimeType: string;\n text: string;\n}\n\n/**\n * Shape of a resources/read response (re-export of SDK type for consumers)\n */\nexport type ReadResourceResult = McpReadResourceResult;\n\n/**\n * Shape of a static resource descriptor (resources/list)\n */\nexport interface StaticResource {\n uri: string;\n name: string;\n description: string;\n mimeType: string;\n}\n\n/**\n * Shape of a resource template descriptor (resources/templates/list)\n */\nexport interface ResourceTemplate {\n uriTemplate: string;\n name: string;\n description: string;\n mimeType: string;\n}\n\n// ---------------------------------------------------------------------------\n// Static resource definitions\n// ---------------------------------------------------------------------------\n\n/**\n * Static resources that are always available without API credentials\n */\nexport const STATIC_RESOURCES: StaticResource[] = [\n {\n uri: 'productive://schema',\n name: 'Schema',\n description: 'Overview of all Productive.io resources, their actions and filters',\n mimeType: MIME_TYPE,\n },\n {\n uri: 'productive://instructions',\n name: 'Instructions',\n description: 'Server instructions and usage guide for the Productive.io MCP server',\n mimeType: MIME_TYPE,\n },\n];\n\n// ---------------------------------------------------------------------------\n// Dynamic resource definitions\n// ---------------------------------------------------------------------------\n\n/**\n * Dynamic resources that are computed at read time (require credentials)\n */\nexport const DYNAMIC_RESOURCES: StaticResource[] = [\n {\n uri: 'productive://summaries/my_day',\n name: 'My Day',\n description: \"Personal dashboard: open tasks, today's time entries, active timers\",\n mimeType: MIME_TYPE,\n },\n {\n uri: 'productive://summaries/team_pulse',\n name: 'Team Pulse',\n description: 'Team-wide time tracking activity for today',\n mimeType: MIME_TYPE,\n },\n];\n\n// ---------------------------------------------------------------------------\n// Resource template definitions\n// ---------------------------------------------------------------------------\n\n/**\n * Resource templates that accept URI parameters (require credentials)\n */\nexport const RESOURCE_TEMPLATES: ResourceTemplate[] = [\n {\n uriTemplate: 'productive://projects/{id}',\n name: 'Project',\n description: 'Details of a specific project by ID',\n mimeType: MIME_TYPE,\n },\n {\n uriTemplate: 'productive://tasks/{id}',\n name: 'Task',\n description: 'Details of a specific task by ID',\n mimeType: MIME_TYPE,\n },\n {\n uriTemplate: 'productive://people/{id}',\n name: 'Person',\n description: 'Details of a specific person by ID',\n mimeType: MIME_TYPE,\n },\n {\n uriTemplate: 'productive://deals/{id}',\n name: 'Deal',\n description: 'Details of a specific deal or budget by ID',\n mimeType: MIME_TYPE,\n },\n {\n uriTemplate: 'productive://projects/{id}/tasks',\n name: 'Project Tasks',\n description: 'All tasks belonging to a specific project',\n mimeType: MIME_TYPE,\n },\n {\n uriTemplate: 'productive://projects/{id}/services',\n name: 'Project Services',\n description: 'All services belonging to a specific project',\n mimeType: MIME_TYPE,\n },\n];\n\n// ---------------------------------------------------------------------------\n// URI pattern matching\n// ---------------------------------------------------------------------------\n\n/** Route patterns and their handler factories */\nconst URI_PATTERNS: Array<{\n pattern: RegExp;\n handler: (match: RegExpMatchArray, credentials: ProductiveCredentials) => Promise<unknown>;\n}> = [\n // Static resources (no credentials needed)\n {\n pattern: /^productive:\\/\\/schema$/,\n handler: async () => {\n const result = handleSchemaOverview();\n const text = result.content[0] as { text: string };\n return JSON.parse(text.text);\n },\n },\n {\n pattern: /^productive:\\/\\/instructions$/,\n handler: async () => ({ instructions: INSTRUCTIONS }),\n },\n\n // Dynamic summaries\n {\n pattern: /^productive:\\/\\/summaries\\/my_day$/,\n handler: async (_, credentials) => {\n const ctx = buildHandlerContext(credentials);\n const result = await handleSummaries('my_day', {}, ctx);\n return extractJsonFromResult(result);\n },\n },\n {\n pattern: /^productive:\\/\\/summaries\\/team_pulse$/,\n handler: async (_, credentials) => {\n const ctx = buildHandlerContext(credentials);\n const result = await handleSummaries('team_pulse', {}, ctx);\n return extractJsonFromResult(result);\n },\n },\n\n // Project nested resources (before single project to avoid conflict)\n {\n pattern: /^productive:\\/\\/projects\\/([^/]+)\\/tasks$/,\n handler: async ([, id], credentials) => {\n const ctx = buildHandlerContext(credentials, { filter: { project_id: id } });\n const result = await handleTasks('list', { project_id: id }, ctx);\n return extractJsonFromResult(result);\n },\n },\n {\n pattern: /^productive:\\/\\/projects\\/([^/]+)\\/services$/,\n handler: async ([, id], credentials) => {\n const ctx = buildHandlerContext(credentials, { filter: { project_id: id } });\n // handleServices uses CommonArgs; project_id is passed via ctx.filter\n const result = await handleServices('list', {}, ctx);\n return extractJsonFromResult(result);\n },\n },\n\n // Single entity resources\n {\n pattern: /^productive:\\/\\/projects\\/([^/]+)$/,\n handler: async ([, id], credentials) => {\n const ctx = buildHandlerContext(credentials);\n const result = await handleProjects('get', { id }, ctx);\n return extractJsonFromResult(result);\n },\n },\n {\n pattern: /^productive:\\/\\/tasks\\/([^/]+)$/,\n handler: async ([, id], credentials) => {\n const ctx = buildHandlerContext(credentials);\n const result = await handleTasks('get', { id }, ctx);\n return extractJsonFromResult(result);\n },\n },\n {\n pattern: /^productive:\\/\\/people\\/([^/]+)$/,\n handler: async ([, id], credentials) => {\n const ctx = buildHandlerContext(credentials);\n const result = await handlePeople('get', { id }, ctx, credentials);\n return extractJsonFromResult(result);\n },\n },\n {\n pattern: /^productive:\\/\\/deals\\/([^/]+)$/,\n handler: async ([, id], credentials) => {\n const ctx = buildHandlerContext(credentials);\n const result = await handleDeals('get', { id }, ctx);\n return extractJsonFromResult(result);\n },\n },\n];\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/**\n * Build a HandlerContext from credentials, with optional filter overrides.\n */\nfunction buildHandlerContext(\n credentials: ProductiveCredentials,\n overrides: { filter?: Record<string, string> } = {},\n): HandlerContext {\n const api = new ProductiveApi({\n config: {\n apiToken: credentials.apiToken,\n organizationId: credentials.organizationId,\n userId: credentials.userId,\n baseUrl: process.env.PRODUCTIVE_BASE_URL,\n },\n });\n\n const execCtx = fromHandlerContext({ api }, { userId: credentials.userId });\n\n return {\n formatOptions: { compact: false },\n filter: overrides.filter,\n perPage: 50,\n includeHints: false,\n includeSuggestions: false,\n executor: () => execCtx,\n };\n}\n\n/**\n * Extract the parsed JSON data from a ToolResult.\n * Throws if the result is an error or not parseable.\n */\nfunction extractJsonFromResult(result: { content: unknown[]; isError?: boolean }): unknown {\n if (result.isError) {\n const text = (result.content[0] as { text: string }).text;\n throw new Error(text);\n }\n const text = (result.content[0] as { text: string }).text;\n try {\n return JSON.parse(text);\n } catch {\n return { text };\n }\n}\n\n// ---------------------------------------------------------------------------\n// Public API\n// ---------------------------------------------------------------------------\n\n/**\n * List all static and dynamic resources (no credentials needed for static).\n */\nexport function listResources(): StaticResource[] {\n return [...STATIC_RESOURCES, ...DYNAMIC_RESOURCES];\n}\n\n/**\n * List all resource templates.\n */\nexport function listResourceTemplates(): ResourceTemplate[] {\n return RESOURCE_TEMPLATES;\n}\n\n/**\n * Read a resource by URI.\n *\n * Routes the URI to the appropriate handler. Throws on unknown URI.\n */\nexport async function readResource(\n uri: string,\n credentials: ProductiveCredentials,\n): Promise<ReadResourceResult> {\n for (const { pattern, handler } of URI_PATTERNS) {\n const match = uri.match(pattern);\n if (match) {\n const data = await handler(match, credentials);\n return {\n contents: [\n {\n uri,\n mimeType: MIME_TYPE,\n text: JSON.stringify(data, null, 2),\n },\n ],\n };\n }\n }\n\n throw new Error(\n `Unknown resource URI: ${uri}. ` +\n `Available static resources: ${STATIC_RESOURCES.map((r) => r.uri).join(', ')}. ` +\n `Available dynamic resources: ${DYNAMIC_RESOURCES.map((r) => r.uri).join(', ')}. ` +\n `Resource templates: ${RESOURCE_TEMPLATES.map((t) => t.uriTemplate).join(', ')}.`,\n );\n}\n","/**\n * Package version - injected from package.json at build time\n */\ndeclare const __VERSION__: string;\nexport const VERSION = __VERSION__;\n"],"mappings":";;;;;;;;;;;;;;;;AAcA,IAAM,YAAY,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;;;;;AAMzD,SAAS,mBAA2B;AAClC,KAAI;AAQF,SALgB,aADE,KAAK,WAAW,MAAM,UAAU,WAAW,EACrB,QAAQ,CAGb,QAAQ,0BAA0B,GAAG,CAE9C,MAAM;SAC1B;AAEN,SAAO;;;AAIX,IAAa,eAAe,kBAAkB;;;;ACK9C,IAAM,YAAY;;;;AA2ClB,IAAa,mBAAqC,CAChD;CACE,KAAK;CACL,MAAM;CACN,aAAa;CACb,UAAU;CACX,EACD;CACE,KAAK;CACL,MAAM;CACN,aAAa;CACb,UAAU;CACX,CACF;;;;AASD,IAAa,oBAAsC,CACjD;CACE,KAAK;CACL,MAAM;CACN,aAAa;CACb,UAAU;CACX,EACD;CACE,KAAK;CACL,MAAM;CACN,aAAa;CACb,UAAU;CACX,CACF;;;;AASD,IAAa,qBAAyC;CACpD;EACE,aAAa;EACb,MAAM;EACN,aAAa;EACb,UAAU;EACX;CACD;EACE,aAAa;EACb,MAAM;EACN,aAAa;EACb,UAAU;EACX;CACD;EACE,aAAa;EACb,MAAM;EACN,aAAa;EACb,UAAU;EACX;CACD;EACE,aAAa;EACb,MAAM;EACN,aAAa;EACb,UAAU;EACX;CACD;EACE,aAAa;EACb,MAAM;EACN,aAAa;EACb,UAAU;EACX;CACD;EACE,aAAa;EACb,MAAM;EACN,aAAa;EACb,UAAU;EACX;CACF;;AAOD,IAAM,eAGD;CAEH;EACE,SAAS;EACT,SAAS,YAAY;GAEnB,MAAM,OADS,sBAAsB,CACjB,QAAQ;AAC5B,UAAO,KAAK,MAAM,KAAK,KAAK;;EAE/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AM,EAAE,IAAI,CAAC,KAAK,KAAK,CAAC,iCAC7C,kBAAkB,KAAK,MAAM,EAAE,IAAI,CAAC,KAAK,KAAK,CAAC,wBACxD,mBAAmB,KAAK,MAAM,EAAE,YAAY,CAAC,KAAK,KAAK,CAAC,GAClF;;;;ACnWH,IAAa,UAAA"}
1
+ {"version":3,"file":"version-DMEaGciu.js","names":[],"sources":["../src/instructions.ts","../src/resources.ts","../src/version.ts"],"sourcesContent":["/**\n * MCP Server Instructions\n *\n * These instructions are sent to Claude Desktop during initialization\n * and used as context/hints for the LLM. This ensures the AI agent\n * knows how to properly use the Productive.io MCP server.\n *\n * The content is derived from skills/SKILL.md (without YAML frontmatter).\n */\n\nimport { readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\n/**\n * Load instructions from SKILL.md file\n * Removes YAML frontmatter (content between --- markers)\n */\nfunction loadInstructions(): string {\n try {\n // In dist/, go up to package root, then to skills/\n const skillPath = join(__dirname, '..', 'skills', 'SKILL.md');\n const content = readFileSync(skillPath, 'utf-8');\n\n // Remove YAML frontmatter (between --- markers at start of file)\n const withoutFrontmatter = content.replace(/^---\\n[\\s\\S]*?\\n---\\n+/, '');\n\n return withoutFrontmatter.trim();\n } catch {\n // Fallback if file not found (shouldn't happen in production)\n return 'Productive.io MCP Server - Use the productive tool with resource and action parameters.';\n }\n}\n\nexport const INSTRUCTIONS = loadInstructions();\n","/**\n * MCP Resources handlers for Productive MCP Server\n *\n * Exposes Productive data via MCP resources/ capability so clients can browse\n * and read data without tool calls.\n *\n * Static resources (always available):\n * productive://schema — full resource schema overview\n * productive://instructions — server instructions / SKILL.md content\n *\n * Resource templates (parameterized, require API calls):\n * productive://projects/{id} — project details\n * productive://tasks/{id} — task details\n * productive://people/{id} — person details\n * productive://deals/{id} — deal details\n * productive://projects/{id}/tasks — tasks for a project\n * productive://projects/{id}/services — services for a project\n *\n * Dynamic resources (computed):\n * productive://summaries/my_day — personal dashboard\n * productive://summaries/team_pulse — team activity\n */\n\nimport type { ReadResourceResult as McpReadResourceResult } from '@modelcontextprotocol/sdk/types.js';\n\nimport { ProductiveApi } from '@studiometa/productive-api';\nimport { fromHandlerContext } from '@studiometa/productive-core';\n\nimport type { ProductiveCredentials } from './auth.js';\nimport type { HandlerContext } from './handlers/types.js';\n\nimport { handleDeals } from './handlers/deals.js';\nimport { handlePeople } from './handlers/people.js';\nimport { handleProjects } from './handlers/projects.js';\nimport { handleSchemaOverview } from './handlers/schema.js';\nimport { handleServices } from './handlers/services.js';\nimport { handleSummaries } from './handlers/summaries.js';\nimport { handleTasks } from './handlers/tasks.js';\nimport { INSTRUCTIONS } from './instructions.js';\n\n/** MIME type used for all resource content */\nconst MIME_TYPE = 'application/json';\n\n/**\n * A single resource content item returned in resources/read responses\n */\nexport interface ResourceContent {\n uri: string;\n mimeType: string;\n text: string;\n}\n\n/**\n * Shape of a resources/read response (re-export of SDK type for consumers)\n */\nexport type ReadResourceResult = McpReadResourceResult;\n\n/**\n * Shape of a static resource descriptor (resources/list)\n */\nexport interface StaticResource {\n uri: string;\n name: string;\n description: string;\n mimeType: string;\n}\n\n/**\n * Shape of a resource template descriptor (resources/templates/list)\n */\nexport interface ResourceTemplate {\n uriTemplate: string;\n name: string;\n description: string;\n mimeType: string;\n}\n\n// ---------------------------------------------------------------------------\n// Static resource definitions\n// ---------------------------------------------------------------------------\n\n/**\n * Static resources that are always available without API credentials\n */\nexport const STATIC_RESOURCES: StaticResource[] = [\n {\n uri: 'productive://schema',\n name: 'Schema',\n description: 'Overview of all Productive.io resources, their actions and filters',\n mimeType: MIME_TYPE,\n },\n {\n uri: 'productive://instructions',\n name: 'Instructions',\n description: 'Server instructions and usage guide for the Productive.io MCP server',\n mimeType: MIME_TYPE,\n },\n];\n\n// ---------------------------------------------------------------------------\n// Dynamic resource definitions\n// ---------------------------------------------------------------------------\n\n/**\n * Dynamic resources that are computed at read time (require credentials)\n */\nexport const DYNAMIC_RESOURCES: StaticResource[] = [\n {\n uri: 'productive://summaries/my_day',\n name: 'My Day',\n description: \"Personal dashboard: open tasks, today's time entries, active timers\",\n mimeType: MIME_TYPE,\n },\n {\n uri: 'productive://summaries/team_pulse',\n name: 'Team Pulse',\n description: 'Team-wide time tracking activity for today',\n mimeType: MIME_TYPE,\n },\n];\n\n// ---------------------------------------------------------------------------\n// Resource template definitions\n// ---------------------------------------------------------------------------\n\n/**\n * Resource templates that accept URI parameters (require credentials)\n */\nexport const RESOURCE_TEMPLATES: ResourceTemplate[] = [\n {\n uriTemplate: 'productive://projects/{id}',\n name: 'Project',\n description: 'Details of a specific project by ID',\n mimeType: MIME_TYPE,\n },\n {\n uriTemplate: 'productive://tasks/{id}',\n name: 'Task',\n description: 'Details of a specific task by ID',\n mimeType: MIME_TYPE,\n },\n {\n uriTemplate: 'productive://people/{id}',\n name: 'Person',\n description: 'Details of a specific person by ID',\n mimeType: MIME_TYPE,\n },\n {\n uriTemplate: 'productive://deals/{id}',\n name: 'Deal',\n description: 'Details of a specific deal or budget by ID',\n mimeType: MIME_TYPE,\n },\n {\n uriTemplate: 'productive://projects/{id}/tasks',\n name: 'Project Tasks',\n description: 'All tasks belonging to a specific project',\n mimeType: MIME_TYPE,\n },\n {\n uriTemplate: 'productive://projects/{id}/services',\n name: 'Project Services',\n description: 'All services belonging to a specific project',\n mimeType: MIME_TYPE,\n },\n];\n\n// ---------------------------------------------------------------------------\n// URI pattern matching\n// ---------------------------------------------------------------------------\n\n/** Route patterns and their handler factories */\nconst URI_PATTERNS: Array<{\n pattern: RegExp;\n handler: (match: RegExpMatchArray, credentials: ProductiveCredentials) => Promise<unknown>;\n}> = [\n // Static resources (no credentials needed)\n {\n pattern: /^productive:\\/\\/schema$/,\n handler: async () => {\n const result = handleSchemaOverview();\n const text = result.content[0] as { text: string };\n return JSON.parse(text.text);\n },\n },\n {\n pattern: /^productive:\\/\\/instructions$/,\n handler: async () => ({ instructions: INSTRUCTIONS }),\n },\n\n // Dynamic summaries\n {\n pattern: /^productive:\\/\\/summaries\\/my_day$/,\n handler: async (_, credentials) => {\n const ctx = buildHandlerContext(credentials);\n const result = await handleSummaries('my_day', {}, ctx);\n return extractJsonFromResult(result);\n },\n },\n {\n pattern: /^productive:\\/\\/summaries\\/team_pulse$/,\n handler: async (_, credentials) => {\n const ctx = buildHandlerContext(credentials);\n const result = await handleSummaries('team_pulse', {}, ctx);\n return extractJsonFromResult(result);\n },\n },\n\n // Project nested resources (before single project to avoid conflict)\n {\n pattern: /^productive:\\/\\/projects\\/([^/]+)\\/tasks$/,\n handler: async ([, id], credentials) => {\n const ctx = buildHandlerContext(credentials, { filter: { project_id: id } });\n const result = await handleTasks('list', { project_id: id }, ctx);\n return extractJsonFromResult(result);\n },\n },\n {\n pattern: /^productive:\\/\\/projects\\/([^/]+)\\/services$/,\n handler: async ([, id], credentials) => {\n const ctx = buildHandlerContext(credentials, { filter: { project_id: id } });\n // handleServices uses CommonArgs; project_id is passed via ctx.filter\n const result = await handleServices('list', {}, ctx);\n return extractJsonFromResult(result);\n },\n },\n\n // Single entity resources\n {\n pattern: /^productive:\\/\\/projects\\/([^/]+)$/,\n handler: async ([, id], credentials) => {\n const ctx = buildHandlerContext(credentials);\n const result = await handleProjects('get', { id }, ctx);\n return extractJsonFromResult(result);\n },\n },\n {\n pattern: /^productive:\\/\\/tasks\\/([^/]+)$/,\n handler: async ([, id], credentials) => {\n const ctx = buildHandlerContext(credentials);\n const result = await handleTasks('get', { id }, ctx);\n return extractJsonFromResult(result);\n },\n },\n {\n pattern: /^productive:\\/\\/people\\/([^/]+)$/,\n handler: async ([, id], credentials) => {\n const ctx = buildHandlerContext(credentials);\n const result = await handlePeople('get', { id }, ctx, credentials);\n return extractJsonFromResult(result);\n },\n },\n {\n pattern: /^productive:\\/\\/deals\\/([^/]+)$/,\n handler: async ([, id], credentials) => {\n const ctx = buildHandlerContext(credentials);\n const result = await handleDeals('get', { id }, ctx);\n return extractJsonFromResult(result);\n },\n },\n];\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/**\n * Build a HandlerContext from credentials, with optional filter overrides.\n */\nfunction buildHandlerContext(\n credentials: ProductiveCredentials,\n overrides: { filter?: Record<string, string> } = {},\n): HandlerContext {\n const api = new ProductiveApi({\n config: {\n apiToken: credentials.apiToken,\n organizationId: credentials.organizationId,\n userId: credentials.userId,\n baseUrl: process.env.PRODUCTIVE_BASE_URL,\n },\n });\n\n const execCtx = fromHandlerContext({ api }, { userId: credentials.userId });\n\n return {\n formatOptions: { compact: false },\n filter: overrides.filter,\n perPage: 50,\n includeHints: false,\n includeSuggestions: false,\n executor: () => execCtx,\n };\n}\n\n/**\n * Extract the parsed JSON data from a ToolResult.\n * Throws if the result is an error or not parseable.\n */\nfunction extractJsonFromResult(result: { content: unknown[]; isError?: boolean }): unknown {\n if (result.isError) {\n const text = (result.content[0] as { text: string }).text;\n throw new Error(text);\n }\n const text = (result.content[0] as { text: string }).text;\n try {\n return JSON.parse(text);\n } catch {\n return { text };\n }\n}\n\n// ---------------------------------------------------------------------------\n// Public API\n// ---------------------------------------------------------------------------\n\n/**\n * List all static and dynamic resources (no credentials needed for static).\n */\nexport function listResources(): StaticResource[] {\n return [...STATIC_RESOURCES, ...DYNAMIC_RESOURCES];\n}\n\n/**\n * List all resource templates.\n */\nexport function listResourceTemplates(): ResourceTemplate[] {\n return RESOURCE_TEMPLATES;\n}\n\n/**\n * Read a resource by URI.\n *\n * Routes the URI to the appropriate handler. Throws on unknown URI.\n */\nexport async function readResource(\n uri: string,\n credentials: ProductiveCredentials,\n): Promise<ReadResourceResult> {\n for (const { pattern, handler } of URI_PATTERNS) {\n const match = uri.match(pattern);\n if (match) {\n const data = await handler(match, credentials);\n return {\n contents: [\n {\n uri,\n mimeType: MIME_TYPE,\n text: JSON.stringify(data, null, 2),\n },\n ],\n };\n }\n }\n\n throw new Error(\n `Unknown resource URI: ${uri}. ` +\n `Available static resources: ${STATIC_RESOURCES.map((r) => r.uri).join(', ')}. ` +\n `Available dynamic resources: ${DYNAMIC_RESOURCES.map((r) => r.uri).join(', ')}. ` +\n `Resource templates: ${RESOURCE_TEMPLATES.map((t) => t.uriTemplate).join(', ')}.`,\n );\n}\n","/**\n * Package version - injected from package.json at build time\n */\ndeclare const __VERSION__: string;\nexport const VERSION = __VERSION__;\n"],"mappings":";;;;;;;;;;;;;;;;AAcA,IAAM,YAAY,QAAQ,cAAc,OAAO,KAAK,GAAG,CAAC;;;;;AAMxD,SAAS,mBAA2B;CAClC,IAAI;EAQF,OALgB,aADE,KAAK,WAAW,MAAM,UAAU,UACrB,GAAW,OAGb,EAAQ,QAAQ,0BAA0B,EAE9D,EAAmB,KAAK;CACjC,QAAQ;EAEN,OAAO;CACT;AACF;AAEA,IAAa,eAAe,iBAAiB;;;;ACK7C,IAAM,YAAY;;;;AA2ClB,IAAa,mBAAqC,CAChD;CACE,KAAK;CACL,MAAM;CACN,aAAa;CACb,UAAU;AACZ,GACA;CACE,KAAK;CACL,MAAM;CACN,aAAa;CACb,UAAU;AACZ,CACF;;;;AASA,IAAa,oBAAsC,CACjD;CACE,KAAK;CACL,MAAM;CACN,aAAa;CACb,UAAU;AACZ,GACA;CACE,KAAK;CACL,MAAM;CACN,aAAa;CACb,UAAU;AACZ,CACF;;;;AASA,IAAa,qBAAyC;CACpD;EACE,aAAa;EACb,MAAM;EACN,aAAa;EACb,UAAU;CACZ;CACA;EACE,aAAa;EACb,MAAM;EACN,aAAa;EACb,UAAU;CACZ;CACA;EACE,aAAa;EACb,MAAM;EACN,aAAa;EACb,UAAU;CACZ;CACA;EACE,aAAa;EACb,MAAM;EACN,aAAa;EACb,UAAU;CACZ;CACA;EACE,aAAa;EACb,MAAM;EACN,aAAa;EACb,UAAU;CACZ;CACA;EACE,aAAa;EACb,MAAM;EACN,aAAa;EACb,UAAU;CACZ;AACF;;AAOA,IAAM,eAGD;CAEH;EACE,SAAS;EACT,SAAS,YAAY;GA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IACA,UAAU;IACV,MAAM,KAAK,UAAU,MAAM,MAAM,CAAC;GACpC,CACF,EACF;EACF;CACF;CAEA,MAAM,IAAI,MACR,yBAAyB,IAAI,gCACI,iBAAiB,KAAK,MAAM,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,iCAC7C,kBAAkB,KAAK,MAAM,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,wBACxD,mBAAmB,KAAK,MAAM,EAAE,WAAW,EAAE,KAAK,IAAI,EAAE,EACnF;AACF;;;ACpWA,IAAa,UAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studiometa/productive-mcp",
3
- "version": "0.10.10",
3
+ "version": "0.10.12",
4
4
  "description": "MCP server for Productive.io API - Model Context Protocol integration for Claude Desktop",
5
5
  "keywords": [
6
6
  "ai",
@@ -82,15 +82,15 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "@modelcontextprotocol/sdk": "^1.27.1",
85
- "@studiometa/productive-api": "0.10.10",
86
- "@studiometa/productive-core": "0.10.10",
85
+ "@studiometa/productive-api": "0.10.12",
86
+ "@studiometa/productive-core": "0.10.12",
87
87
  "h3": "^2.0.1-rc.14",
88
88
  "zod": "4.3.6"
89
89
  },
90
90
  "devDependencies": {
91
- "@vitest/coverage-v8": "^4.1.0-beta.5",
92
- "vite": "^8.0.0-beta.16",
93
- "vitest": "^4.1.0-beta.5"
91
+ "@vitest/coverage-v8": "^4.1.7",
92
+ "vite": "^8.0.14",
93
+ "vitest": "^4.1.7"
94
94
  },
95
95
  "engines": {
96
96
  "node": ">=24.0.0"
package/skills/SKILL.md CHANGED
@@ -11,7 +11,11 @@ MCP (Model Context Protocol) server for Productive.io. Provides a single unified
11
11
 
12
12
  Before your first interaction with any resource, call `action=help` with that resource to discover valid filters, required fields, includes, and examples.
13
13
 
14
- ## The `productive` Tool
14
+ ## MCP Tools
15
+
16
+ This server exposes one high-level tool and two low-level raw API tools.
17
+
18
+ ### `productive`
15
19
 
16
20
  Single unified tool with this signature:
17
21
 
@@ -878,6 +882,111 @@ Returns: deal details + services + comments + time entries
878
882
  - 480 = 8 hours (full day)
879
883
  - 240 = 4 hours (half day)
880
884
 
885
+ ## Raw API Tools
886
+
887
+ Use raw API tools only as escape hatches when the unified `productive` tool does not support the documented endpoint you need.
888
+
889
+ ### `api_read`
890
+
891
+ Read-only access to documented Productive `GET` endpoints.
892
+
893
+ **Use it for:** unsupported read endpoints, inspecting endpoint capabilities, or fetching raw shapes.
894
+
895
+ **Parameters**
896
+
897
+ - `path` — required relative API path starting with `/`
898
+ - `describe` — return endpoint documentation instead of executing
899
+ - `filter` — validated against the endpoint spec
900
+ - `include` — related resources to include
901
+ - `sort` — validated sort values
902
+ - `page`, `per_page` — page number and size (`per_page` max `200`)
903
+ - `paginate`, `max_pages` — safe auto-pagination (`max_pages` default `20`, max `50`)
904
+
905
+ **Safety model**
906
+
907
+ - `GET` only
908
+ - relative paths only; absolute URLs are rejected
909
+ - path traversal is rejected
910
+ - only documented Productive endpoints are allowed
911
+ - filter fields, operators, and sort values are validated
912
+
913
+ **Recommended workflow**
914
+
915
+ 1. Call `api_read` with `describe=true`
916
+ 2. Review allowed methods, filters, and sort values
917
+ 3. Make the real read call with the validated path and params
918
+
919
+ **Examples**
920
+
921
+ ```json
922
+ { "path": "/invoices", "describe": true }
923
+ ```
924
+
925
+ ```json
926
+ {
927
+ "path": "/projects/123/tasks",
928
+ "filter": { "status": "open" },
929
+ "sort": ["due_date"],
930
+ "per_page": 50
931
+ }
932
+ ```
933
+
934
+ ### `api_write`
935
+
936
+ Raw write access to documented Productive endpoints.
937
+
938
+ **Use it only when:** the user explicitly wants a mutation and the higher-level `productive` tool cannot perform it.
939
+
940
+ **Parameters**
941
+
942
+ - `method` — required, one of `POST`, `PATCH`, `PUT`, `DELETE`
943
+ - `path` — required relative API path
944
+ - `body` — request payload
945
+ - `confirm` — required, must be `true`
946
+ - `dry_run` — preview the normalized request without executing it
947
+
948
+ **Safety model**
949
+
950
+ - disabled by default
951
+ - requires server env `PRODUCTIVE_MCP_ENABLE_API_WRITE=true`
952
+ - requires `confirm=true` on every call
953
+ - only documented Productive endpoints are allowed
954
+ - relative paths only; absolute URLs and traversal are rejected
955
+ - prefer `dry_run=true` before the real write
956
+
957
+ **Agent rules**
958
+
959
+ 1. Do not use `api_write` for routine mutations already covered by `productive`
960
+ 2. Always confirm intent with the user before using `api_write`
961
+ 3. Prefer `dry_run=true` first, then execute only after approval
962
+ 4. Preserve Productive payloads exactly; do not invent fields or IDs
963
+
964
+ **Examples**
965
+
966
+ ```json
967
+ {
968
+ "method": "PATCH",
969
+ "path": "/tasks/123",
970
+ "body": {
971
+ "data": {
972
+ "type": "tasks",
973
+ "id": "123",
974
+ "attributes": { "name": "Updated title" }
975
+ }
976
+ },
977
+ "confirm": true,
978
+ "dry_run": true
979
+ }
980
+ ```
981
+
982
+ ```json
983
+ {
984
+ "method": "DELETE",
985
+ "path": "/attachments/456",
986
+ "confirm": true
987
+ }
988
+ ```
989
+
881
990
  ## Configuration Tools (stdio mode only)
882
991
 
883
992
  In local/stdio mode, additional configuration tools are available:
@@ -918,6 +1027,9 @@ Key points:
918
1027
  5. **Check `people.me`** first to get the current user's ID for filters
919
1028
  6. **Follow `_hints`** - When getting a resource, check the `_hints` field for suggestions on fetching related context
920
1029
  7. **Act on `_suggestions`** - When present, `_suggestions` highlight data issues (overdue tasks, no time logged, etc.) that may need attention or should be surfaced to the user
1030
+ 8. **Prefer `api_read` over `api_write`** when a raw endpoint is needed
1031
+ 9. **Use `api_read.describe=true` first** before making raw API calls
1032
+ 10. **Treat `api_write` as break-glass access** - confirm, dry-run, then execute
921
1033
 
922
1034
  ## Prompt Templates
923
1035