call-me-cloud-mcp 1.0.0

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Rivers Cornelson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # call-me-cloud-mcp
2
+
3
+ MCP (Model Context Protocol) client that enables Claude to make phone calls via [Call-Me Cloud](https://github.com/riverscornelson/call-me-cloud).
4
+
5
+ ## What is this?
6
+
7
+ This package lets Claude Code call you on the phone. It connects to a Call-Me Cloud server (which you deploy) and provides MCP tools for initiating and managing voice calls.
8
+
9
+ ## Installation
10
+
11
+ Used automatically via npx in Claude Code configurations. Add to your MCP settings:
12
+
13
+ ```json
14
+ {
15
+ "mcpServers": {
16
+ "call-me-cloud": {
17
+ "command": "npx",
18
+ "args": ["-y", "call-me-cloud-mcp"],
19
+ "env": {
20
+ "CALLME_CLOUD_URL": "https://your-server.railway.app",
21
+ "CALLME_API_KEY": "your-api-key"
22
+ }
23
+ }
24
+ }
25
+ }
26
+ ```
27
+
28
+ ## Environment Variables
29
+
30
+ | Variable | Required | Description |
31
+ |----------|----------|-------------|
32
+ | `CALLME_CLOUD_URL` | Yes | Your Call-Me Cloud server URL |
33
+ | `CALLME_API_KEY` | Yes | API key for authentication |
34
+
35
+ ## Available Tools
36
+
37
+ ### `initiate_call`
38
+ Start a phone call with the user.
39
+
40
+ ```
41
+ initiate_call({ message: "Hey, I finished the refactor. Want me to walk through it?" })
42
+ ```
43
+
44
+ Returns: `{ callId, response }` - The call ID and the user's spoken response.
45
+
46
+ ### `continue_call`
47
+ Send a follow-up message and wait for response.
48
+
49
+ ```
50
+ continue_call({ call_id: "call-1", message: "Should I also update the tests?" })
51
+ ```
52
+
53
+ ### `speak_to_user`
54
+ Speak a message without waiting for a response.
55
+
56
+ ```
57
+ speak_to_user({ call_id: "call-1", message: "Give me a moment to check that..." })
58
+ ```
59
+
60
+ ### `end_call`
61
+ End the call with a closing message.
62
+
63
+ ```
64
+ end_call({ call_id: "call-1", message: "Sounds good, I'll get started. Talk soon!" })
65
+ ```
66
+
67
+ ## Requirements
68
+
69
+ - Node.js 18+
70
+ - A deployed [Call-Me Cloud](https://github.com/riverscornelson/call-me-cloud) server
71
+ - Twilio or Telnyx account for phone calls
72
+ - OpenAI API key (for speech-to-text and text-to-speech)
73
+
74
+ ## How It Works
75
+
76
+ ```
77
+ Claude Code --> This MCP Client --> Your Cloud Server --> Phone Call
78
+ (stdio) (REST API) (Twilio/Telnyx) (to you)
79
+ ```
80
+
81
+ 1. Claude decides to call you using one of the MCP tools
82
+ 2. This client forwards the request to your cloud server
83
+ 3. The server initiates a phone call via Twilio/Telnyx
84
+ 4. Audio is processed through OpenAI's real-time API
85
+ 5. Your response is transcribed and returned to Claude
86
+
87
+ ## Server Setup
88
+
89
+ See the main [Call-Me Cloud repository](https://github.com/riverscornelson/call-me-cloud) for server deployment instructions.
90
+
91
+ ## License
92
+
93
+ MIT
package/bin/run.js ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawn } from 'node:child_process';
4
+ import { dirname, join } from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ const indexPath = join(__dirname, '..', 'index.ts');
9
+
10
+ // Spawn node with tsx loader using --import flag (Node 20.6+/18.19+ compatible)
11
+ const child = spawn(
12
+ process.execPath,
13
+ ['--import', 'tsx', indexPath],
14
+ {
15
+ stdio: 'inherit',
16
+ env: process.env,
17
+ }
18
+ );
19
+
20
+ child.on('exit', (code) => {
21
+ process.exit(code ?? 0);
22
+ });
package/index.ts ADDED
@@ -0,0 +1,188 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * CallMe MCP Client
5
+ *
6
+ * A local MCP server that forwards tool calls to the cloud-hosted call-me server.
7
+ * This allows Claude Code to use call-me even when behind a VPN that blocks tunneling.
8
+ */
9
+
10
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
11
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
12
+ import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
13
+
14
+ const CLOUD_URL = process.env.CALLME_CLOUD_URL;
15
+ const API_KEY = process.env.CALLME_API_KEY;
16
+
17
+ if (!CLOUD_URL) {
18
+ console.error('Error: CALLME_CLOUD_URL is required');
19
+ console.error('Set it to your Railway/Render deployment URL');
20
+ process.exit(1);
21
+ }
22
+
23
+ if (!API_KEY) {
24
+ console.error('Error: CALLME_API_KEY is required');
25
+ process.exit(1);
26
+ }
27
+
28
+ async function apiCall(path: string, body: unknown): Promise<unknown> {
29
+ const response = await fetch(`${CLOUD_URL}${path}`, {
30
+ method: 'POST',
31
+ headers: {
32
+ 'Content-Type': 'application/json',
33
+ 'Authorization': `Bearer ${API_KEY}`,
34
+ },
35
+ body: JSON.stringify(body),
36
+ });
37
+
38
+ if (!response.ok) {
39
+ const error = await response.json().catch(() => ({ error: response.statusText }));
40
+ throw new Error(error.error || `API error: ${response.status}`);
41
+ }
42
+
43
+ return response.json();
44
+ }
45
+
46
+ async function main() {
47
+ // Verify cloud server is reachable (uses unauthenticated /health endpoint)
48
+ try {
49
+ const healthResponse = await fetch(`${CLOUD_URL}/health`);
50
+ if (!healthResponse.ok) {
51
+ throw new Error(`Health check failed: ${healthResponse.status}`);
52
+ }
53
+ const health = await healthResponse.json() as { status: string; publicUrl?: string };
54
+ console.error(`Connected to cloud server: ${health.publicUrl || CLOUD_URL}`);
55
+ } catch (error) {
56
+ console.error('Warning: Could not reach cloud server:', error instanceof Error ? error.message : error);
57
+ console.error('Calls may fail until the server is available.');
58
+ }
59
+
60
+ const mcpServer = new Server(
61
+ { name: 'callme-client', version: '1.0.0' },
62
+ { capabilities: { tools: {} } }
63
+ );
64
+
65
+ // List available tools (same as original call-me)
66
+ mcpServer.setRequestHandler(ListToolsRequestSchema, async () => {
67
+ return {
68
+ tools: [
69
+ {
70
+ name: 'initiate_call',
71
+ description: 'Start a phone call with the user. Use when you need voice input, want to report completed work, or need real-time discussion.',
72
+ inputSchema: {
73
+ type: 'object',
74
+ properties: {
75
+ message: {
76
+ type: 'string',
77
+ description: 'What you want to say to the user. Be natural and conversational.',
78
+ },
79
+ },
80
+ required: ['message'],
81
+ },
82
+ },
83
+ {
84
+ name: 'continue_call',
85
+ description: 'Continue an active call with a follow-up message.',
86
+ inputSchema: {
87
+ type: 'object',
88
+ properties: {
89
+ call_id: { type: 'string', description: 'The call ID from initiate_call' },
90
+ message: { type: 'string', description: 'Your follow-up message' },
91
+ },
92
+ required: ['call_id', 'message'],
93
+ },
94
+ },
95
+ {
96
+ name: 'speak_to_user',
97
+ description: 'Speak a message on an active call without waiting for a response.',
98
+ inputSchema: {
99
+ type: 'object',
100
+ properties: {
101
+ call_id: { type: 'string', description: 'The call ID from initiate_call' },
102
+ message: { type: 'string', description: 'What to say to the user' },
103
+ },
104
+ required: ['call_id', 'message'],
105
+ },
106
+ },
107
+ {
108
+ name: 'end_call',
109
+ description: 'End an active call with a closing message.',
110
+ inputSchema: {
111
+ type: 'object',
112
+ properties: {
113
+ call_id: { type: 'string', description: 'The call ID from initiate_call' },
114
+ message: { type: 'string', description: 'Your closing message (say goodbye!)' },
115
+ },
116
+ required: ['call_id', 'message'],
117
+ },
118
+ },
119
+ ],
120
+ };
121
+ });
122
+
123
+ // Handle tool calls by forwarding to cloud server
124
+ mcpServer.setRequestHandler(CallToolRequestSchema, async (request) => {
125
+ try {
126
+ if (request.params.name === 'initiate_call') {
127
+ const { message } = request.params.arguments as { message: string };
128
+ const result = await apiCall('/api/call', { message }) as { callId: string; response: string };
129
+
130
+ return {
131
+ content: [{
132
+ type: 'text',
133
+ text: `Call initiated successfully.\n\nCall ID: ${result.callId}\n\nUser's response:\n${result.response}\n\nUse continue_call to ask follow-ups or end_call to hang up.`,
134
+ }],
135
+ };
136
+ }
137
+
138
+ if (request.params.name === 'continue_call') {
139
+ const { call_id, message } = request.params.arguments as { call_id: string; message: string };
140
+ const result = await apiCall(`/api/call/${call_id}/continue`, { message }) as { response: string };
141
+
142
+ return {
143
+ content: [{ type: 'text', text: `User's response:\n${result.response}` }],
144
+ };
145
+ }
146
+
147
+ if (request.params.name === 'speak_to_user') {
148
+ const { call_id, message } = request.params.arguments as { call_id: string; message: string };
149
+ await apiCall(`/api/call/${call_id}/speak`, { message });
150
+
151
+ return {
152
+ content: [{ type: 'text', text: `Message spoken: "${message}"` }],
153
+ };
154
+ }
155
+
156
+ if (request.params.name === 'end_call') {
157
+ const { call_id, message } = request.params.arguments as { call_id: string; message: string };
158
+ const result = await apiCall(`/api/call/${call_id}/end`, { message }) as { durationSeconds: number };
159
+
160
+ return {
161
+ content: [{ type: 'text', text: `Call ended. Duration: ${result.durationSeconds}s` }],
162
+ };
163
+ }
164
+
165
+ throw new Error(`Unknown tool: ${request.params.name}`);
166
+ } catch (error) {
167
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';
168
+ return {
169
+ content: [{ type: 'text', text: `Error: ${errorMessage}` }],
170
+ isError: true,
171
+ };
172
+ }
173
+ });
174
+
175
+ // Connect via stdio
176
+ const transport = new StdioServerTransport();
177
+ await mcpServer.connect(transport);
178
+
179
+ console.error('');
180
+ console.error('CallMe MCP Client ready');
181
+ console.error(`Cloud server: ${CLOUD_URL}`);
182
+ console.error('');
183
+ }
184
+
185
+ main().catch((error) => {
186
+ console.error('Fatal error:', error);
187
+ process.exit(1);
188
+ });
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "call-me-cloud-mcp",
3
+ "version": "1.0.0",
4
+ "description": "MCP client for Call-Me Cloud - lets Claude call you via phone",
5
+ "type": "module",
6
+ "bin": {
7
+ "call-me-cloud-mcp": "./bin/run.js"
8
+ },
9
+ "files": [
10
+ "bin",
11
+ "index.ts",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
15
+ "scripts": {
16
+ "start": "node --import tsx index.ts",
17
+ "test": "node --import tsx --test test/*.test.ts"
18
+ },
19
+ "dependencies": {
20
+ "@modelcontextprotocol/sdk": "^1.0.4",
21
+ "tsx": "^4.19.0"
22
+ },
23
+ "keywords": [
24
+ "mcp",
25
+ "model-context-protocol",
26
+ "claude",
27
+ "anthropic",
28
+ "ai",
29
+ "llm",
30
+ "phone",
31
+ "call",
32
+ "voice",
33
+ "telephony"
34
+ ],
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/riverscornelson/call-me-cloud.git"
38
+ },
39
+ "homepage": "https://github.com/riverscornelson/call-me-cloud#readme",
40
+ "bugs": {
41
+ "url": "https://github.com/riverscornelson/call-me-cloud/issues"
42
+ },
43
+ "engines": {
44
+ "node": ">=18.0.0"
45
+ },
46
+ "author": "Rivers Cornelson",
47
+ "license": "MIT"
48
+ }