@abhaybabbar/retellai-mcp-server 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/.env.sample ADDED
@@ -0,0 +1 @@
1
+ RETELL_API_KEY=***
package/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # RetellAI MCP Server
2
+
3
+ This is a Model Context Protocol (MCP) server implementation for RetellAI, allowing AI assistants to interact with RetellAI's voice services.
4
+
5
+ ## Features
6
+
7
+ The RetellAI MCP server provides tools for:
8
+
9
+ - **Call Management**: Create and manage phone calls and web calls
10
+ - **Agent Management**: Create and manage voice agents with different LLM configurations
11
+ - **Phone Number Management**: Provision and configure phone numbers
12
+ - **Voice Management**: Access and use different voice options
13
+
14
+ ## Setup
15
+
16
+ 1. Install dependencies:
17
+
18
+ ```bash
19
+ npm i
20
+ ```
21
+
22
+ 2. Create a `.env` file with your RetellAI API key:
23
+
24
+ ```
25
+ RETELL_API_KEY=your_api_key_here
26
+ ```
27
+
28
+ 3. Run the server:
29
+ ```bash
30
+ node src/retell/index.js
31
+ ```
32
+
33
+ ## Available Tools
34
+
35
+ ### Call Tools
36
+
37
+ - `list_calls`: Lists all Retell calls
38
+ - `create_phone_call`: Creates a new phone call
39
+ - `create_web_call`: Creates a new web call
40
+ - `get_call`: Gets details of a specific call
41
+ - `delete_call`: Deletes a specific call
42
+
43
+ ### Agent Tools
44
+
45
+ - `list_agents`: Lists all Retell agents
46
+ - `create_agent`: Creates a new Retell agent
47
+ - `get_agent`: Gets a Retell agent by ID
48
+ - `update_agent`: Updates an existing Retell agent
49
+ - `delete_agent`: Deletes a Retell agent
50
+ - `get_agent_versions`: Gets all versions of a Retell agent
51
+
52
+ ### Phone Number Tools
53
+
54
+ - `list_phone_numbers`: Lists all Retell phone numbers
55
+ - `create_phone_number`: Creates a new phone number
56
+ - `get_phone_number`: Gets details of a specific phone number
57
+ - `update_phone_number`: Updates a phone number
58
+ - `delete_phone_number`: Deletes a phone number
59
+
60
+ ### Voice Tools
61
+
62
+ - `list_voices`: Lists all available Retell voices
63
+ - `get_voice`: Gets details of a specific voice
64
+
65
+ ## License
66
+
67
+ MIT
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@abhaybabbar/retellai-mcp-server",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "build": "tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\"",
8
+ "prepare": "npm run build",
9
+ "watch": "tsc --watch",
10
+ "inspector": "npx @modelcontextprotocol/inspector build/index.js"
11
+ },
12
+ "keywords": [],
13
+ "author": "abhaybabbar",
14
+ "license": "ISC",
15
+ "description": "RetellAi MCP Server",
16
+ "dependencies": {
17
+ "@modelcontextprotocol/sdk": "^1.11.0",
18
+ "dotenv": "^16.5.0",
19
+ "retell-sdk": "^4.28.0"
20
+ },
21
+ "devDependencies": {},
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/abhaybabbar/retellai-mcp-server.git"
25
+ },
26
+ "bugs": {
27
+ "url": "https://github.com/abhaybabbar/retellai-mcp-server/issues"
28
+ },
29
+ "homepage": "https://github.com/abhaybabbar/retellai-mcp-server#readme"
30
+ }
package/src/client.ts ADDED
@@ -0,0 +1,10 @@
1
+ import Retell from "retell-sdk";
2
+
3
+ export const createRetellClient = (apiKey: string): Retell => {
4
+ if (!apiKey) {
5
+ throw new Error("No Retell API key available");
6
+ }
7
+ return new Retell({
8
+ apiKey,
9
+ });
10
+ };
package/src/index.ts ADDED
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
+ import { registerAllTools } from "./tools/index.js";
6
+ import { createRetellClient } from "./client.js";
7
+
8
+ import dotenv from "dotenv";
9
+ dotenv.config();
10
+
11
+ function createMcpServer() {
12
+ const retellApiKey = process.env.RETELL_API_KEY;
13
+ if (!retellApiKey) {
14
+ throw new Error("RETELL_API_KEY environment variable is required");
15
+ }
16
+
17
+ const retellClient = createRetellClient(retellApiKey);
18
+
19
+ const mcpServer = new McpServer({
20
+ name: "Retell MCP",
21
+ version: "0.1.0",
22
+ capabilities: [],
23
+ });
24
+
25
+ registerAllTools(mcpServer, retellClient);
26
+
27
+ return mcpServer;
28
+ }
29
+
30
+ async function main() {
31
+ try {
32
+ const mcpServer = createMcpServer();
33
+
34
+ const transport = new StdioServerTransport();
35
+ await mcpServer.connect(transport);
36
+
37
+ setupShutdownHandler(mcpServer);
38
+ } catch (err) {
39
+ console.error("Error starting MCP server:", err);
40
+ process.exit(1);
41
+ }
42
+ }
43
+
44
+ function setupShutdownHandler(mcpServer: McpServer) {
45
+ process.on("SIGINT", async () => {
46
+ try {
47
+ await mcpServer.close();
48
+ process.exit(0);
49
+ } catch (err) {
50
+ console.error("Error shutting down MCP server:", err);
51
+ process.exit(1);
52
+ }
53
+ });
54
+ }
55
+
56
+ main();