@closedloop-ai/mcp-client 1.1.1 → 1.2.5

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.
@@ -0,0 +1,38 @@
1
+ name: Publish to npm
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths:
7
+ - 'index.js'
8
+ - 'package.json'
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ publish:
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ contents: read
16
+ id-token: write
17
+ steps:
18
+ - name: Checkout
19
+ uses: actions/checkout@v4
20
+
21
+ - name: Setup Node.js
22
+ uses: actions/setup-node@v4
23
+ with:
24
+ node-version: '22'
25
+
26
+ - name: Upgrade npm to latest
27
+ run: npm install -g npm@latest
28
+
29
+ - name: Check versions
30
+ run: |
31
+ node --version
32
+ npm --version
33
+
34
+ - name: Install dependencies
35
+ run: npm ci --ignore-scripts || npm install --ignore-scripts
36
+
37
+ - name: Publish with OIDC
38
+ run: npm publish --access public --provenance
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # ClosedLoop MCP Server
1
+ # ClosedLoop AI MCP Client
2
2
 
3
- A lightweight Model Context Protocol (MCP) server that provides AI clients with access to ClosedLoop customer feedback data and advanced search capabilities.
3
+ A lightweight Model Context Protocol (MCP) client that provides AI assistants with access to ClosedLoop AI customer feedback data and advanced search capabilities.
4
4
 
5
5
  ## Features
6
6
 
@@ -23,7 +23,7 @@ npm install -g @closedloop-ai/mcp-client
23
23
 
24
24
  Set the following environment variables:
25
25
 
