@contextstream/mcp-server 0.4.45 → 0.4.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +260 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10832,6 +10832,7 @@ ${context}`;
|
|
|
10832
10832
|
if (withDefaults.workspace_id) query.set("workspace_id", withDefaults.workspace_id);
|
|
10833
10833
|
if (withDefaults.project_id) query.set("project_id", withDefaults.project_id);
|
|
10834
10834
|
if (params?.status) query.set("status", params.status);
|
|
10835
|
+
if (params?.is_personal !== void 0) query.set("is_personal", String(params.is_personal));
|
|
10835
10836
|
if (params?.limit) query.set("limit", String(params.limit));
|
|
10836
10837
|
if (params?.offset) query.set("offset", String(params.offset));
|
|
10837
10838
|
const suffix = query.toString() ? `?${query.toString()}` : "";
|
|
@@ -10908,6 +10909,7 @@ ${context}`;
|
|
|
10908
10909
|
if (params?.plan_id) query.set("plan_id", params.plan_id);
|
|
10909
10910
|
if (params?.status) query.set("status", params.status);
|
|
10910
10911
|
if (params?.priority) query.set("priority", params.priority);
|
|
10912
|
+
if (params?.is_personal !== void 0) query.set("is_personal", String(params.is_personal));
|
|
10911
10913
|
if (params?.limit) query.set("limit", String(params.limit));
|
|
10912
10914
|
if (params?.offset) query.set("offset", String(params.offset));
|
|
10913
10915
|
const suffix = query.toString() ? `?${query.toString()}` : "";
|
|
@@ -11088,6 +11090,7 @@ ${context}`;
|
|
|
11088
11090
|
if (withDefaults.project_id) query.set("project_id", withDefaults.project_id);
|
|
11089
11091
|
if (params?.status) query.set("status", params.status);
|
|
11090
11092
|
if (params?.priority) query.set("priority", params.priority);
|
|
11093
|
+
if (params?.is_personal !== void 0) query.set("is_personal", String(params.is_personal));
|
|
11091
11094
|
if (params?.page) query.set("page", String(params.page));
|
|
11092
11095
|
if (params?.per_page) query.set("per_page", String(params.per_page));
|
|
11093
11096
|
const suffix = query.toString() ? `?${query.toString()}` : "";
|
|
@@ -11151,6 +11154,7 @@ ${context}`;
|
|
|
11151
11154
|
if (withDefaults.workspace_id) query.set("workspace_id", withDefaults.workspace_id);
|
|
11152
11155
|
if (withDefaults.project_id) query.set("project_id", withDefaults.project_id);
|
|
11153
11156
|
if (params?.diagram_type) query.set("diagram_type", params.diagram_type);
|
|
11157
|
+
if (params?.is_personal !== void 0) query.set("is_personal", String(params.is_personal));
|
|
11154
11158
|
if (params?.page) query.set("page", String(params.page));
|
|
11155
11159
|
if (params?.per_page) query.set("per_page", String(params.per_page));
|
|
11156
11160
|
const suffix = query.toString() ? `?${query.toString()}` : "";
|
|
@@ -11200,6 +11204,7 @@ ${context}`;
|
|
|
11200
11204
|
if (withDefaults.workspace_id) query.set("workspace_id", withDefaults.workspace_id);
|
|
11201
11205
|
if (withDefaults.project_id) query.set("project_id", withDefaults.project_id);
|
|
11202
11206
|
if (params?.doc_type) query.set("doc_type", params.doc_type);
|
|
11207
|
+
if (params?.is_personal !== void 0) query.set("is_personal", String(params.is_personal));
|
|
11203
11208
|
if (params?.page) query.set("page", String(params.page));
|
|
11204
11209
|
if (params?.per_page) query.set("per_page", String(params.per_page));
|
|
11205
11210
|
const suffix = query.toString() ? `?${query.toString()}` : "";
|
|
@@ -18674,7 +18679,7 @@ Output formats: full (default, includes content), paths (file paths only - 80% t
|
|
|
18674
18679
|
"session",
|
|
18675
18680
|
{
|
|
18676
18681
|
title: "Session",
|
|
18677
|
-
description: `Session management operations. Actions: capture (save decision/insight), capture_lesson (save lesson from mistake), get_lessons (retrieve lessons), recall (natural language recall), remember (quick save), user_context (get preferences), summary (workspace summary), compress (compress chat), delta (changes since timestamp), smart_search (context-enriched search), decision_trace (trace decision provenance), restore_context (restore state after compaction). Plan actions: capture_plan (save implementation plan), get_plan (retrieve plan with tasks), update_plan (modify plan), list_plans (list all plans). Team actions (team plans only): team_decisions (team-wide decisions), team_lessons (team-wide lessons).`,
|
|
18682
|
+
description: `Session management operations. Actions: capture (save decision/insight), capture_lesson (save lesson from mistake), get_lessons (retrieve lessons), recall (natural language recall), remember (quick save), user_context (get preferences), summary (workspace summary), compress (compress chat), delta (changes since timestamp), smart_search (context-enriched search), decision_trace (trace decision provenance), restore_context (restore state after compaction). Plan actions: capture_plan (save implementation plan), get_plan (retrieve plan with tasks), update_plan (modify plan), list_plans (list all plans). Team actions (team plans only): team_decisions (team-wide decisions), team_lessons (team-wide lessons), team_plans (plans across team workspaces).`,
|
|
18678
18683
|
inputSchema: external_exports.object({
|
|
18679
18684
|
action: external_exports.enum([
|
|
18680
18685
|
"capture",
|
|
@@ -18697,7 +18702,8 @@ Output formats: full (default, includes content), paths (file paths only - 80% t
|
|
|
18697
18702
|
"restore_context",
|
|
18698
18703
|
// Team actions (team plans only)
|
|
18699
18704
|
"team_decisions",
|
|
18700
|
-
"team_lessons"
|
|
18705
|
+
"team_lessons",
|
|
18706
|
+
"team_plans"
|
|
18701
18707
|
]).describe("Action to perform"),
|
|
18702
18708
|
workspace_id: external_exports.string().uuid().optional(),
|
|
18703
18709
|
project_id: external_exports.string().uuid().optional(),
|
|
@@ -18771,6 +18777,7 @@ Output formats: full (default, includes content), paths (file paths only - 80% t
|
|
|
18771
18777
|
due_at: external_exports.string().optional().describe("Due date for plan (ISO timestamp)"),
|
|
18772
18778
|
source_tool: external_exports.string().optional().describe("Tool that generated this plan"),
|
|
18773
18779
|
include_tasks: external_exports.boolean().optional().describe("Include tasks when getting plan"),
|
|
18780
|
+
is_personal: external_exports.boolean().optional().describe("Mark plan as personal (only visible to creator). For capture_plan/list_plans."),
|
|
18774
18781
|
// Restore context params
|
|
18775
18782
|
snapshot_id: external_exports.string().uuid().optional().describe("Specific snapshot ID to restore (defaults to most recent)"),
|
|
18776
18783
|
max_snapshots: external_exports.number().optional().default(1).describe("Number of recent snapshots to consider (default: 1)")
|
|
@@ -19013,7 +19020,8 @@ Output formats: full (default, includes content), paths (file paths only - 80% t
|
|
|
19013
19020
|
status: input.status || "draft",
|
|
19014
19021
|
tags: input.tags,
|
|
19015
19022
|
due_at: input.due_at,
|
|
19016
|
-
source_tool: input.source_tool || "mcp"
|
|
19023
|
+
source_tool: input.source_tool || "mcp",
|
|
19024
|
+
is_personal: input.is_personal
|
|
19017
19025
|
});
|
|
19018
19026
|
return {
|
|
19019
19027
|
content: [{ type: "text", text: formatContent(result) }]
|
|
@@ -19058,7 +19066,8 @@ Output formats: full (default, includes content), paths (file paths only - 80% t
|
|
|
19058
19066
|
workspace_id: workspaceId,
|
|
19059
19067
|
project_id: projectId,
|
|
19060
19068
|
status: input.status,
|
|
19061
|
-
limit: input.limit
|
|
19069
|
+
limit: input.limit,
|
|
19070
|
+
is_personal: input.is_personal
|
|
19062
19071
|
});
|
|
19063
19072
|
return {
|
|
19064
19073
|
content: [{ type: "text", text: formatContent(result) }]
|
|
@@ -19289,6 +19298,48 @@ Output formats: full (default, includes content), paths (file paths only - 80% t
|
|
|
19289
19298
|
]
|
|
19290
19299
|
};
|
|
19291
19300
|
}
|
|
19301
|
+
case "team_plans": {
|
|
19302
|
+
const isTeamForPlans = await client.isTeamPlan();
|
|
19303
|
+
if (!isTeamForPlans) {
|
|
19304
|
+
return {
|
|
19305
|
+
content: [
|
|
19306
|
+
{
|
|
19307
|
+
type: "text",
|
|
19308
|
+
text: "Team features require a Team subscription. Your current plan does not include team features.\n\nUpgrade at: https://contextstream.io/pricing"
|
|
19309
|
+
}
|
|
19310
|
+
]
|
|
19311
|
+
};
|
|
19312
|
+
}
|
|
19313
|
+
const teamWorkspacesForPlans = await client.listTeamWorkspaces({ page_size: 100 });
|
|
19314
|
+
const workspacesForPlans = teamWorkspacesForPlans?.items || teamWorkspacesForPlans?.data?.items || [];
|
|
19315
|
+
const allPlans = [];
|
|
19316
|
+
for (const ws of workspacesForPlans.slice(0, 10)) {
|
|
19317
|
+
try {
|
|
19318
|
+
const plans = await client.listPlans({
|
|
19319
|
+
workspace_id: ws.id,
|
|
19320
|
+
status: input.status,
|
|
19321
|
+
limit: input.limit ? Math.ceil(input.limit / workspacesForPlans.length) : 5
|
|
19322
|
+
});
|
|
19323
|
+
const items = plans?.data?.plans || plans?.plans || plans?.data?.items || plans?.items || [];
|
|
19324
|
+
allPlans.push(...items.map((p) => ({ ...p, workspace_name: ws.name })));
|
|
19325
|
+
} catch {
|
|
19326
|
+
}
|
|
19327
|
+
}
|
|
19328
|
+
allPlans.sort((a, b) => new Date(b.updated_at || b.created_at).getTime() - new Date(a.updated_at || a.created_at).getTime());
|
|
19329
|
+
const limitedPlans = allPlans.slice(0, input.limit || 20);
|
|
19330
|
+
return {
|
|
19331
|
+
content: [
|
|
19332
|
+
{
|
|
19333
|
+
type: "text",
|
|
19334
|
+
text: formatContent({
|
|
19335
|
+
team_plans: limitedPlans,
|
|
19336
|
+
total: limitedPlans.length,
|
|
19337
|
+
workspaces_searched: workspacesForPlans.length
|
|
19338
|
+
})
|
|
19339
|
+
}
|
|
19340
|
+
]
|
|
19341
|
+
};
|
|
19342
|
+
}
|
|
19292
19343
|
default:
|
|
19293
19344
|
return errorResult(`Unknown action: ${input.action}`);
|
|
19294
19345
|
}
|
|
@@ -19298,7 +19349,7 @@ Output formats: full (default, includes content), paths (file paths only - 80% t
|
|
|
19298
19349
|
"memory",
|
|
19299
19350
|
{
|
|
19300
19351
|
title: "Memory",
|
|
19301
|
-
description: `Memory operations for events and nodes. Event actions: create_event, get_event, update_event, delete_event, list_events, distill_event, import_batch (bulk import array of events). Node actions: create_node, get_node, update_node, delete_node, list_nodes, supersede_node. Query actions: search, decisions, timeline, summary. Task actions: create_task (create task, optionally linked to plan), get_task, update_task (can link/unlink task to plan via plan_id), delete_task, list_tasks, reorder_tasks. Todo actions: create_todo, list_todos, get_todo, update_todo, delete_todo, complete_todo. Diagram actions: create_diagram, list_diagrams, get_diagram, update_diagram, delete_diagram. Doc actions: create_doc, list_docs, get_doc, update_doc, delete_doc, create_roadmap.`,
|
|
19352
|
+
description: `Memory operations for events and nodes. Event actions: create_event, get_event, update_event, delete_event, list_events, distill_event, import_batch (bulk import array of events). Node actions: create_node, get_node, update_node, delete_node, list_nodes, supersede_node. Query actions: search, decisions, timeline, summary. Task actions: create_task (create task, optionally linked to plan), get_task, update_task (can link/unlink task to plan via plan_id), delete_task, list_tasks, reorder_tasks. Todo actions: create_todo, list_todos, get_todo, update_todo, delete_todo, complete_todo. Diagram actions: create_diagram, list_diagrams, get_diagram, update_diagram, delete_diagram. Doc actions: create_doc, list_docs, get_doc, update_doc, delete_doc, create_roadmap. Team actions (team plans only): team_tasks, team_todos, team_diagrams, team_docs.`,
|
|
19302
19353
|
inputSchema: external_exports.object({
|
|
19303
19354
|
action: external_exports.enum([
|
|
19304
19355
|
"create_event",
|
|
@@ -19345,7 +19396,12 @@ Output formats: full (default, includes content), paths (file paths only - 80% t
|
|
|
19345
19396
|
"get_doc",
|
|
19346
19397
|
"update_doc",
|
|
19347
19398
|
"delete_doc",
|
|
19348
|
-
"create_roadmap"
|
|
19399
|
+
"create_roadmap",
|
|
19400
|
+
// Team actions
|
|
19401
|
+
"team_tasks",
|
|
19402
|
+
"team_todos",
|
|
19403
|
+
"team_diagrams",
|
|
19404
|
+
"team_docs"
|
|
19349
19405
|
]).describe("Action to perform"),
|
|
19350
19406
|
workspace_id: external_exports.string().uuid().optional(),
|
|
19351
19407
|
project_id: external_exports.string().uuid().optional(),
|
|
@@ -19444,7 +19500,9 @@ Output formats: full (default, includes content), paths (file paths only - 80% t
|
|
|
19444
19500
|
target_date: external_exports.string().optional(),
|
|
19445
19501
|
status: external_exports.string().optional()
|
|
19446
19502
|
})
|
|
19447
|
-
).optional().describe("Milestones for create_roadmap action")
|
|
19503
|
+
).optional().describe("Milestones for create_roadmap action"),
|
|
19504
|
+
// Personal items param
|
|
19505
|
+
is_personal: external_exports.boolean().optional().describe("Mark as personal (only visible to creator). For create/list actions on todos, diagrams, docs.")
|
|
19448
19506
|
})
|
|
19449
19507
|
},
|
|
19450
19508
|
async (input) => {
|
|
@@ -19697,7 +19755,8 @@ ${formatContent(result)}`
|
|
|
19697
19755
|
priority: input.priority,
|
|
19698
19756
|
order: input.order,
|
|
19699
19757
|
code_refs: input.code_refs,
|
|
19700
|
-
tags: input.tags
|
|
19758
|
+
tags: input.tags,
|
|
19759
|
+
is_personal: input.is_personal
|
|
19701
19760
|
});
|
|
19702
19761
|
return {
|
|
19703
19762
|
content: [{ type: "text", text: formatContent(result) }]
|
|
@@ -19757,7 +19816,8 @@ ${formatContent(result)}`
|
|
|
19757
19816
|
plan_id: input.plan_id ?? void 0,
|
|
19758
19817
|
status: input.task_status,
|
|
19759
19818
|
priority: input.priority,
|
|
19760
|
-
limit: input.limit
|
|
19819
|
+
limit: input.limit,
|
|
19820
|
+
is_personal: input.is_personal
|
|
19761
19821
|
});
|
|
19762
19822
|
return {
|
|
19763
19823
|
content: [{ type: "text", text: formatContent(result) }]
|
|
@@ -19794,7 +19854,8 @@ ${formatContent(result)}`
|
|
|
19794
19854
|
title: input.title,
|
|
19795
19855
|
description: input.description,
|
|
19796
19856
|
priority: input.todo_priority,
|
|
19797
|
-
due_at: input.due_at
|
|
19857
|
+
due_at: input.due_at,
|
|
19858
|
+
is_personal: input.is_personal
|
|
19798
19859
|
});
|
|
19799
19860
|
return {
|
|
19800
19861
|
content: [{ type: "text", text: formatContent(todoResult) }]
|
|
@@ -19808,7 +19869,8 @@ ${formatContent(result)}`
|
|
|
19808
19869
|
workspace_id: workspaceId,
|
|
19809
19870
|
project_id: projectId,
|
|
19810
19871
|
status: input.todo_status,
|
|
19811
|
-
priority: input.todo_priority
|
|
19872
|
+
priority: input.todo_priority,
|
|
19873
|
+
is_personal: input.is_personal
|
|
19812
19874
|
});
|
|
19813
19875
|
return {
|
|
19814
19876
|
content: [{ type: "text", text: formatContent(todosResult) }]
|
|
@@ -19870,7 +19932,8 @@ ${formatContent(result)}`
|
|
|
19870
19932
|
title: input.title,
|
|
19871
19933
|
content: input.content,
|
|
19872
19934
|
diagram_type: input.diagram_type,
|
|
19873
|
-
metadata: input.metadata
|
|
19935
|
+
metadata: input.metadata,
|
|
19936
|
+
is_personal: input.is_personal
|
|
19874
19937
|
});
|
|
19875
19938
|
return {
|
|
19876
19939
|
content: [{ type: "text", text: formatContent(diagramResult) }]
|
|
@@ -19883,7 +19946,8 @@ ${formatContent(result)}`
|
|
|
19883
19946
|
const diagramsResult = await client.diagramsList({
|
|
19884
19947
|
workspace_id: workspaceId,
|
|
19885
19948
|
project_id: projectId,
|
|
19886
|
-
diagram_type: input.diagram_type
|
|
19949
|
+
diagram_type: input.diagram_type,
|
|
19950
|
+
is_personal: input.is_personal
|
|
19887
19951
|
});
|
|
19888
19952
|
return {
|
|
19889
19953
|
content: [{ type: "text", text: formatContent(diagramsResult) }]
|
|
@@ -19936,7 +20000,8 @@ ${formatContent(result)}`
|
|
|
19936
20000
|
title: input.title,
|
|
19937
20001
|
content: input.content,
|
|
19938
20002
|
doc_type: input.doc_type,
|
|
19939
|
-
metadata: input.metadata
|
|
20003
|
+
metadata: input.metadata,
|
|
20004
|
+
is_personal: input.is_personal
|
|
19940
20005
|
});
|
|
19941
20006
|
return {
|
|
19942
20007
|
content: [{ type: "text", text: formatContent(docResult) }]
|
|
@@ -19949,7 +20014,8 @@ ${formatContent(result)}`
|
|
|
19949
20014
|
const docsResult = await client.docsList({
|
|
19950
20015
|
workspace_id: workspaceId,
|
|
19951
20016
|
project_id: projectId,
|
|
19952
|
-
doc_type: input.doc_type
|
|
20017
|
+
doc_type: input.doc_type,
|
|
20018
|
+
is_personal: input.is_personal
|
|
19953
20019
|
});
|
|
19954
20020
|
return {
|
|
19955
20021
|
content: [{ type: "text", text: formatContent(docsResult) }]
|
|
@@ -19999,12 +20065,190 @@ ${formatContent(result)}`
|
|
|
19999
20065
|
workspace_id: workspaceId,
|
|
20000
20066
|
project_id: projectId,
|
|
20001
20067
|
title: input.title,
|
|
20002
|
-
milestones: input.milestones
|
|
20068
|
+
milestones: input.milestones,
|
|
20069
|
+
is_personal: input.is_personal
|
|
20003
20070
|
});
|
|
20004
20071
|
return {
|
|
20005
20072
|
content: [{ type: "text", text: formatContent(roadmapResult) }]
|
|
20006
20073
|
};
|
|
20007
20074
|
}
|
|
20075
|
+
case "team_tasks": {
|
|
20076
|
+
const isTeamForTasks = await client.isTeamPlan();
|
|
20077
|
+
if (!isTeamForTasks) {
|
|
20078
|
+
return {
|
|
20079
|
+
content: [
|
|
20080
|
+
{
|
|
20081
|
+
type: "text",
|
|
20082
|
+
text: "Team features require a Team subscription. Your current plan does not include team features.\n\nUpgrade at: https://contextstream.io/pricing"
|
|
20083
|
+
}
|
|
20084
|
+
]
|
|
20085
|
+
};
|
|
20086
|
+
}
|
|
20087
|
+
const teamWorkspacesForTasks = await client.listTeamWorkspaces({ page_size: 100 });
|
|
20088
|
+
const workspacesForTasks = teamWorkspacesForTasks?.items || teamWorkspacesForTasks?.data?.items || [];
|
|
20089
|
+
const allTasks = [];
|
|
20090
|
+
for (const ws of workspacesForTasks.slice(0, 10)) {
|
|
20091
|
+
try {
|
|
20092
|
+
const tasks = await client.listTasks({
|
|
20093
|
+
workspace_id: ws.id,
|
|
20094
|
+
status: input.task_status,
|
|
20095
|
+
limit: input.limit ? Math.ceil(input.limit / workspacesForTasks.length) : 10
|
|
20096
|
+
});
|
|
20097
|
+
const items = tasks?.data?.tasks || tasks?.tasks || tasks?.data?.items || tasks?.items || [];
|
|
20098
|
+
allTasks.push(...items.map((t) => ({ ...t, workspace_name: ws.name })));
|
|
20099
|
+
} catch {
|
|
20100
|
+
}
|
|
20101
|
+
}
|
|
20102
|
+
allTasks.sort((a, b) => new Date(b.updated_at || b.created_at).getTime() - new Date(a.updated_at || a.created_at).getTime());
|
|
20103
|
+
const limitedTasks = allTasks.slice(0, input.limit || 20);
|
|
20104
|
+
return {
|
|
20105
|
+
content: [
|
|
20106
|
+
{
|
|
20107
|
+
type: "text",
|
|
20108
|
+
text: formatContent({
|
|
20109
|
+
team_tasks: limitedTasks,
|
|
20110
|
+
total: limitedTasks.length,
|
|
20111
|
+
workspaces_searched: workspacesForTasks.length
|
|
20112
|
+
})
|
|
20113
|
+
}
|
|
20114
|
+
]
|
|
20115
|
+
};
|
|
20116
|
+
}
|
|
20117
|
+
case "team_todos": {
|
|
20118
|
+
const isTeamForTodos = await client.isTeamPlan();
|
|
20119
|
+
if (!isTeamForTodos) {
|
|
20120
|
+
return {
|
|
20121
|
+
content: [
|
|
20122
|
+
{
|
|
20123
|
+
type: "text",
|
|
20124
|
+
text: "Team features require a Team subscription. Your current plan does not include team features.\n\nUpgrade at: https://contextstream.io/pricing"
|
|
20125
|
+
}
|
|
20126
|
+
]
|
|
20127
|
+
};
|
|
20128
|
+
}
|
|
20129
|
+
const teamWorkspacesForTodos = await client.listTeamWorkspaces({ page_size: 100 });
|
|
20130
|
+
const workspacesForTodos = teamWorkspacesForTodos?.items || teamWorkspacesForTodos?.data?.items || [];
|
|
20131
|
+
const allTodos = [];
|
|
20132
|
+
for (const ws of workspacesForTodos.slice(0, 10)) {
|
|
20133
|
+
try {
|
|
20134
|
+
const todos = await client.todosList({
|
|
20135
|
+
workspace_id: ws.id,
|
|
20136
|
+
status: input.todo_status,
|
|
20137
|
+
priority: input.todo_priority,
|
|
20138
|
+
limit: input.limit ? Math.ceil(input.limit / workspacesForTodos.length) : 10
|
|
20139
|
+
});
|
|
20140
|
+
const items = todos?.data?.items || todos?.items || [];
|
|
20141
|
+
allTodos.push(...items.map((t) => ({ ...t, workspace_name: ws.name })));
|
|
20142
|
+
} catch {
|
|
20143
|
+
}
|
|
20144
|
+
}
|
|
20145
|
+
const priorityOrder = { urgent: 4, high: 3, medium: 2, low: 1 };
|
|
20146
|
+
allTodos.sort((a, b) => {
|
|
20147
|
+
const priDiff = (priorityOrder[b.priority] || 0) - (priorityOrder[a.priority] || 0);
|
|
20148
|
+
if (priDiff !== 0) return priDiff;
|
|
20149
|
+
if (a.due_at && b.due_at) return new Date(a.due_at).getTime() - new Date(b.due_at).getTime();
|
|
20150
|
+
if (a.due_at) return -1;
|
|
20151
|
+
if (b.due_at) return 1;
|
|
20152
|
+
return new Date(b.created_at).getTime() - new Date(a.created_at).getTime();
|
|
20153
|
+
});
|
|
20154
|
+
const limitedTodos = allTodos.slice(0, input.limit || 20);
|
|
20155
|
+
return {
|
|
20156
|
+
content: [
|
|
20157
|
+
{
|
|
20158
|
+
type: "text",
|
|
20159
|
+
text: formatContent({
|
|
20160
|
+
team_todos: limitedTodos,
|
|
20161
|
+
total: limitedTodos.length,
|
|
20162
|
+
workspaces_searched: workspacesForTodos.length
|
|
20163
|
+
})
|
|
20164
|
+
}
|
|
20165
|
+
]
|
|
20166
|
+
};
|
|
20167
|
+
}
|
|
20168
|
+
case "team_diagrams": {
|
|
20169
|
+
const isTeamForDiagrams = await client.isTeamPlan();
|
|
20170
|
+
if (!isTeamForDiagrams) {
|
|
20171
|
+
return {
|
|
20172
|
+
content: [
|
|
20173
|
+
{
|
|
20174
|
+
type: "text",
|
|
20175
|
+
text: "Team features require a Team subscription. Your current plan does not include team features.\n\nUpgrade at: https://contextstream.io/pricing"
|
|
20176
|
+
}
|
|
20177
|
+
]
|
|
20178
|
+
};
|
|
20179
|
+
}
|
|
20180
|
+
const teamWorkspacesForDiagrams = await client.listTeamWorkspaces({ page_size: 100 });
|
|
20181
|
+
const workspacesForDiagrams = teamWorkspacesForDiagrams?.items || teamWorkspacesForDiagrams?.data?.items || [];
|
|
20182
|
+
const allDiagrams = [];
|
|
20183
|
+
for (const ws of workspacesForDiagrams.slice(0, 10)) {
|
|
20184
|
+
try {
|
|
20185
|
+
const diagrams = await client.diagramsList({
|
|
20186
|
+
workspace_id: ws.id,
|
|
20187
|
+
diagram_type: input.diagram_type,
|
|
20188
|
+
limit: input.limit ? Math.ceil(input.limit / workspacesForDiagrams.length) : 10
|
|
20189
|
+
});
|
|
20190
|
+
const items = diagrams?.data?.items || diagrams?.items || [];
|
|
20191
|
+
allDiagrams.push(...items.map((d) => ({ ...d, workspace_name: ws.name })));
|
|
20192
|
+
} catch {
|
|
20193
|
+
}
|
|
20194
|
+
}
|
|
20195
|
+
allDiagrams.sort((a, b) => new Date(b.updated_at || b.created_at).getTime() - new Date(a.updated_at || a.created_at).getTime());
|
|
20196
|
+
const limitedDiagrams = allDiagrams.slice(0, input.limit || 20);
|
|
20197
|
+
return {
|
|
20198
|
+
content: [
|
|
20199
|
+
{
|
|
20200
|
+
type: "text",
|
|
20201
|
+
text: formatContent({
|
|
20202
|
+
team_diagrams: limitedDiagrams,
|
|
20203
|
+
total: limitedDiagrams.length,
|
|
20204
|
+
workspaces_searched: workspacesForDiagrams.length
|
|
20205
|
+
})
|
|
20206
|
+
}
|
|
20207
|
+
]
|
|
20208
|
+
};
|
|
20209
|
+
}
|
|
20210
|
+
case "team_docs": {
|
|
20211
|
+
const isTeamForDocs = await client.isTeamPlan();
|
|
20212
|
+
if (!isTeamForDocs) {
|
|
20213
|
+
return {
|
|
20214
|
+
content: [
|
|
20215
|
+
{
|
|
20216
|
+
type: "text",
|
|
20217
|
+
text: "Team features require a Team subscription. Your current plan does not include team features.\n\nUpgrade at: https://contextstream.io/pricing"
|
|
20218
|
+
}
|
|
20219
|
+
]
|
|
20220
|
+
};
|
|
20221
|
+
}
|
|
20222
|
+
const teamWorkspacesForDocs = await client.listTeamWorkspaces({ page_size: 100 });
|
|
20223
|
+
const workspacesForDocs = teamWorkspacesForDocs?.items || teamWorkspacesForDocs?.data?.items || [];
|
|
20224
|
+
const allDocs = [];
|
|
20225
|
+
for (const ws of workspacesForDocs.slice(0, 10)) {
|
|
20226
|
+
try {
|
|
20227
|
+
const docs = await client.docsList({
|
|
20228
|
+
workspace_id: ws.id,
|
|
20229
|
+
doc_type: input.doc_type,
|
|
20230
|
+
limit: input.limit ? Math.ceil(input.limit / workspacesForDocs.length) : 10
|
|
20231
|
+
});
|
|
20232
|
+
const items = docs?.data?.items || docs?.items || [];
|
|
20233
|
+
allDocs.push(...items.map((d) => ({ ...d, workspace_name: ws.name })));
|
|
20234
|
+
} catch {
|
|
20235
|
+
}
|
|
20236
|
+
}
|
|
20237
|
+
allDocs.sort((a, b) => new Date(b.updated_at || b.created_at).getTime() - new Date(a.updated_at || a.created_at).getTime());
|
|
20238
|
+
const limitedDocs = allDocs.slice(0, input.limit || 20);
|
|
20239
|
+
return {
|
|
20240
|
+
content: [
|
|
20241
|
+
{
|
|
20242
|
+
type: "text",
|
|
20243
|
+
text: formatContent({
|
|
20244
|
+
team_docs: limitedDocs,
|
|
20245
|
+
total: limitedDocs.length,
|
|
20246
|
+
workspaces_searched: workspacesForDocs.length
|
|
20247
|
+
})
|
|
20248
|
+
}
|
|
20249
|
+
]
|
|
20250
|
+
};
|
|
20251
|
+
}
|
|
20008
20252
|
default:
|
|
20009
20253
|
return errorResult(`Unknown action: ${input.action}`);
|
|
20010
20254
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contextstream/mcp-server",
|
|
3
3
|
"mcpName": "io.github.contextstreamio/mcp-server",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.46",
|
|
5
5
|
"description": "ContextStream MCP server - v0.4.x with consolidated domain tools (~11 tools, ~75% token reduction). Code context, memory, search, and AI tools.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|