@carbonvoice/cv-mcp-server 1.0.11 → 1.0.13
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/generated/carbon-voice-api/CarbonVoiceSimplifiedAPI.zod.js +3 -5
- package/dist/generated/carbon-voice-api.js +3 -5
- package/dist/interfaces/conversation.interface.js +2 -0
- package/dist/schemas/conversation.js +17 -0
- package/dist/schemas/index.js +1 -0
- package/dist/server.js +57 -2
- package/package.json +1 -1
- package/readme.md +198 -0
|
@@ -599,13 +599,11 @@ exports.getMessageByIdResponse = zod_1.z.object({
|
|
|
599
599
|
})).optional()
|
|
600
600
|
});
|
|
601
601
|
/**
|
|
602
|
-
* By default return messages
|
|
603
|
-
|
|
604
|
-
The **maximum** allowed range between dates is **31 days**.
|
|
602
|
+
* By default return most recent messages. The **maximum** allowed range between dates is **31 days**.
|
|
605
603
|
* @summary List Messages
|
|
606
604
|
*/
|
|
607
605
|
exports.listMessagesQueryPageDefault = 1;
|
|
608
|
-
exports.listMessagesQuerySizeDefault =
|
|
606
|
+
exports.listMessagesQuerySizeDefault = 20;
|
|
609
607
|
exports.listMessagesQuerySizeMax = 50;
|
|
610
608
|
exports.listMessagesQuerySortDirectionDefault = "DESC";
|
|
611
609
|
exports.listMessagesQueryParams = zod_1.z.object({
|
|
@@ -622,7 +620,7 @@ exports.listMessagesQueryParams = zod_1.z.object({
|
|
|
622
620
|
"user_ids": zod_1.z.array(zod_1.z.string()).optional().describe('User IDs (optional). List of user IDs to filter messages by. If not provided, all users will be included.')
|
|
623
621
|
});
|
|
624
622
|
exports.listMessagesResponsePageDefault = 1;
|
|
625
|
-
exports.listMessagesResponseSizeDefault =
|
|
623
|
+
exports.listMessagesResponseSizeDefault = 20;
|
|
626
624
|
exports.listMessagesResponseSizeMax = 50;
|
|
627
625
|
exports.listMessagesResponseSortDirectionDefault = "DESC";
|
|
628
626
|
exports.listMessagesResponseResultsItemLanguageDefault = "english";
|
|
@@ -99,11 +99,9 @@ const getCarbonVoiceSimplifiedAPI = () => {
|
|
|
99
99
|
});
|
|
100
100
|
};
|
|
101
101
|
/**
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
* @summary List Messages
|
|
106
|
-
*/
|
|
102
|
+
* By default return most recent messages. The **maximum** allowed range between dates is **31 days**.
|
|
103
|
+
* @summary List Messages
|
|
104
|
+
*/
|
|
107
105
|
const listMessages = (params) => {
|
|
108
106
|
return (0, axios_instance_1.mutator)({
|
|
109
107
|
url: `/simplified/messages`,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.catchUpConversationParams = exports.summarizeConversationParams = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.summarizeConversationParams = zod_1.z.object({
|
|
6
|
+
conversation_id: zod_1.z.string().nonempty(),
|
|
7
|
+
prompt_id: zod_1.z.string().nonempty(),
|
|
8
|
+
message_ids: zod_1.z.array(zod_1.z.string()).optional(),
|
|
9
|
+
language: zod_1.z.string().optional(),
|
|
10
|
+
start_date: zod_1.z.string().datetime().optional(),
|
|
11
|
+
end_date: zod_1.z.string().datetime().optional(),
|
|
12
|
+
limit: zod_1.z.number().optional().default(50),
|
|
13
|
+
});
|
|
14
|
+
exports.catchUpConversationParams = zod_1.z.object({
|
|
15
|
+
...exports.summarizeConversationParams.shape,
|
|
16
|
+
include_only_unread_messages: zod_1.z.boolean().optional().default(true),
|
|
17
|
+
});
|
package/dist/schemas/index.js
CHANGED
package/dist/server.js
CHANGED
|
@@ -4,6 +4,7 @@ const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
|
4
4
|
const constants_1 = require("./constants");
|
|
5
5
|
const generated_1 = require("./generated");
|
|
6
6
|
const CarbonVoiceSimplifiedAPI_zod_1 = require("./generated/carbon-voice-api/CarbonVoiceSimplifiedAPI.zod");
|
|
7
|
+
const schemas_1 = require("./schemas");
|
|
7
8
|
const utils_1 = require("./utils");
|
|
8
9
|
// Create server instance
|
|
9
10
|
const server = new mcp_js_1.McpServer({
|
|
@@ -20,7 +21,7 @@ const api = (0, generated_1.getCarbonVoiceSimplifiedAPI)();
|
|
|
20
21
|
*********************/
|
|
21
22
|
// Messages
|
|
22
23
|
server.registerTool('list_messages', {
|
|
23
|
-
description: 'List Messages. By default returns
|
|
24
|
+
description: 'List Messages. By default returns latest 20 messages. The maximum allowed range between dates is 31 days.',
|
|
24
25
|
inputSchema: CarbonVoiceSimplifiedAPI_zod_1.listMessagesQueryParams.shape,
|
|
25
26
|
}, async (params) => {
|
|
26
27
|
try {
|
|
@@ -58,7 +59,8 @@ server.registerTool('get_recent_messages', {
|
|
|
58
59
|
}
|
|
59
60
|
});
|
|
60
61
|
server.registerTool('create_conversation_message', {
|
|
61
|
-
description: '
|
|
62
|
+
description: 'Sends a message to an existing conversation or any type with a conversation_id. ' +
|
|
63
|
+
'To reply as a thread, included a message_id for "parent_id". You must provide a transcript or attachment.',
|
|
62
64
|
inputSchema: CarbonVoiceSimplifiedAPI_zod_1.createConversationMessageParams.merge(CarbonVoiceSimplifiedAPI_zod_1.createConversationMessageBody).shape,
|
|
63
65
|
}, async (args) => {
|
|
64
66
|
try {
|
|
@@ -182,6 +184,59 @@ server.registerTool('get_conversation_users', {
|
|
|
182
184
|
return (0, utils_1.formatToMCPToolResponse)(error);
|
|
183
185
|
}
|
|
184
186
|
});
|
|
187
|
+
server.registerTool('summarize_conversation', {
|
|
188
|
+
description: 'Summarize a conversation.',
|
|
189
|
+
inputSchema: schemas_1.summarizeConversationParams.shape,
|
|
190
|
+
}, async (args) => {
|
|
191
|
+
var _a;
|
|
192
|
+
try {
|
|
193
|
+
let message_ids = args.message_ids || [];
|
|
194
|
+
// If no message ids are provided, get couple of messages from the conversation
|
|
195
|
+
if (!args.message_ids) {
|
|
196
|
+
const messages = await api.listMessages(args);
|
|
197
|
+
message_ids = ((_a = messages.results) === null || _a === void 0 ? void 0 : _a.map((message) => message.id)) || [];
|
|
198
|
+
}
|
|
199
|
+
const aiResponse = await api.aIResponseControllerCreateResponse({
|
|
200
|
+
prompt_id: args.prompt_id,
|
|
201
|
+
message_ids: message_ids,
|
|
202
|
+
channel_id: args.conversation_id,
|
|
203
|
+
language: args.language,
|
|
204
|
+
});
|
|
205
|
+
return (0, utils_1.formatToMCPToolResponse)(aiResponse);
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
utils_1.logger.error('Error summarizing conversation:', { error });
|
|
209
|
+
return (0, utils_1.formatToMCPToolResponse)(error);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
// TODO: First we need to implement List messages filtered by unread messages
|
|
213
|
+
// server.registerTool(
|
|
214
|
+
// 'catch_up_conversation',
|
|
215
|
+
// {
|
|
216
|
+
// description: 'Catch up a conversation.',
|
|
217
|
+
// inputSchema: catchUpConversationParams.shape,
|
|
218
|
+
// },
|
|
219
|
+
// async (args: CatchUpConversationParams): Promise<McpToolResponse> => {
|
|
220
|
+
// try {
|
|
221
|
+
// let message_ids: string[] = args.message_ids || [];
|
|
222
|
+
// // If no message ids are provided, get couple of messages from the conversation
|
|
223
|
+
// if (!args.message_ids?.length) {
|
|
224
|
+
// const messages = await api.listMessages(args);
|
|
225
|
+
// message_ids = messages.results?.map((message) => message.id) || [];
|
|
226
|
+
// }
|
|
227
|
+
// const aiResponse = await api.aIResponseControllerCreateResponse({
|
|
228
|
+
// prompt_id: args.prompt_id,
|
|
229
|
+
// message_ids: message_ids,
|
|
230
|
+
// channel_id: args.conversation_id,
|
|
231
|
+
// language: args.language,
|
|
232
|
+
// });
|
|
233
|
+
// return formatToMCPToolResponse(aiResponse);
|
|
234
|
+
// } catch (error) {
|
|
235
|
+
// logger.error('Error catching up conversation:', { error });
|
|
236
|
+
// return formatToMCPToolResponse(error);
|
|
237
|
+
// }
|
|
238
|
+
// },
|
|
239
|
+
// );
|
|
185
240
|
// Folders
|
|
186
241
|
server.registerTool('get_workspace_folders_and_message_counts', {
|
|
187
242
|
description: 'Returns, for each workspace, the total number of folders and messages, as well as a breakdown of folders, ' +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbonvoice/cv-mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "Server implementation for integrating with Carbon Voice's API, providing tools and endpoints for voice messaging, conversations, and workspace management through MCP (Model Context Protocol)",
|
|
5
5
|
"author": "Carbon Voice",
|
|
6
6
|
"license": "ISC",
|
package/readme.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# Carbon Voice MCP Server
|
|
2
|
+
|
|
3
|
+
A Model Context Protocol (MCP) server implementation for integrating with Carbon Voice's API, providing AI assistants with comprehensive tools for voice messaging, conversations, and workspace management.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Message Management**: Create, list, and retrieve voice messages, conversation messages, and direct messages
|
|
8
|
+
- **User Operations**: Search and retrieve user information
|
|
9
|
+
- **Conversation Management**: Access and manage conversations and their participants
|
|
10
|
+
- **Folder Operations**: Create, organize, move, and manage folders and their contents
|
|
11
|
+
- **Workspace Administration**: Get workspace information
|
|
12
|
+
- **AI Actions**: Run AI prompts and retrieve AI-generated responses
|
|
13
|
+
- **Attachment Support**: Add link attachments to messages
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
### API Key Required
|
|
18
|
+
|
|
19
|
+
To use this MCP server, you need a Carbon Voice API key. Please contact the Carbon Voice development team to request your API key:
|
|
20
|
+
|
|
21
|
+
**📧 Contact**: devsupport@phononx.com
|
|
22
|
+
|
|
23
|
+
## Configuration
|
|
24
|
+
|
|
25
|
+
### For Cursor
|
|
26
|
+
|
|
27
|
+
1. Open Cursor
|
|
28
|
+
2. Go to **Cursor Settings** > **Features** > **Model Context Protocol**
|
|
29
|
+
3. Add a new MCP server configuration:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"mcpServers": {
|
|
34
|
+
"Carbon-Voice": {
|
|
35
|
+
"command": "npx",
|
|
36
|
+
"env": {
|
|
37
|
+
"CARBON_VOICE_API_KEY": "your_api_key_here"
|
|
38
|
+
},
|
|
39
|
+
"args": ["-y", "@carbonvoice/cv-mcp-server"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
4. Replace `"your_api_key_here"` with your actual Carbon Voice API key
|
|
46
|
+
5. Save and restart Cursor
|
|
47
|
+
|
|
48
|
+
### For Claude Desktop
|
|
49
|
+
|
|
50
|
+
1. Open your Claude Desktop configuration file:
|
|
51
|
+
|
|
52
|
+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
53
|
+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
54
|
+
|
|
55
|
+
2. Add the Carbon Voice MCP server configuration:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"mcpServers": {
|
|
60
|
+
"Carbon-Voice": {
|
|
61
|
+
"command": "npx",
|
|
62
|
+
"env": {
|
|
63
|
+
"CARBON_VOICE_API_KEY": "your_api_key_here"
|
|
64
|
+
},
|
|
65
|
+
"args": ["-y", "@carbonvoice/cv-mcp-server"]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
3. Replace `"your_api_key_here"` with your actual Carbon Voice API key
|
|
72
|
+
4. Save the file and restart Claude Desktop
|
|
73
|
+
|
|
74
|
+
## Available Tools
|
|
75
|
+
|
|
76
|
+
### Messages
|
|
77
|
+
|
|
78
|
+
- **`list_messages`** - List messages with date filtering (max 31-day range)
|
|
79
|
+
- **`get_message`** - Retrieve a specific message by ID
|
|
80
|
+
- **`get_recent_messages`** - Get the 10 most recent messages with full context
|
|
81
|
+
- **`create_conversation_message`** - Send a message to a conversation
|
|
82
|
+
- **`create_direct_message`** - Send direct messages to users or groups
|
|
83
|
+
- **`create_voicememo_message`** - Create voice memo messages
|
|
84
|
+
- **`add_attachments_to_message`** - Add link attachments to existing messages
|
|
85
|
+
|
|
86
|
+
### Users
|
|
87
|
+
|
|
88
|
+
- **`get_user`** - Retrieve user information by ID
|
|
89
|
+
- **`search_user`** - Find a user by phone number or email
|
|
90
|
+
- **`search_users`** - Search multiple users by various identifiers
|
|
91
|
+
|
|
92
|
+
### Conversations
|
|
93
|
+
|
|
94
|
+
- **`list_conversations`** - Get all conversations from the last 6 months
|
|
95
|
+
- **`get_conversation`** - Retrieve conversation details by ID
|
|
96
|
+
- **`get_conversation_users`** - Get all users in a conversation
|
|
97
|
+
|
|
98
|
+
### Folders
|
|
99
|
+
|
|
100
|
+
- **`get_workspace_folders_and_message_counts`** - Get folder and message statistics
|
|
101
|
+
- **`get_root_folders`** - List root folders for a workspace
|
|
102
|
+
- **`create_folder`** - Create new folders
|
|
103
|
+
- **`get_folder`** - Retrieve folder information
|
|
104
|
+
- **`get_folder_with_messages`** - Get folder with its messages
|
|
105
|
+
- **`update_folder_name`** - Rename folders
|
|
106
|
+
- **`delete_folder`** - Delete folders (⚠️ destructive operation)
|
|
107
|
+
- **`move_folder`** - Move folders between locations
|
|
108
|
+
- **`move_message_to_folder`** - Organize messages into folders
|
|
109
|
+
|
|
110
|
+
### Workspace
|
|
111
|
+
|
|
112
|
+
- **`get_workspaces_basic_info`** - Get basic workspace information
|
|
113
|
+
|
|
114
|
+
### AI Actions
|
|
115
|
+
|
|
116
|
+
- **`list_ai_actions`** - List available AI prompts/actions
|
|
117
|
+
- **`run_ai_action`** - Execute AI actions on messages
|
|
118
|
+
- **`run_ai_action_for_shared_link`** - Run AI actions on shared content
|
|
119
|
+
- **`get_ai_action_responses`** - Retrieve AI-generated responses
|
|
120
|
+
|
|
121
|
+
## Usage Examples
|
|
122
|
+
|
|
123
|
+
### Getting Started
|
|
124
|
+
|
|
125
|
+
After configuration, you can interact with Carbon Voice through your AI assistant. Here are some example requests:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
"Show me my recent messages"
|
|
129
|
+
"Create a voice memo about today's meeting"
|
|
130
|
+
"Search for user john@example.com"
|
|
131
|
+
"Show me my workspace information"
|
|
132
|
+
"List my conversations from this week"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Working with Folders
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
"Create a folder called 'Project Updates'"
|
|
139
|
+
"Move message ID 12345 to the Project Updates folder"
|
|
140
|
+
"Show me all messages in the Marketing folder"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### AI Actions
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
"Run a summary AI action on message ID 67890"
|
|
147
|
+
"List all available AI prompts"
|
|
148
|
+
"Get AI responses for conversation ID 123"
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Error Handling
|
|
152
|
+
|
|
153
|
+
The server includes comprehensive error handling and logging. Errors are returned in a structured format that includes:
|
|
154
|
+
|
|
155
|
+
- Error messages
|
|
156
|
+
- HTTP status codes
|
|
157
|
+
- Request context
|
|
158
|
+
- Debugging information
|
|
159
|
+
|
|
160
|
+
## Development
|
|
161
|
+
|
|
162
|
+
### Building from Source
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
npm run build
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Running in Development Mode
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
npm run auto:build # Watch mode with auto-rebuild
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Linting
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
npm run lint:fix
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Testing with MCP Inspector
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
npm run mcp:inspector
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Support
|
|
187
|
+
|
|
188
|
+
- **Issues**: [GitHub Issues](https://github.com/PhononX/cv-mcp-server/issues)
|
|
189
|
+
- **API Key Requests**: devsupport@phononx.com
|
|
190
|
+
- **Website**: [https://getcarbon.app](https://getcarbon.app)
|
|
191
|
+
|
|
192
|
+
## License
|
|
193
|
+
|
|
194
|
+
ISC License - See LICENSE file for details.
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
**Note**: This MCP server requires a valid Carbon Voice API key to function. Please ensure you have obtained your API key from the Carbon Voice team before attempting to use the server.
|