@ctera/n8n-nodes-ctera-ai 0.1.0 → 0.1.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.
package/LICENSE CHANGED
@@ -21,3 +21,4 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
22
 
23
23
 
24
+
package/README.md CHANGED
@@ -1,238 +1,58 @@
1
1
  # n8n-nodes-ctera-ai
2
2
 
3
- This is an n8n community node that provides integration with CTERA AI MCP (Model Context Protocol) server for intelligent document search and retrieval.
3
+ n8n community node for CTERA AI MCP integration - enables semantic search, chat, and expert discovery.
4
4
 
5
- [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
5
+ [n8n](https://n8n.io/) is a workflow automation platform.
6
6
 
7
7
  ## Installation
8
8
 
9
- ### Community Installation (Recommended)
10
-
11
- For n8n version 0.187.0 and above, you can install this node directly from npm:
12
-
13
- #### Standard Installation
14
-
15
- ```bash
16
- npm install -g @ctera/n8n-nodes-ctera-ai
17
- ```
18
-
19
- Then restart your n8n instance.
20
-
21
- #### Docker Installation
22
-
23
- For Docker-based n8n installations:
24
-
25
9
  ```bash
26
- # Install the node inside the running container
27
- docker exec -it <container-name> npm install -g @ctera/n8n-nodes-ctera-ai
28
-
29
- # Restart the container
30
- docker restart <container-name>
10
+ cd ~/.n8n/nodes
11
+ npm install @ctera/n8n-nodes-ctera-ai
31
12
  ```
32
13
 
33
- Replace `<container-name>` with your actual container name (e.g., `n8n`, `n8n_n8n_1`).
34
-
35
- **Note**: The node will persist across container restarts but will need to be reinstalled if the container is recreated. To make it permanent, consider creating a custom Docker image or using volume mounts.
36
-
37
- ### Manual Installation (Development)
38
-
39
- 1. Navigate to your n8n installation:
40
- ```bash
41
- cd ~/.n8n/nodes
42
- ```
43
-
44
- 2. Clone the repository:
45
- ```bash
46
- git clone https://github.com/ctera/ctera-n8n-nodes.git
47
- cd ctera-n8n-nodes
48
- ```
49
-
50
- 3. Install dependencies and build:
51
- ```bash
52
- npm install
53
- npm run build
54
- ```
55
-
56
- 4. Restart n8n
57
-
58
- For more details, see the [n8n community nodes installation guide](https://docs.n8n.io/integrations/community-nodes/installation/).
14
+ Then restart n8n. The **CTERA Data Intelligence** node will appear in your node list.
59
15
 
60
16
  ## Operations
61
17
 
62
- The CTERA AI node supports the following operations:
63
-
64
- ### List Experts
65
- Get a list of all available experts (AI knowledge bases) in the system.
66
-
67
- **No parameters required**
68
-
69
- **Output**: Array of expert objects containing:
70
- - `id`: Expert ID for API calls
71
- - `name`: Display name of the expert
72
- - `description`: Brief description of the expert's knowledge domain
73
- - `mcp_endpoint`: Dedicated MCP endpoint URL for this expert
74
-
75
- ### Semantic Search
76
- Search an expert's knowledge base using advanced semantic search.
77
-
78
- **Parameters**:
79
- - **Expert** (required): Select from available experts (dropdown populated via List Experts)
80
- - **Query** (required): Your search question or topic
81
- - **Additional Options**:
82
- - Modified After: Filter files modified on or after this date (YYYY-MM-DD)
83
- - Modified Before: Filter files modified before this date (YYYY-MM-DD)
84
- - Max Results: Number of relevant chunks to return (1-50, default: 5)
85
-
86
- **Output**: Array of relevant document chunks with:
87
- - Text content
88
- - Source file paths
89
- - Relevance scores
90
- - Metadata (dates, file types, etc.)
91
-
92
- ### Chat
93
- Have a conversational interaction with an AI expert about their knowledge domain.
94
-
95
- **Parameters**:
96
- - **Expert** (required): Select from available experts
97
- - **Message** (required): Your message or question to the expert
98
- - **Conversation ID** (optional): Continue an existing conversation thread
99
-
100
- **Output**:
101
- - AI expert's response
102
- - Conversation ID (for follow-up messages)
103
- - Citations to source documents (if applicable)
18
+ - **List Experts** - Get all available AI experts (knowledge bases)
19
+ - **Semantic Search** - Search within an expert's knowledge base
20
+ - **Chat** - Have a conversation with an AI expert
104
21
 
105
22
  ## Credentials
106
23
 
107
- This node requires CTERA AI MCP API credentials:
108
-
109
- ### Setup Instructions
110
-
111
- 1. **Generate a Bearer Token**:
112
- ```bash
113
- # Replace YOUR_MCP_SERVER, YOUR_OID, and email with your actual values
114
- curl -k "https://YOUR_MCP_SERVER/api/tokens/generate?oid=YOUR_OID&email=your.email@example.com" | jq -r .token
115
- ```
24
+ **1. Log into Admin UI** with your SSO credentials
116
25
 
117
- 2. **Add Credentials in n8n**:
118
- - Go to **Credentials** → **New Credential**
119
- - Search for "CTERA AI MCP API"
120
- - Fill in:
121
- - **MCP Server URL**: Your MCP server base URL (e.g., `https://mcp.example.com`)
122
- - **Bearer Token**: Paste the token from step 1
123
- - **Ignore SSL Issues**: Enable if using self-signed certificates
26
+ **2. Generate MCP Bearer Token:**
124
27
 
125
- 3. **Test the Credentials**: Click "Test" to verify connection
126
-
127
- ## Example Workflows
128
-
129
- ### Competitive Intelligence Daily Report
130
-
131
- ```
132
- Schedule Trigger (Daily 9 AM)
133
-
134
- CTERA AI: List Experts
135
-
136
- Split In Batches
137
-
138
- CTERA AI: Semantic Search
139
- - Expert: {{$json.id}}
140
- - Query: "Recent updates, announcements, and new features"
141
- - Modified After: {{$today.minus(7, 'days')}}
142
-
143
- Aggregate Results
144
-
145
- Send Email: Daily Intelligence Summary
146
- ```
147
-
148
- ### Interactive Q&A Chatbot
149
-
150
- ```
151
- Webhook (Receive Question)
152
-
153
- CTERA AI: Chat
154
- - Expert: (pre-configured expert ID)
155
- - Message: {{$json.question}}
156
- - Conversation ID: {{$json.conversationId}}
157
-
158
- Format Response
159
-
160
- Return Webhook Response
161
- ```
162
-
163
- ### Document Discovery Workflow
164
-
165
- ```
166
- Schedule Trigger (Hourly)
167
-
168
- CTERA AI: Semantic Search
169
- - Expert: "Product Documentation"
170
- - Query: "Installation and setup guides"
171
- - Modified After: {{$today.minus(1, 'hour')}}
172
-
173
- Filter: If results not empty
174
-
175
- Send Slack Notification
176
- ```
177
-
178
- ## Compatibility
179
-
180
- Tested with:
181
- - n8n version: 1.0.0+
182
- - CTERA AI MCP Server: 1.6.16+
183
-
184
- ## Resources
185
-
186
- * [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
187
- * [CTERA AI MCP Architecture](https://cteranet.atlassian.net/wiki/spaces/AI/pages/4757454995)
188
- * [Model Context Protocol](https://modelcontextprotocol.io/)
189
-
190
- ## Development
191
-
192
- ### Build
193
-
194
- ```bash
195
- npm run build
196
- ```
197
-
198
- ### Watch Mode
28
+ Navigate to the MCP Tokens section in Admin UI, or use the API:
199
29
 
200
30
  ```bash
201
- npm run dev
31
+ curl -k -X POST "https://YOUR_ADMIN_URL/admin/api/mcp-tokens/generate" \
32
+ -H "Cookie: connect.sid=YOUR_SESSION_COOKIE" \
33
+ -H "Content-Type: application/json" \
34
+ -d '{"days": 30}' | jq -r .token
202
35
  ```
203
36
 
204
- ### Linting
37
+ **3. Configure in n8n:**
205
38
 
206
- ```bash
207
- npm run lint
208
- npm run lintfix
209
- ```
39
+ - **MCP Server URL**: `https://mcp.your-domain.com`
40
+ - **Bearer Token**: Paste the token from step 2
41
+ - **Ignore SSL Issues**: Enable for self-signed certificates
210
42
 
211
- ### Publishing
43
+ ## Example Use Cases
212
44
 
213
- For maintainers publishing new versions to npm, see [PUBLISH.md](PUBLISH.md) for detailed instructions.
45
+ - **Daily Intelligence Reports** - Schedule searches across experts for recent updates
46
+ - **Q&A Chatbots** - Build webhook-based chatbots using the Chat operation
47
+ - **Document Discovery** - Monitor for new content and send notifications
214
48
 
215
- ## Version History
49
+ ## Resources
216
50
 
217
- ### 0.1.0
218
- - Initial public release
219
- - List Experts operation
220
- - Semantic Search operation
221
- - Chat with Expert operation
222
- - Bearer token authentication
51
+ - [n8n Community Nodes](https://docs.n8n.io/integrations/community-nodes/)
52
+ - [GitHub Issues](https://github.com/ctera/ctera-n8n-nodes/issues)
223
53
 
224
54
  ## License
225
55
 
226
- [MIT](LICENSE)
227
-
228
- ## Support
229
-
230
- For issues and questions:
231
- - GitHub Issues: https://github.com/ctera/ctera-n8n-nodes/issues
232
- - CTERA Support: support@ctera.com
233
-
234
-
235
-
236
-
56
+ [MIT](LICENSE) - See [PUBLISH.md](PUBLISH.md) for publishing guidelines.
237
57
 
238
58
 
@@ -5,7 +5,7 @@ class CteraAiMcpApi {
5
5
  constructor() {
6
6
  this.name = 'cteraAiMcpApi';
7
7
  this.displayName = 'CTERA AI MCP API';
8
- this.documentationUrl = 'https://cteranet.atlassian.net/wiki/spaces/AI/pages/4757454995';
8
+ this.documentationUrl = 'https://github.com/ctera/ctera-n8n-nodes#readme';
9
9
  this.properties = [
10
10
  {
11
11
  displayName: 'MCP Server URL',
@@ -150,7 +150,6 @@ class CteraAi {
150
150
  if (operation === 'listExperts') {
151
151
  toolName = 'ctera_list_experts';
152
152
  serverUrl = `${mcpServerUrl}/mcp-bearer`;
153
- // No parameters needed
154
153
  }
155
154
  else if (operation === 'search') {
156
155
  toolName = 'expert_semantic_search';
@@ -200,19 +199,20 @@ class CteraAi {
200
199
  'Content-Type': 'application/json',
201
200
  'Authorization': `Bearer ${bearerToken}`,
202
201
  },
203
- body: requestBody,
204
- json: true,
202
+ body: JSON.stringify(requestBody),
205
203
  skipSslCertificateValidation: allowUnauthorizedCerts,
206
204
  });
205
+ // Parse JSON response
206
+ const parsedResponse = typeof response === 'string' ? JSON.parse(response) : response;
207
207
  // Handle MCP error responses
208
- if (response.error) {
209
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `MCP Error: ${response.error.message || JSON.stringify(response.error)}`, { itemIndex: i });
208
+ if (parsedResponse.error) {
209
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `MCP Error: ${parsedResponse.error.message || JSON.stringify(parsedResponse.error)}`, { itemIndex: i });
210
210
  }
211
211
  // Parse the result from MCP response
212
212
  let result;
213
- if (response.result && response.result.content) {
213
+ if (parsedResponse.result && parsedResponse.result.content) {
214
214
  // MCP returns content array
215
- const content = response.result.content[0];
215
+ const content = parsedResponse.result.content[0];
216
216
  if (content && content.type === 'text') {
217
217
  try {
218
218
  // Try to parse as JSON if it looks like JSON
@@ -228,14 +228,14 @@ class CteraAi {
228
228
  }
229
229
  }
230
230
  else {
231
- result = response.result;
231
+ result = parsedResponse.result;
232
232
  }
233
233
  returnData.push({
234
234
  json: {
235
+ ...items[i].json,
235
236
  operation,
236
237
  toolName,
237
238
  result,
238
- ...items[i].json,
239
239
  },
240
240
  pairedItem: { item: i },
241
241
  });
@@ -244,8 +244,8 @@ class CteraAi {
244
244
  if (this.continueOnFail()) {
245
245
  returnData.push({
246
246
  json: {
247
- error: error.message,
248
247
  ...items[i].json,
248
+ error: error.message,
249
249
  },
250
250
  pairedItem: { item: i },
251
251
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctera/n8n-nodes-ctera-ai",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "n8n community node for CTERA AI MCP integration - enables semantic search, chat, and expert discovery",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",