26
- - `CLOSEDLOOP_API_KEY`: Your ClosedLoop API key (required)
26
+ - `CLOSEDLOOP_API_KEY`: Your ClosedLoop AI API key (required)
27
27
  - `CLOSEDLOOP_SERVER_URL`: Server URL (default: https://mcp.closedloop.sh)
28
28
 
29
29
  ## Usage with Claude
@@ -51,18 +51,124 @@ Add this configuration to your Claude Desktop app:
51
51
  Retrieve customer insights with optional filtering and pagination.
52
52
 
53
53
  **Parameters:**
54
- - `date_from` (optional): Start date (YYYY-MM-DD)
55
- - `date_to` (optional): End date (YYYY-MM-DD)
56
- - `page` (optional): Page number (default: 1)
57
- - `limit` (optional): Items per page (default: 20, max: 100)
54
+ | Parameter | Type | Required | Description |
55
+ |-----------|------|----------|-------------|
56
+ | `date_from` | string | No | Start date (YYYY-MM-DD) |
57
+ | `date_to` | string | No | End date (YYYY-MM-DD) |
58
+ | `page` | integer | No | Page number (default: 1) |
59
+ | `limit` | integer | No | Items per page (default: 20, max: 100) |
60
+
61
+ **Response Fields:**
62
+ | Field | Type | Description |
63
+ |-------|------|-------------|
64
+ | `id` | string | Unique insight identifier (UUID) |
65
+ | `signal_title` | string | Title/summary of the insight |
66
+ | `content` | string | Raw feedback content |
67
+ | `category` | string | Insight category (Bug, Feature Request, etc.) |
68
+ | `severity` | string | Severity level (critical, high, medium, low) |
69
+ | `status` | string | Processing status |
70
+ | `source_timestamp` | string | When feedback was received |
71
+ | `customer_name` | string | Customer who provided feedback |
72
+ | `reporter_name` | string | Person who reported the insight |
73
+ | `pain_point` | string | Identified customer pain point |
74
+ | `is_deal_blocker` | boolean | Whether this blocks deals |
75
+ | `relevance_score` | number | Business relevance score |
76
+ | `source_name` | string | Integration source name |
77
+ | `created_at` | string | When insight was created |
78
+
79
+ **Response Example:**
80
+ ```json
81
+ {
82
+ "insights": [
83
+ {
84
+ "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
85
+ "signal_title": "Mobile app crashes on startup",
86
+ "content": "The app keeps crashing whenever I try to open it...",
87
+ "category": "Bug",
88
+ "severity": "high",
89
+ "status": "processed",
90
+ "source_timestamp": "2024-01-15T10:30:00Z",
91
+ "customer_name": "Acme Corp",
92
+ "reporter_name": "John Smith",
93
+ "pain_point": "Cannot access mobile features",
94
+ "is_deal_blocker": true,
95
+ "relevance_score": 0.85,
96
+ "source_name": "Intercom",
97
+ "created_at": "2024-01-15T10:35:00Z"
98
+ }
99
+ ],
100
+ "pagination": {
101
+ "total_count": 142,
102
+ "page": 1,
103
+ "limit": 20,
104
+ "total_pages": 8
105
+ }
106
+ }
107
+ ```
108
+
109
+ ---
58
110
 
59
111
  ### get_insight_detail
60
112
  Get detailed information about a specific insight item.
61
113
 
62
114
  **Parameters:**
63
- - `insight_id` (required): UUID of the insight item
115
+ | Parameter | Type | Required | Description |
116
+ |-----------|------|----------|-------------|
117
+ | `insight_id` | string | Yes | UUID of the insight item |
64
118
 
65
- ### search_insights ⭐ NEW
119
+ **Response Fields:**
120
+ | Field | Type | Description |
121
+ |-------|------|-------------|
122
+ | `id` | string | Unique insight identifier (UUID) |
123
+ | `signal_title` | string | Title/summary of the insight |
124
+ | `content` | string | Raw feedback content |
125
+ | `category` | string | Insight category |
126
+ | `severity` | string | Severity level |
127
+ | `status` | string | Processing status |
128
+ | `summary` | string | AI-generated summary |
129
+ | `outcome_categories` | array | Business impact categories |
130
+ | `customer_name` | string | Customer who provided feedback |
131
+ | `customer_email` | string | Customer email address |
132
+ | `reporter_name` | string | Person who reported the insight |
133
+ | `source_name` | string | Integration source name |
134
+ | `pain_point` | string | Identified customer pain point |
135
+ | `workaround` | string | Customer's current workaround |
136
+ | `use_case` | string | Use case description |
137
+ | `feature_area` | string | Related feature area |
138
+ | `competitor_gap` | string | Competitive analysis notes |
139
+ | `willingness_to_pay` | string | Payment willingness info |
140
+ | `source_timestamp` | string | When feedback was received |
141
+ | `created_at` | string | When insight was created |
142
+
143
+ **Response Example:**
144
+ ```json
145
+ {
146
+ "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
147
+ "signal_title": "Mobile app crashes on startup",
148
+ "content": "The app keeps crashing whenever I try to open it on my iPhone...",
149
+ "category": "Bug",
150
+ "severity": "high",
151
+ "status": "processed",
152
+ "summary": "Critical mobile stability issue affecting iOS users on app launch",
153
+ "outcome_categories": ["Product Quality", "User Experience", "Retention Risk"],
154
+ "customer_name": "Acme Corp",
155
+ "customer_email": "john@acme.com",
156
+ "reporter_name": "John Smith",
157
+ "source_name": "Intercom",
158
+ "pain_point": "Cannot access mobile features, forced to use desktop",
159
+ "workaround": "Using the web version on mobile browser",
160
+ "use_case": "Field sales team needs mobile access for client meetings",
161
+ "feature_area": "Mobile App",
162
+ "competitor_gap": "Competitor X has stable mobile app",
163
+ "willingness_to_pay": "Would pay extra for reliable mobile experience",
164
+ "source_timestamp": "2024-01-15T10:30:00Z",
165
+ "created_at": "2024-01-15T10:35:00Z"
166
+ }
167
+ ```
168
+
169
+ ---
170
+
171
+ ### search_insights
66
172
  Advanced full-text search across customer insights with relevance ranking and comprehensive filtering.
67
173
 
68
174
  **Key Features:**
@@ -74,15 +180,17 @@ Advanced full-text search across customer insights with relevance ranking and co
74
180
  - **Language agnostic** - works with any language
75
181
 
76
182
  **Parameters:**
77
- - `query` (required): Search query text
78
- - `fields` (optional): Specific fields to search in
79
- - `category` (optional): Filter by insight category
80
- - `severity` (optional): Filter by severity level
81
- - `date_from` (optional): Start date filter
82
- - `date_to` (optional): End date filter
83
- - `source` (optional): Filter by data source
84
- - `page` (optional): Page number (default: 1)
85
- - `limit` (optional): Items per page (default: 20, max: 100)
183
+ | Parameter | Type | Required | Description |
184
+ |-----------|------|----------|-------------|
185
+ | `query` | string | Yes | Search query text |
186
+ | `fields` | array | No | Specific fields to search in |
187
+ | `category` | string | No | Filter by insight category |
188
+ | `severity` | string | No | Filter by severity level |
189
+ | `date_from` | string | No | Start date filter (YYYY-MM-DD) |
190
+ | `date_to` | string | No | End date filter (YYYY-MM-DD) |
191
+ | `source` | string | No | Filter by data source |
192
+ | `page` | integer | No | Page number (default: 1) |
193
+ | `limit` | integer | No | Items per page (default: 20, max: 100) |
86
194
 
87
195
  **Searchable Fields:**
88
196
  - `signal_title` - Insight title
@@ -94,6 +202,53 @@ Advanced full-text search across customer insights with relevance ranking and co
94
202
  - `competitor_gap` - Competitive analysis
95
203
  - `willingness_to_pay` - Payment willingness info
96
204
 
205
+ **Response Fields:**
206
+ | Field | Type | Description |
207
+ |-------|------|-------------|
208
+ | `id` | string | Unique insight identifier (UUID) |
209
+ | `signal_title` | string | Title/summary of the insight |
210
+ | `content` | string | Raw feedback content |
211
+ | `category` | string | Insight category |
212
+ | `severity` | string | Severity level |
213
+ | `search_rank` | number | Search relevance score (higher = more relevant) |
214
+ | `summary` | string | AI-generated summary |
215
+ | `outcome_categories` | array | Business impact categories |
216
+ | `is_deal_blocker` | boolean | Whether this blocks deals |
217
+ | `relevance_score` | number | Business relevance score |
218
+ | `customer_name` | string | Customer who provided feedback |
219
+ | `source_name` | string | Integration source name |
220
+ | `source_timestamp` | string | When feedback was received |
221
+
222
+ **Response Example:**
223
+ ```json
224
+ {
225
+ "insights": [
226
+ {
227
+ "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
228
+ "signal_title": "Mobile app crashes on startup",
229
+ "content": "The app keeps crashing whenever I try to open it...",
230
+ "category": "Bug",
231
+ "severity": "high",
232
+ "search_rank": 0.92,
233
+ "summary": "Critical mobile stability issue affecting iOS users",
234
+ "outcome_categories": ["Product Quality", "User Experience"],
235
+ "is_deal_blocker": true,
236
+ "relevance_score": 0.85,
237
+ "customer_name": "Acme Corp",
238
+ "source_name": "Intercom",
239
+ "source_timestamp": "2024-01-15T10:30:00Z"
240
+ }
241
+ ],
242
+ "pagination": {
243
+ "total_count": 23,
244
+ "page": 1,
245
+ "limit": 20,
246
+ "total_pages": 2
247
+ },
248
+ "query": "mobile crash"
249
+ }
250
+ ```
251
+
97
252
  ## Example Usage
98
253
 
99
254
  Once configured, you can ask Claude questions like:
package/index.js CHANGED
@@ -18,7 +18,7 @@ if (!CLOSEDLOOP_API_KEY) {
18
18
  const server = new Server(
19
19
  {
20
20
  name: 'closedloop-mcp-server',
21
- version: '1.1.0',
21
+ version: '1.1.2',
22
22
  description: 'Provides access to ClosedLoop AI product feedback data and insights with advanced search capabilities.',
23
23
  },
24
24
  {
@@ -178,7 +178,16 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
178
178
  if (!args.query) {
179
179
  throw new Error('query is required');
180
180
  }
181
- response = await axios.post(`${CLOSEDLOOP_SERVER_URL}/search`, args, {
181
+ // Use MCP protocol for search_insights
182
+ response = await axios.post(CLOSEDLOOP_SERVER_URL, {
183
+ jsonrpc: '2.0',
184
+ id: 1,
185
+ method: 'tools/call',
186
+ params: {
187
+ name: 'search_insights',
188
+ arguments: args
189
+ }
190
+ }, {
182
191
  headers
183
192
  });
184
193
  break;
@@ -187,11 +196,17 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
187
196
  throw new Error(`Unknown tool: ${name}`);
188
197
  }
189
198
 
199
+ // Handle MCP protocol response for search_insights
200
+ let responseData = response.data;
201
+ if (name === 'search_insights' && responseData.result) {
202
+ responseData = responseData.result;
203
+ }
204
+
190
205
  return {
191
206
  content: [
192
207
  {
193
208
  type: 'text',
194
- text: JSON.stringify(response.data, null, 2)
209
+ text: JSON.stringify(responseData, null, 2)
195
210
  }
196
211
  ]
197
212
  };
@@ -213,4 +228,4 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
213
228
  const transport = new StdioServerTransport();
214
229
  server.connect(transport);
215
230
 
216
- console.error('ClosedLoop MCP Server started');
231
+ console.error('ClosedLoop AI MCP Client started');
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@closedloop-ai/mcp-client",
3
- "version": "1.1.1",
4
- "description": "ClosedLoop MCP Server for AI client integration with advanced search capabilities",
3
+ "version": "1.2.5",
4
+ "description": "ClosedLoop AI MCP Client for AI assistant integration with advanced search capabilities",
5
5
  "main": "index.js",
6
6
  "bin": {
7
7
  "closedloop-mcp": "./index.js"
8
8
  },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/closed-loop-ai/mcp-client.git"
12
+ },
9
13
  "scripts": {
10
14
  "start": "node index.js"
11
15
  },
@@ -25,6 +29,6 @@
25
29
  "search",
26
30
  "full-text-search"
27
31
  ],
28
- "author": "ClosedLoop",
32
+ "author": "ClosedLoop AI",
29
33
  "license": "MIT"
30
34
  }