telnyx-mcp-server-fastmcp 0.1.3__tar.gz

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.
Files changed (53) hide show
  1. telnyx_mcp_server_fastmcp-0.1.3/.gitignore +160 -0
  2. telnyx_mcp_server_fastmcp-0.1.3/PKG-INFO +430 -0
  3. telnyx_mcp_server_fastmcp-0.1.3/README.md +402 -0
  4. telnyx_mcp_server_fastmcp-0.1.3/pyproject.toml +87 -0
  5. telnyx_mcp_server_fastmcp-0.1.3/requirements.txt +33 -0
  6. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/__init__.py +0 -0
  7. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/__main__.py +23 -0
  8. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/config.py +148 -0
  9. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/mcp.py +148 -0
  10. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/server.py +497 -0
  11. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/telnyx/__init__.py +1 -0
  12. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/telnyx/client.py +363 -0
  13. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/telnyx/services/__init__.py +0 -0
  14. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/telnyx/services/assistants.py +155 -0
  15. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/telnyx/services/call_control.py +217 -0
  16. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/telnyx/services/cloud_storage.py +289 -0
  17. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/telnyx/services/connections.py +92 -0
  18. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/telnyx/services/embeddings.py +52 -0
  19. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/telnyx/services/messaging.py +93 -0
  20. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/telnyx/services/messaging_profiles.py +196 -0
  21. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/telnyx/services/numbers.py +193 -0
  22. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/telnyx/services/secrets.py +74 -0
  23. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/tools/__init__.py +126 -0
  24. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/tools/assistants.py +313 -0
  25. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/tools/call_control.py +242 -0
  26. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/tools/cloud_storage.py +183 -0
  27. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/tools/connections.py +78 -0
  28. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/tools/embeddings.py +80 -0
  29. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/tools/messaging.py +57 -0
  30. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/tools/messaging_profiles.py +123 -0
  31. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/tools/phone_numbers.py +161 -0
  32. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/tools/secrets.py +75 -0
  33. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/tools/sms_conversations.py +455 -0
  34. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/tools/webhooks.py +111 -0
  35. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/utils/__init__.py +0 -0
  36. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/utils/error_handler.py +30 -0
  37. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/utils/logger.py +32 -0
  38. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/utils/service.py +33 -0
  39. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/webhook/__init__.py +25 -0
  40. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/webhook/handler.py +596 -0
  41. telnyx_mcp_server_fastmcp-0.1.3/src/telnyx_mcp_server/webhook/server.py +369 -0
  42. telnyx_mcp_server_fastmcp-0.1.3/tests/telnyx/__init__.py +1 -0
  43. telnyx_mcp_server_fastmcp-0.1.3/tests/telnyx/services/__init__.py +1 -0
  44. telnyx_mcp_server_fastmcp-0.1.3/tests/telnyx/services/test_assistants.py +95 -0
  45. telnyx_mcp_server_fastmcp-0.1.3/tests/telnyx/services/test_embeddings.py +68 -0
  46. telnyx_mcp_server_fastmcp-0.1.3/tests/telnyx/services/test_secrets.py +86 -0
  47. telnyx_mcp_server_fastmcp-0.1.3/tests/test_config.py +27 -0
  48. telnyx_mcp_server_fastmcp-0.1.3/tests/test_id_validation.py +168 -0
  49. telnyx_mcp_server_fastmcp-0.1.3/tests/test_smoke.py +62 -0
  50. telnyx_mcp_server_fastmcp-0.1.3/tests/tools/test_embeddings.py +73 -0
  51. telnyx_mcp_server_fastmcp-0.1.3/tests/tools/test_secrets.py +74 -0
  52. telnyx_mcp_server_fastmcp-0.1.3/tests/webhook/__init__.py +1 -0
  53. telnyx_mcp_server_fastmcp-0.1.3/tests/webhook/test_server.py +128 -0
