@ctera/n8n-nodes-ctera-ai 0.1.0 → 0.1.1
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 +1 -0
- package/README.md +27 -207
- package/dist/credentials/CteraAiMcpApi.credentials.js +1 -1
- package/dist/nodes/CteraAi/CteraAi.node.js +8 -7
- package/package.json +1 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,238 +1,58 @@
|
|
|
1
1
|
# n8n-nodes-ctera-ai
|
|
2
2
|
|
|
3
|
-
|
|
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
|
|
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
|
-
|
|
27
|
-
|
|
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
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
37
|
+
**3. Configure in n8n:**
|
|
205
38
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
-
|
|
43
|
+
## Example Use Cases
|
|
212
44
|
|
|
213
|
-
|
|
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
|
-
##
|
|
49
|
+
## Resources
|
|
216
50
|
|
|
217
|
-
|
|
218
|
-
-
|
|
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://
|
|
8
|
+
this.documentationUrl = 'https://github.com/ctera/ctera-n8n-nodes#readme';
|
|
9
9
|
this.properties = [
|
|
10
10
|
{
|
|
11
11
|
displayName: 'MCP Server URL',
|
|
@@ -200,19 +200,20 @@ class CteraAi {
|
|
|
200
200
|
'Content-Type': 'application/json',
|
|
201
201
|
'Authorization': `Bearer ${bearerToken}`,
|
|
202
202
|
},
|
|
203
|
-
body: requestBody,
|
|
204
|
-
json: true,
|
|
203
|
+
body: JSON.stringify(requestBody),
|
|
205
204
|
skipSslCertificateValidation: allowUnauthorizedCerts,
|
|
206
205
|
});
|
|
206
|
+
// Parse JSON response
|
|
207
|
+
const parsedResponse = typeof response === 'string' ? JSON.parse(response) : response;
|
|
207
208
|
// Handle MCP error responses
|
|
208
|
-
if (
|
|
209
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `MCP Error: ${
|
|
209
|
+
if (parsedResponse.error) {
|
|
210
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `MCP Error: ${parsedResponse.error.message || JSON.stringify(parsedResponse.error)}`, { itemIndex: i });
|
|
210
211
|
}
|
|
211
212
|
// Parse the result from MCP response
|
|
212
213
|
let result;
|
|
213
|
-
if (
|
|
214
|
+
if (parsedResponse.result && parsedResponse.result.content) {
|
|
214
215
|
// MCP returns content array
|
|
215
|
-
const content =
|
|
216
|
+
const content = parsedResponse.result.content[0];
|
|
216
217
|
if (content && content.type === 'text') {
|
|
217
218
|
try {
|
|
218
219
|
// Try to parse as JSON if it looks like JSON
|
|
@@ -228,7 +229,7 @@ class CteraAi {
|
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
231
|
else {
|
|
231
|
-
result =
|
|
232
|
+
result = parsedResponse.result;
|
|
232
233
|
}
|
|
233
234
|
returnData.push({
|
|
234
235
|
json: {
|
package/package.json
CHANGED