owner-clone-ai-mcp 1.3.0 → 1.4.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 (2) hide show
  1. package/index.js +246 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -187,6 +187,140 @@ const TOOLS = [
187
187
  required: ['id'],
188
188
  },
189
189
  },
190
+ // スケジュール管理
191
+ {
192
+ name: 'list_schedules',
193
+ description: '指定期間のスケジュール一覧を取得します。from/to を省略すると今日から30日間。',
194
+ annotations: { readOnlyHint: true },
195
+ inputSchema: {
196
+ type: 'object',
197
+ properties: {
198
+ from: { type: 'string', description: '開始日 YYYY-MM-DD(省略時: 今日)' },
199
+ to: { type: 'string', description: '終了日 YYYY-MM-DD(省略時: 今日+30日)' },
200
+ },
201
+ },
202
+ },
203
+ {
204
+ name: 'create_schedule',
205
+ description: 'スケジュールを新規作成します。【書き込み権限付きキーが必要】',
206
+ annotations: { destructiveHint: false, idempotentHint: false },
207
+ inputSchema: {
208
+ type: 'object',
209
+ properties: {
210
+ title: { type: 'string', description: 'スケジュールのタイトル' },
211
+ start_at: { type: 'string', description: '開始日時 ISO8601(例: 2026-06-01T10:00:00+09:00)' },
212
+ end_at: { type: 'string', description: '終了日時 ISO8601(省略可)' },
213
+ all_day: { type: 'boolean', description: '終日イベントか(デフォルト: false)' },
214
+ description: { type: 'string', description: '詳細・メモ(省略可)' },
215
+ color: { type: 'string', description: 'カラーコード(例: #3b82f6、省略可)' },
216
+ recurrence_type: { type: 'string', description: '繰り返し: none/daily/weekly/monthly/weekdays(デフォルト: none)' },
217
+ recurrence_end_date: { type: 'string', description: '繰り返し終了日 YYYY-MM-DD(省略可)' },
218
+ },
219
+ required: ['title'],
220
+ },
221
+ },
222
+ {
223
+ name: 'update_schedule',
224
+ description: '既存のスケジュールを更新します。【書き込み権限付きキーが必要】',
225
+ annotations: { destructiveHint: false, idempotentHint: true },
226
+ inputSchema: {
227
+ type: 'object',
228
+ properties: {
229
+ id: { type: 'string', description: 'スケジュールID' },
230
+ title: { type: 'string', description: '新しいタイトル(省略時は変更なし)' },
231
+ start_at: { type: 'string', description: '新しい開始日時(省略時は変更なし)' },
232
+ end_at: { type: 'string', description: '新しい終了日時(省略時は変更なし)' },
233
+ all_day: { type: 'boolean', description: '終日フラグ(省略時は変更なし)' },
234
+ description: { type: 'string', description: '新しい詳細(省略時は変更なし)' },
235
+ color: { type: 'string', description: '新しいカラー(省略時は変更なし)' },
236
+ recurrence_type: { type: 'string', description: '新しい繰り返し設定(省略時は変更なし)' },
237
+ recurrence_end_date: { type: 'string', description: '新しい繰り返し終了日(省略時は変更なし)' },
238
+ },
239
+ required: ['id'],
240
+ },
241
+ },
242
+ {
243
+ name: 'delete_schedule',
244
+ description: 'スケジュールを削除します。【書き込み権限付きキーが必要】繰り返しの場合は全インスタンスが削除されます。',
245
+ annotations: { destructiveHint: true, idempotentHint: false },
246
+ inputSchema: {
247
+ type: 'object',
248
+ properties: {
249
+ id: { type: 'string', description: '削除するスケジュールID' },
250
+ },
251
+ required: ['id'],
252
+ },
253
+ },
254
+ // タスク管理
255
+ {
256
+ name: 'list_tasks',
257
+ description: 'タスク一覧を取得します。ステータスやタイプで絞り込み可能。',
258
+ annotations: { readOnlyHint: true },
259
+ inputSchema: {
260
+ type: 'object',
261
+ properties: {
262
+ status: { type: 'string', description: 'ステータス絞り込み: pending/done/dismissed/approved/rejected(省略時: 全件)' },
263
+ type: { type: 'string', description: 'タイプ絞り込み: manual/workflow_approval/workflow_review(省略時: 全件)' },
264
+ limit: { type: 'number', description: '取得件数(デフォルト: 50、最大: 200)' },
265
+ },
266
+ },
267
+ },
268
+ {
269
+ name: 'get_task',
270
+ description: '指定したタスクの詳細を取得します。',
271
+ annotations: { readOnlyHint: true },
272
+ inputSchema: {
273
+ type: 'object',
274
+ properties: {
275
+ id: { type: 'string', description: 'タスクID' },
276
+ },
277
+ required: ['id'],
278
+ },
279
+ },
280
+ {
281
+ name: 'create_task',
282
+ description: 'タスクを新規作成します(type=manual)。【書き込み権限付きキーが必要】',
283
+ annotations: { destructiveHint: false, idempotentHint: false },
284
+ inputSchema: {
285
+ type: 'object',
286
+ properties: {
287
+ title: { type: 'string', description: 'タスクタイトル' },
288
+ body: { type: 'string', description: '詳細・内容(省略可)' },
289
+ priority: { type: 'string', description: '優先度: low/normal/high(デフォルト: normal)' },
290
+ due_date: { type: 'string', description: '期限日時 ISO8601(省略可)' },
291
+ },
292
+ required: ['title'],
293
+ },
294
+ },
295
+ {
296
+ name: 'update_task',
297
+ description: 'タスクを更新します。【書き込み権限付きキーが必要】manual タスクは全フィールド更新可。他タイプはステータス変更のみ可。',
298
+ annotations: { destructiveHint: false, idempotentHint: true },
299
+ inputSchema: {
300
+ type: 'object',
301
+ properties: {
302
+ id: { type: 'string', description: 'タスクID' },
303
+ title: { type: 'string', description: '新しいタイトル(manual のみ、省略時は変更なし)' },
304
+ body: { type: 'string', description: '新しい詳細(manual のみ、省略時は変更なし)' },
305
+ priority: { type: 'string', description: '新しい優先度: low/normal/high(manual のみ)' },
306
+ due_date: { type: 'string', description: '新しい期限(manual のみ、null で期限解除)' },
307
+ status: { type: 'string', description: 'ステータス変更: pending/done/dismissed' },
308
+ },
309
+ required: ['id'],
310
+ },
311
+ },
312
+ {
313
+ name: 'delete_task',
314
+ description: 'タスクを削除します(manual タイプのみ)。【書き込み権限付きキーが必要】',
315
+ annotations: { destructiveHint: true, idempotentHint: false },
316
+ inputSchema: {
317
+ type: 'object',
318
+ properties: {
319
+ id: { type: 'string', description: '削除するタスクID(manual タイプのみ)' },
320
+ },
321
+ required: ['id'],
322
+ },
323
+ },
190
324
  // ワークフロー書き込み(読み書き可能キーが必要)