@@ -0,0 +1,160 @@
1
+ ### Python template
2
+ # Byte-compiled / optimized / DLL files
3
+ __pycache__/
4
+ *.py[cod]
5
+ *$py.class
6
+
7
+ # C extensions
8
+ *.so
9
+
10
+ # Distribution / packaging
11
+ .Python
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # poetry
99
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
103
+ #poetry.lock
104
+
105
+ # pdm
106
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
107
+ #pdm.lock
108
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
109
+ # in version control.
110
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
111
+ .pdm.toml
112
+ .pdm-python
113
+ .pdm-build/
114
+
115
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
116
+ __pypackages__/
117
+
118
+ # Celery stuff
119
+ celerybeat-schedule
120
+ celerybeat.pid
121
+
122
+ # SageMath parsed files
123
+ *.sage.py
124
+
125
+ # Environments
126
+ .env
127
+ .venv
128
+ env/
129
+ venv/
130
+ ENV/
131
+ env.bak/
132
+ venv.bak/
133
+
134
+ # Spyder project settings
135
+ .spyderproject
136
+ .spyproject
137
+
138
+ # Rope project settings
139
+ .ropeproject
140
+
141
+ # mkdocs documentation
142
+ /site
143
+
144
+ # mypy
145
+ .mypy_cache/
146
+ .dmypy.json
147
+ dmypy.json
148
+
149
+ # Pyre type checker
150
+ .pyre/
151
+
152
+ # pytype static type analyzer
153
+ .pytype/
154
+
155
+ # Cython debug symbols
156
+ cython_debug/
157
+
158
+ .idea/
159
+
160
+ .DS_Store
@@ -0,0 +1,430 @@
1
+ Metadata-Version: 2.4
2
+ Name: telnyx-mcp-server-fastmcp
3
+ Version: 0.1.3
4
+ Summary: Telnyx MCP Server
5
+ Project-URL: Homepage, https://github.com/fastmcp-me/telnyx-mcp-server#readme
6
+ Project-URL: Repository, https://github.com/fastmcp-me/telnyx-mcp-server.git
7
+ Project-URL: Issues, https://github.com/fastmcp-me/telnyx-mcp-server/issues
8
+ Author-email: Telnyx Engineering <engineering@telnyx.com>
9
+ Requires-Python: >=3.10
10
+ Requires-Dist: boto3==1.35.99
11
+ Requires-Dist: fastapi>=0.110.0
12
+ Requires-Dist: fastmcp<0.5.0,>=0.4.0
13
+ Requires-Dist: httpx>=0.27.0
14
+ Requires-Dist: mcp>=1.3.0
15
+ Requires-Dist: ngrok>=0.9.0
16
+ Requires-Dist: pydantic-settings>=2.2.1
17
+ Requires-Dist: pydantic<3.0.0,>=2.7.2
18
+ Requires-Dist: python-dotenv>=1.0.1
19
+ Requires-Dist: requests>=2.32.2
20
+ Requires-Dist: uvicorn>=0.27.1
21
+ Provides-Extra: dev
22
+ Requires-Dist: pytest-asyncio>=0.21.1; extra == 'dev'
23
+ Requires-Dist: pytest>=7.4.0; extra == 'dev'
24
+ Requires-Dist: ruff>=0.11.8; extra == 'dev'
25
+ Provides-Extra: webhook
26
+ Requires-Dist: ngrok>=0.9.0; extra == 'webhook'
27
+ Description-Content-Type: text/markdown
28
+
29
+ [![Add to Cursor](https://fastmcp.me/badges/cursor_dark.svg)](https://fastmcp.me/MCP/Details/1804/telnyx-mcp-server)
30
+ [![Add to VS Code](https://fastmcp.me/badges/vscode_dark.svg)](https://fastmcp.me/MCP/Details/1804/telnyx-mcp-server)
31
+ [![Add to Claude](https://fastmcp.me/badges/claude_dark.svg)](https://fastmcp.me/MCP/Details/1804/telnyx-mcp-server)
32
+ [![Add to ChatGPT](https://fastmcp.me/badges/chatgpt_dark.svg)](https://fastmcp.me/MCP/Details/1804/telnyx-mcp-server)
33
+ [![Add to Codex](https://fastmcp.me/badges/codex_dark.svg)](https://fastmcp.me/MCP/Details/1804/telnyx-mcp-server)
34
+ [![Add to Gemini](https://fastmcp.me/badges/gemini_dark.svg)](https://fastmcp.me/MCP/Details/1804/telnyx-mcp-server)
35
+
36
+ # Telnyx Local Model Context Protocol (MCP) Server
37
+
38
+ > **⚠️ DEPRECATED**: This Python-based MCP server is deprecated. Please migrate to the official TypeScript version:
39
+ >
40
+ > **New Repository:** https://github.com/team-telnyx/telnyx-node/tree/master/packages/mcp-server
41
+
42
+ ---
43
+
44
+ Official Telnyx Local Model Context Protocol (MCP) Server that enables interaction with powerful telephony, messaging, and AI assistant APIs. This server allows MCP clients like Claude Desktop, Cursor, Windsurf, OpenAI Agents and others to manage phone numbers, send messages, make calls, and create AI assistants.
45
+
46
+ ## Quickstart with Claude Desktop
47
+
48
+ 1. Get your API key from the [Telnyx Portal](https://portal.telnyx.com/#/api-key).
49
+ 2. Install `uvx` (Python package manager), install with `curl -LsSf https://astral.sh/uv/install.sh | sh` , `brew install uv` or see the `uv` repo for additional install methods.
50
+ 3. Go to Claude > Settings > Developer > Edit Config > claude_desktop_config.json to include the following:
51
+
52
+ ```json
53
+ {
54
+ "mcpServers": {
55
+ "Telnyx": {
56
+ "command": "uvx",
57
+ "args": ["--from", "git+https://github.com/team-telnyx/telnyx-mcp-server.git", "telnyx-mcp-server"],
58
+ "env": {
59
+ "TELNYX_API_KEY": "<insert-your-api-key-here>"
60
+ }
61
+ }
62
+ }
63
+ }
64
+ ```
65
+
66
+ If you're using Windows, you will have to enable "Developer Mode" in Claude Desktop to use the MCP server. Click "Help" in the hamburger menu at the top left and select "Enable Developer Mode".
67
+
68
+ ## Running After Download
69
+
70
+ 1. Get your API key from the [Telnyx Portal](https://portal.telnyx.com/#/api-key).
71
+
72
+ 2. Install `uvx` (Python package manager), install with `curl -LsSf https://astral.sh/uv/install.sh | sh` , `brew install uv` or see the `uv` repo for additional install methods.
73
+
74
+ 3. **Clone the Git Repository**
75
+ Use Git to download the Telnyx MCP Server locally:
76
+ ```bash
77
+ git clone https://github.com/team-telnyx/telnyx-mcp-server.git
78
+ cd telnyx-mcp-server
79
+ ```
80
+
81
+ 4. **Configure and Run with uvx**
82
+ In your Claude config, you can reference the local folder by using the `--from` argument. For example:
83
+ ```json
84
+ {
85
+ "mcpServers": {
86
+ "Telnyx": {
87
+ "command": "uvx",
88
+ "args": ["--from", "/path/to/telnyx-mcp-server", "telnyx-mcp-server"],
89
+ "env": {
90
+ "TELNYX_API_KEY": "<insert-your-api-key-here>"
91
+ }
92
+ }
93
+ }
94
+ }
95
+ ```
96
+
97
+ 5. This instructs Claude to run the server from the folder you cloned.
98
+ Replace “/path/to/telnyx-mcp-server” with the actual location of the repository.
99
+
100
+ ## Available Tools
101
+
102
+ ### Assistant Tools
103
+ - Create AI assistants with custom instructions and configurations
104
+ - List existing assistants
105
+ - Get assistant details
106
+ - Update assistant properties
107
+ - Delete assistants
108
+ - Get assistant TEXML configurations
109
+
110
+ ### Call Control Tools
111
+ - Make outbound phone calls
112
+ - Hang up active calls
113
+ - Transfer calls to new destinations
114
+ - Play audio files during calls
115
+ - Stop audio playback
116
+ - Send DTMF tones
117
+ - Speak text using text-to-speech
118
+
119
+ ### Messaging Tools
120
+ - Send SMS and MMS messages
121
+ - Get message details
122
+ - Access and view ongoing SMS conversations (`resource://sms/conversations`)
123
+
124
+ ### Phone Number Tools
125
+ - List your phone numbers
126
+ - Buy new phone numbers
127
+ - Update phone number configurations
128
+ - List available phone numbers
129
+
130
+ ### Connection Tools
131
+ - List voice connections
132
+ - Get connection details
133
+ - Update connection configurations
134
+
135
+ ### Cloud Storage Tools
136
+ - Create buckets compatible with Telnyx Cloud Storage
137
+ - List buckets across all regions
138
+ - Upload files
139
+ - Download files
140
+ - List objects in a bucket
141
+ - Delete objects
142
+ - Get bucket location information
143
+
144
+ ### Embeddings Tools
145
+ - List existing embedded buckets
146
+ - Scrape and embed a website URL
147
+ - Create embeddings for your own files
148
+
149
+ ### Secrets Manager Tools
150
+ - List integration secrets
151
+ - Create new bearer or basic secrets
152
+ - Delete integration secrets
153
+
154
+ ## Tool Filtering
155
+
156
+ You can selectively enable or disable specific tools when running the MCP server. This is useful when you only need a subset of the available functionality.
157
+
158
+ ### Listing Available Tools
159
+
160
+ To see all available tools:
161
+
162
+ ```bash
163
+ uvx --from /path/to/telnyx-mcp-server telnyx-mcp-server --list-tools
164
+ ```
165
+
166
+ ### Enabling Specific Tools
167
+
168
+ You can enable only specific tools using either:
169
+
170
+ 1. **Command-line argument**:
171
+ ```bash
172
+ uvx --from /path/to/telnyx-mcp-server telnyx-mcp-server --tools "send_message,get_message,list_phone_numbers"
173
+ ```
174
+
175
+ 2. **Environment variable**:
176
+ ```json
177
+ {
178
+ "mcpServers": {
179
+ "Telnyx": {
180
+ "command": "uvx",
181
+ "args": ["--from", "/path/to/telnyx-mcp-server", "telnyx-mcp-server"],
182
+ "env": {
183
+ "TELNYX_API_KEY": "<insert-your-api-key-here>",
184
+ "TELNYX_MCP_TOOLS": "send_message,get_message,list_phone_numbers"
185
+ }
186
+ }
187
+ }
188
+ }
189
+ ```
190
+
191
+ ### Excluding Specific Tools
192
+
193
+ You can exclude specific tools while enabling all others:
194
+
195
+ 1. **Command-line argument**:
196
+ ```bash
197
+ uvx --from /path/to/telnyx-mcp-server telnyx-mcp-server --exclude-tools "make_call,send_dtmf"
198
+ ```
199
+
200
+ 2. **Environment variable**:
201
+ ```json
202
+ {
203
+ "mcpServers": {
204
+ "Telnyx": {
205
+ "command": "uvx",
206
+ "args": ["--from", "/path/to/telnyx-mcp-server", "telnyx-mcp-server"],
207
+ "env": {
208
+ "TELNYX_API_KEY": "<insert-your-api-key-here>",
209
+ "TELNYX_MCP_EXCLUDE_TOOLS": "make_call,send_dtmf"
210
+ }
211
+ }
212
+ }
213
+ }
214
+ ```
215
+
216
+ ## Example Usage
217
+
218
+ Try asking Claude:
219
+
220
+ * "Create an AI agent that can handle customer service for an e-commerce business"
221
+ * "Send a text message to +5555551234 saying 'Your appointment is confirmed for tomorrow at 3pm'"
222
+ * "Make a call to my customer at +5555551234 and transfer them to my support team"
223
+ * "Find me a phone number in Chicago with area code 312"
224
+ * "Create an auto-attendant system using Telnyx AI assistants and voice features"
225
+
226
+ ## Webhook Receiver
227
+
228
+ The MCP server includes a webhook receiver that can handle Telnyx webhooks directly through ngrok. This is useful for receiving call events and other notifications from Telnyx.
229
+
230
+ ### Enabling Webhooks
231
+
232
+ To enable the webhook receiver, you can either use the `--webhook-enabled` command-line flag or set the `WEBHOOK_ENABLED=true` environment variable. If an `NGROK_AUTHTOKEN` is also provided (see 'Ngrok Integration' below), the ngrok tunnel will be automatically attempted when the server starts. The command-line flag takes precedence if both are set.
233
+
234
+ **Using Command-Line Flag:**
235
+
236
+ ```bash
237
+ telnyx-mcp-server --webhook-enabled --ngrok-enabled
238
+ ```
239
+
240
+ **Using Environment Variable:**
241
+
242
+ Alternatively, set the `WEBHOOK_ENABLED=true` environment variable. This is often convenient when configuring via MCP client settings (see 'Webhook Configuration in Claude Desktop' below) or in `.env` files.
243
+
244
+ ```bash
245
+ # Example for your shell
246
+ export WEBHOOK_ENABLED=true
247
+ export NGROK_AUTHTOKEN=your_ngrok_token # Also needed for ngrok
248
+ telnyx-mcp-server
249
+ ```
250
+
251
+ ### Ngrok Integration
252
+
253
+ To enable ngrok tunneling:
254
+
255
+ 1. Get an ngrok authentication token from [ngrok.com](https://ngrok.com/)
256
+ 2. Set the `NGROK_AUTHTOKEN` environment variable or use the `--ngrok-authtoken` flag:
257
+
258
+ ```bash
259
+ # Using NGROK_AUTHTOKEN environment variable (recommended)
260
+ export NGROK_AUTHTOKEN=your_ngrok_token
261
+ telnyx-mcp-server --webhook-enabled # Or use WEBHOOK_ENABLED=true env var
262
+
263
+ # Or using --ngrok-authtoken command line flag
264
+ telnyx-mcp-server --webhook-enabled --ngrok-authtoken your_ngrok_token
265
+ ```
266
+ If `NGROK_AUTHTOKEN` is set, the `--ngrok-enabled` flag is generally not required when webhooks are active.
267
+
268
+ When ngrok is enabled, the server will print the public URL that can be used to configure webhooks in the Telnyx Portal.
269
+
270
+ **Important:** If ngrok fails to initialize (e.g., due to an invalid authtoken, network issues, or conflicts with another ngrok process), the MCP server will exit on startup. Check the server logs for details (see Troubleshooting section).
271
+
272
+ ### Parent Process Monitoring
273
+
274
+ The MCP server monitors the parent process (Claude Desktop) and automatically exits when the parent process is gone. This ensures proper cleanup of resources even if Claude Desktop closes unexpectedly.
275
+
276
+
277
+ ### Webhook Monitoring and Runtime Control
278
+
279
+ - You can inspect the current webhook and ngrok status by querying the `resource://webhook/info` resource.
280
+ - To retrieve a history of received webhook events, use the `get_webhook_events` tool.
281
+
282
+ ### Webhook Configuration in Claude Desktop
283
+
284
+ To enable webhooks in Claude Desktop, update your configuration:
285
+
286
+ ```json
287
+ {
288
+ "mcpServers": {
289
+ "Telnyx": {
290
+ "command": "uvx",
291
+ "args": ["--from", "git+https://github.com/team-telnyx/telnyx-mcp-server.git", "telnyx-mcp-server"],
292
+ "env": {
293
+ "TELNYX_API_KEY": "<insert-your-api-key-here>",
294
+ "NGROK_AUTHTOKEN": "<insert-your-ngrok-token-here>",
295
+ "WEBHOOK_ENABLED": "true", // Enables webhooks via environment variable
296
+ // Alternatively, you can use command-line flags in "args" instead of WEBHOOK_ENABLED in env:
297
+ // e.g., "args": ["--from", "git+https://github.com/team-telnyx/telnyx-mcp-server.git", "telnyx-mcp-server", "--webhook-enabled"],
298
+ }
299
+ }
300
+ }
301
+ }
302
+ ```
303
+
304
+ ### Webhook Example
305
+
306
+ <img width="704" alt="Screenshot Webhook" src="https://github.com/user-attachments/assets/2e1f4a47-df24-4e35-acdf-765ef4a71578" />
307
+
308
+ ## Remote MCP Now Available
309
+
310
+ Telnyx now offers a remote MCP implementation based on the latest MCP specification. This allows you to access Telnyx's powerful communications APIs through a remotely hosted MCP server. No need to run the server locally. Learn more in the [official documentation](https://developers.telnyx.com/docs/mcp/remote-mcp).
311
+
312
+ ## Contributing
313
+
314
+ If you want to contribute or run from source:
315
+
316
+ 1. Clone the repository:
317
+ ```bash
318
+ git clone https://github.com/team-telnyx/telnyx-mcp-server.git
319
+ cd telnyx-mcp-server
320
+ ```
321
+
322
+ 2. Create a virtual environment and install dependencies using uv:
323
+ ```bash
324
+ uv venv
325
+ source .venv/bin/activate
326
+ uv pip install -e ".[dev]" # Includes development dependencies like ruff
327
+ ```
328
+
329
+ 3. Create a `.env` file and add your Telnyx API key:
330
+ ```bash
331
+ echo "TELNYX_API_KEY=YOUR_API_KEY" > .env
332
+ ```
333
+
334
+ 4. Run the tests to make sure everything is working:
335
+ ```bash
336
+ pytest
337
+ ```
338
+
339
+ 5. Install the server in Claude Desktop: `mcp install src/telnyx_mcp_server/server.py`
340
+ 6. Debug and test locally with MCP Inspector: `mcp dev src/telnyx_mcp_server/server.py`
341
+
342
+ ## Code Quality with Ruff
343
+
344
+ This project uses [Ruff](https://docs.astral.sh/ruff/) for linting and formatting Python code. Ruff is a fast Python linter and formatter written in Rust, designed to replace multiple Python code quality tools with a single, unified tool.
345
+
346
+ ### Installing Ruff
347
+
348
+ Ruff is included in the development dependencies. Install it with:
349
+
350
+ ```bash
351
+ uv pip install -e ".[dev]"
352
+ ```
353
+
354
+ ### Using Ruff
355
+
356
+ #### Linting
357
+
358
+ To check your code for issues:
359
+
360
+ ```bash
361
+ ruff check .
362
+ ```
363
+
364
+ To automatically fix issues where possible:
365
+
366
+ ```bash
367
+ ruff check --fix .
368
+ ```
369
+
370
+ #### Formatting
371
+
372
+ To format your code:
373
+
374
+ ```bash
375
+ ruff format .
376
+ ```
377
+
378
+ ### Pre-commit Workflow
379
+
380
+ For the best development experience, run these commands before committing changes:
381
+
382
+ ```bash
383
+ # Format code
384
+ ruff format .
385
+
386
+ # Fix linting issues
387
+ ruff check --fix .
388
+
389
+ # Run tests
390
+ pytest
391
+ ```
392
+
393
+ ### Configuration
394
+
395
+ Ruff is configured in the `pyproject.toml` file. The configuration includes:
396
+
397
+ - Code style rules based on PEP 8
398
+ - Import sorting
399
+ - Docstring style checking (Google style)
400
+ - Code complexity checks
401
+ - And more
402
+
403
+ See the `[tool.ruff]` section in `pyproject.toml` for the complete configuration.
404
+
405
+ ## Troubleshooting
406
+
407
+ Logs when running with Claude Desktop can be found at:
408
+
409
+ * **Windows**: `%APPDATA%\Claude\logs\mcp-server-telnyx.log`
410
+ * **macOS**: `~/Library/Logs/Claude/mcp-server-telnyx.log`
411
+
412
+ ### MCP Telnyx: spawn uvx ENOENT
413
+
414
+ If you encounter the error "MCP Telnyx: spawn uvx ENOENT", confirm its absolute path by running this command in your terminal:
415
+
416
+ ```bash
417
+ which uvx
418
+ ```
419
+
420
+ Once you obtain the absolute path (e.g., `/usr/local/bin/uvx`), update your configuration to use that path (e.g., `"command": "/usr/local/bin/uvx"`). This ensures that the correct executable is referenced.
421
+
422
+
423
+ ### Server Fails to Start (Especially with Webhooks/Ngrok)
424
+
425
+ If the MCP server fails to start, particularly if you have webhooks enabled, it might be due to an issue with ngrok initialization.
426
+ One common cause is an existing ngrok process running in the background, potentially from a previous server instance that didn't shut down cleanly.
427
+
428
+ * **Check for running processes:** Use commands like `ps aux | grep telnyx-mcp-server` (Linux/macOS) or check Task Manager (Windows) for any lingering `telnyx-mcp-server` processes. Since ngrok is managed internally by the server, you typically won't see a separate 'ngrok' process.
429
+ * **Kill old processes:** If found, terminate these old processes.
430
+ * **Check logs:** Review the server logs (locations mentioned above) for specific error messages related to ngrok or server startup.