@aithr-ai/mcp-server 1.0.0 → 1.0.2

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 +106 -1
  2. package/package.json +1 -2
package/index.js CHANGED
@@ -91,7 +91,7 @@ class MCPServer {
91
91
  return [
92
92
  {
93
93
  name: 'aether_canvas_state',
94
- description: 'Get the current state of the Aether canvas including all nodes and connections',
94
+ description: 'Get the current state of the Aether canvas including all nodes and connections. Use summary=true for lightweight response with just node IDs and types.',
95
95
  inputSchema: {
96
96
  type: 'object',
97
97
  properties: {
@@ -99,7 +99,29 @@ class MCPServer {
99
99
  type: 'string',
100
100
  description: 'Project ID (optional, uses default if not provided)',
101
101
  },
102
+ summary: {
103
+ type: 'boolean',
104
+ description: 'If true, returns only node IDs, types, and status (much smaller response). Default: false',
105
+ },
106
+ },
107
+ },
108
+ },
109
+ {
110
+ name: 'aether_clear_canvas',
111
+ description: 'Remove ALL nodes from the canvas. Use with caution - this deletes all agents and their artifacts from the project canvas.',
112
+ inputSchema: {
113
+ type: 'object',
114
+ properties: {
115
+ projectId: {
116
+ type: 'string',
117
+ description: 'Project ID (optional, uses default if not provided)',
118
+ },
119
+ confirm: {
120
+ type: 'boolean',
121
+ description: 'Must be true to confirm deletion',
122
+ },
102
123
  },
124
+ required: ['confirm'],
103
125
  },
104
126
  },
105
127
  {
@@ -830,6 +852,9 @@ class MCPServer {
830
852
  case 'aether_canvas_state':
831
853
  result = await this.getCanvasState(args);
832
854
  break;
855
+ case 'aether_clear_canvas':
856
+ result = await this.clearCanvas(args);
857
+ break;
833
858
  case 'aether_add_agent':
834
859
  result = await this.addAgent(args);
835
860
  break;
@@ -992,12 +1017,41 @@ class MCPServer {
992
1017
 
993
1018
  async getCanvasState(args) {
994
1019
  const projectId = args.projectId || config.projectId;
1020
+ const summary = args.summary || false;
1021
+
995
1022
  if (!projectId) {
996
1023
  return { error: 'No project ID configured. Set AETHER_PROJECT_ID environment variable.' };
997
1024
  }
998
1025
 
999
1026
  try {
1000
1027
  const data = await this.apiCall(`/workspaces/${config.workspaceSlug}/projects/${projectId}/canvas`);
1028
+
1029
+ // If summary mode, return only essential info (much smaller response)
1030
+ if (summary) {
1031
+ const nodeSummary = (data.nodes || []).map(node => ({
1032
+ id: node.id,
1033
+ agentId: node.agentId,
1034
+ agentType: node.agentType,
1035
+ status: node.status,
1036
+ label: node.data?.label || node.agentId,
1037
+ }));
1038
+
1039
+ const edgeSummary = (data.edges || []).map(edge => ({
1040
+ id: edge.id,
1041
+ source: edge.source,
1042
+ target: edge.target,
1043
+ type: edge.data?.connectionType,
1044
+ }));
1045
+
1046
+ return {
1047
+ nodeCount: nodeSummary.length,
1048
+ edgeCount: edgeSummary.length,
1049
+ nodes: nodeSummary,
1050
+ edges: edgeSummary,
1051
+ };
1052
+ }
1053
+
1054
+ // Full response (can be very large)
1001
1055
  return {
1002
1056
  nodes: data.nodes?.length || 0,
1003
1057
  edges: data.edges?.length || 0,
@@ -1011,6 +1065,57 @@ class MCPServer {
1011
1065
  }
1012
1066
  }
1013
1067
 
1068
+ async clearCanvas(args) {
1069
+ const projectId = args.projectId || config.projectId;
1070
+ const confirm = args.confirm;
1071
+
1072
+ if (!confirm) {
1073
+ return { error: 'Must set confirm: true to clear the canvas' };
1074
+ }
1075
+
1076
+ if (!projectId) {
1077
+ return { error: 'No project ID configured. Set AETHER_PROJECT_ID environment variable.' };
1078
+ }
1079
+
1080
+ try {
1081
+ // First get all nodes
1082
+ const data = await this.apiCall(`/workspaces/${config.workspaceSlug}/projects/${projectId}/canvas`);
1083
+ const nodes = data.nodes || [];
1084
+
1085
+ if (nodes.length === 0) {
1086
+ return { message: 'Canvas is already empty', deletedCount: 0 };
1087
+ }
1088
+
1089
+ // Delete each node
1090
+ const deleted = [];
1091
+ const failed = [];
1092
+
1093
+ for (const node of nodes) {
1094
+ try {
1095
+ await this.apiCall(
1096
+ `/workspaces/${config.workspaceSlug}/projects/${projectId}/canvas/nodes/${node.id}`,
1097
+ 'DELETE'
1098
+ );
1099
+ deleted.push(node.id);
1100
+ } catch (e) {
1101
+ failed.push({ id: node.id, error: e.message });
1102
+ }
1103
+ }
1104
+
1105
+ return {
1106
+ message: `Cleared ${deleted.length} nodes from canvas`,
1107
+ deletedCount: deleted.length,
1108
+ failedCount: failed.length,
1109
+ failed: failed.length > 0 ? failed : undefined,
1110
+ };
1111
+ } catch (e) {
1112
+ return {
1113
+ error: 'Could not clear canvas',
1114
+ details: e.message,
1115
+ };
1116
+ }
1117
+ }
1118
+
1014
1119
  async addAgent(args) {
1015
1120
  const { agentType, task, position, parentNodeId, nodeType, outputArtifactType, systemPrompt } = args;
1016
1121
  const projectId = config.projectId;
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@aithr-ai/mcp-server",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "MCP server to connect Claude Code to Aether canvas - AI-powered team workspace for software development",
5
5
  "main": "index.js",
6
- "type": "module",
7
6
  "bin": {
8
7
  "aether-mcp": "./index.js"
9
8
  },