191
325
  {
192
326
  name: 'create_workflow',
@@ -512,6 +646,117 @@ async function executeTool(name, args) {
512
646
  return `✅ ${data.message}\n削除したナレッジ: ${data.deleted.title} (ID: ${data.deleted.id})`;
513
647
  }
514
648
 
649
+ case 'list_schedules': {
650
+ const params = new URLSearchParams();
651
+ if (args.from) params.set('from', args.from);
652
+ if (args.to) params.set('to', args.to);
653
+ const data = await callApi(`/schedules?${params}`);
654
+ if (!data.schedules || data.schedules.length === 0) return `期間内にスケジュールがありません(${data.from} 〜 ${data.to})`;
655
+ const lines = data.schedules.map(s =>
656
+ `- [${s.id}] ${s.title}` +
657
+ (s.start_at ? ` ${new Date(s.start_at).toLocaleString('ja-JP', { timeZone: 'Asia/Tokyo' })}` : '') +
658
+ (s.end_at ? ` 〜 ${new Date(s.end_at).toLocaleString('ja-JP', { timeZone: 'Asia/Tokyo' })}` : '') +
659
+ (s.all_day ? ' (終日)' : '') +
660
+ (s.recurrence_type && s.recurrence_type !== 'none' ? ` [繰り返し: ${s.recurrence_type}]` : '') +
661
+ (s.description ? `\n ${s.description}` : '')
662
+ );
663
+ return `スケジュール一覧(${data.from} 〜 ${data.to}、${data.count}件):\n\n${lines.join('\n')}`;
664
+ }
665
+
666
+ case 'create_schedule': {
667
+ const data = await callApi('/schedules', {
668
+ method: 'POST',
669
+ body: JSON.stringify({
670
+ title: args.title, description: args.description,
671
+ start_at: args.start_at, end_at: args.end_at,
672
+ all_day: args.all_day, color: args.color,
673
+ recurrence_type: args.recurrence_type,
674
+ recurrence_end_date: args.recurrence_end_date,
675
+ }),
676
+ });
677
+ return `✅ ${data.message}\nID: ${data.id}\nタイトル: ${data.title}` +
678
+ (data.start_at ? `\n開始: ${data.start_at}` : '');
679
+ }
680
+
681
+ case 'update_schedule': {
682
+ const body = {};
683
+ const sFields = ['title','description','start_at','end_at','all_day','color','recurrence_type','recurrence_end_date'];
684
+ sFields.forEach(f => { if (args[f] !== undefined) body[f] = args[f]; });
685
+ const data = await callApi(`/schedules/${args.id}`, {
686
+ method: 'PATCH',
687
+ body: JSON.stringify(body),
688
+ });
689
+ return `✅ ${data.message}\nID: ${data.id}`;
690
+ }
691
+
692
+ case 'delete_schedule': {
693
+ const data = await callApi(`/schedules/${args.id}`, { method: 'DELETE' });
694
+ return `✅ ${data.message}\nID: ${data.id}`;
695
+ }
696
+
697
+ case 'list_tasks': {
698
+ const params = new URLSearchParams();
699
+ if (args.status) params.set('status', args.status);
700
+ if (args.type) params.set('type', args.type);
701
+ if (args.limit) params.set('limit', String(args.limit));
702
+ const data = await callApi(`/tasks?${params}`);
703
+ if (!data.tasks || data.tasks.length === 0) return 'タスクがありません。';
704
+ const statusIcon = { pending: '⏳', done: '✅', dismissed: '🚫', approved: '✔', rejected: '✗' };
705
+ const lines = data.tasks.map(t =>
706
+ `${statusIcon[t.status] || '•'} [${t.id}] ${t.title}` +
707
+ ` [${t.status}/${t.priority}]` +
708
+ (t.due_date ? ` 期限:${t.due_date.slice(0, 10)}` : '') +
709
+ (t.type !== 'manual' ? ` (${t.type})` : '') +
710
+ (t.body ? `\n ${t.body.slice(0, 60)}${t.body.length > 60 ? '…' : ''}` : '')
711
+ );
712
+ return `タスク一覧(${data.count}件):\n\n${lines.join('\n')}`;
713
+ }
714
+
715
+ case 'get_task': {
716
+ const data = await callApi(`/tasks/${args.id}`);
717
+ const parts = [
718
+ `タイトル: ${data.title}`,
719
+ `ステータス: ${data.status}`,
720
+ `優先度: ${data.priority}`,
721
+ `タイプ: ${data.type}`,
722
+ data.due_date ? `期限: ${data.due_date.slice(0, 16)}` : '',
723
+ data.body ? `\n詳細:\n${data.body}` : '',
724
+ data.content ? `\n内容:\n${data.content}` : '',
725
+ `\nID: ${data.id}`,
726
+ `作成: ${data.created_at?.slice(0, 16)}`,
727
+ ].filter(Boolean);
728
+ return parts.join('\n');
729
+ }
730
+
731
+ case 'create_task': {
732
+ const data = await callApi('/tasks', {
733
+ method: 'POST',
734
+ body: JSON.stringify({
735
+ title: args.title, body: args.body,
736
+ priority: args.priority, due_date: args.due_date,
737
+ }),
738
+ });
739
+ return `✅ ${data.message}\nID: ${data.id}\nタイトル: ${data.title}` +
740
+ `\n優先度: ${data.priority}` +
741
+ (data.due_date ? `\n期限: ${data.due_date.slice(0, 10)}` : '');
742
+ }
743
+
744
+ case 'update_task': {
745
+ const body = {};
746
+ const tFields = ['title','body','priority','due_date','status'];
747
+ tFields.forEach(f => { if (args[f] !== undefined) body[f] = args[f]; });
748
+ const data = await callApi(`/tasks/${args.id}`, {
749
+ method: 'PATCH',
750
+ body: JSON.stringify(body),
751
+ });
752
+ return `✅ ${data.message}\nID: ${data.id}`;
753
+ }
754
+
755
+ case 'delete_task': {
756
+ const data = await callApi(`/tasks/${args.id}`, { method: 'DELETE' });
757
+ return `✅ ${data.message}\nID: ${data.id}`;
758
+ }
759
+
515
760
  case 'create_workflow': {
516
761
  const data = await callApi('/workflows', {
517
762
  method: 'POST',
@@ -587,7 +832,7 @@ async function executeTool(name, args) {
587
832
  // ── MCPサーバー起動 ────────────────────────────────────────────
588
833
  async function main() {
589
834
  const server = new Server(
590
- { name: 'owner-clone-ai', version: '1.3.0' },
835
+ { name: 'owner-clone-ai', version: '1.4.0' },
591
836
  { capabilities: { tools: {} } }
592
837
  );
593
838
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owner-clone-ai-mcp",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "MCP server for Owner Clone AI — exposes knowledge and agent presets to Claude Code",
5
5
  "main": "index.js",
6
6
  "bin": {