Logo vun Telephony MCP Server

Telephony MCP Server

Communautéit
khan2a

A very simple no-fuss minimalist MCP Server with telephony tools like voice call and sms. This MCP Server can be integrated with LLM applications. Vonage API is used for calls, SMS, Speech-to-Text and Speech Recognition.

Editeurkhan2a
Repositorytelephony-mcp-server
SproochPython
Forks
5
Stären
13
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    Telephony MCP Server stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    13 Stären an 5 Forks aus dem verlinkte Repository.

Black Ruff

📖 Blog Post: Learn more about this project in the detailed blog post: Telephony MCP Server for Agentic AI and Language Models

Telephony MCP Server

Demo Using Claude Desktop

Agentic Telephony Conversation with Speech Recognition

Use SMS during mid-conversation

SMS Enquiry (Send and Receive)

Demo Using GitHub Copilot

Introduction

This directory contains MCP (Model Context Protocol) Server tools for telephony operations, such as making voice calls and sending SMS messages using the Vonage API. These tools are designed to be integrated with Large Language Model (LLM) applications, enabling LLMs to perform real-world actions beyond simple text generation.

LLMs and Tool Integration

LLMs (Large Language Models) are advanced token generators—they can generate text, images, or even video based on input prompts. However, their core capability is limited to generating content; they cannot access external data or perform actions in the real world on their own.

To extend their functionality, LLMs can be connected to external tools. For example, when a user asks, "What's the weather today?" the LLM can invoke a backend API tool like get_weather(city) via a system prompt, parse the response, and return the result to the user. This tool-calling mechanism transforms a basic LLM into a powerful LLM Application.

Tool Calling with MCP and LangChain

  • LangChain is a popular framework for developing applications powered by LLMs. It provides a collection of pre-built tools (called a Toolkit) that LLMs can use to interact with external systems.
  • MCP (Model Context Protocol) follows the same concept: it offers a collection of pre-built tools and a framework for writing new tools and handling function calling.
  • Both frameworks allow LLMs to invoke tools, parse their outputs, and integrate the results into their responses.

How This Works

  1. Tool Definition: In this project, tools like voice_call and send_sms are defined using the MCP framework. Each tool is a function that can be called by an LLM application.
  2. LLM Application: When integrated with an LLM (such as OpenAI's GPT, Anthropic's Claude, etc.), the LLM can decide to call these tools based on user prompts.
  3. Execution Flow:
    • The LLM receives a prompt (e.g., "Call Alice and say hello").
    • The LLM determines that a tool invocation is needed and calls the appropriate MCP tool (e.g., voice_call).
    • The tool executes (e.g., initiates a phone call via Vonage) and returns the result.
    • The LLM parses the response and presents it to the user.

Running the MCP Tools

Prerequisites

  • Python 3.13+
  • MCP CLI (mcp[cli]), FastAPI, httpx, pyjwt, python-dotenv, uvicorn, pydantic (see pyproject.toml for details)
  • Vonage API credentials (API key, secret, application ID, private key)
  • Public URL for callback server (for production use)

Setup

  1. Install dependencies:

    bash
    pip install -r requirements.txt

    Or, if using Poetry:

    bash
    poetry install
  2. Configure environment variables:

    • Create a .env file with your Vonage credentials:

      VONAGE_API_KEY=your_api_key
      VONAGE_API_SECRET=your_api_secret
      VONAGE_APPLICATION_ID=your_app_id
      VONAGE_PRIVATE_KEY_PATH=path/to/private.key
      VONAGE_LVN=your_virtual_number
      VONAGE_API_URL=https://api.nexmo.com/v1/calls
      VONAGE_SMS_URL=https://rest.nexmo.com/sms/json
      CALLBACK_SERVER_URL=https://your-public-url  # URL for Vonage event callbacks

      For the CALLBACK_SERVER_URL:

      • In development: You can use http://localhost:8080 (default if not specified)
      • In production: Use a public URL (such as an ngrok URL or your deployed server)
  3. Run the MCP server:

    bash
    python telephony_server.py

    The server will start and expose the defined tools for LLM applications.

Running with Docker

You can also run the telephony MCP server using Docker:

  1. Build and start the Docker container:

    bash
    docker compose up --build

    Or to run in the background:

    bash
    docker compose up --build -d
  2. Stop the Docker container:

    bash
    docker compose down
  3. View logs from the Docker container:

    bash
    docker compose logs -f

Using with LLM Applications

  • Direct Integration: Connect your LLM application (e.g., using LangChain via Adapter or a custom MCP client) to the running MCP server. The LLM can now invoke telephony tools as needed.
  • Example: When the LLM receives a prompt like "Dial this number +123 and read latest news from today", it will call the voice_call tool, passing the required parameters.
  • Example: When the LLM receives a prompt like "Call this number using a British accent", it will call the voice_call tool with specific language and style parameters.
  • Example: When the LLM receives a prompt like "Text the news instead", it will call the send_sms tool, passing the required parameters.

Using with Claude Desktop or other MCP clients

To configure an MCP client (like Claude Desktop) to use your telephony MCP server:

  1. Update your MCP client configuration file (e.g., claude_desktop_config.json):

    json
    {
      "mcpServers": {
        "telephony": {
          "command": "docker",
          "args": ["run", "-i", "--rm", "--init", "-e", "DOCKER_CONTAINER=true", "telephony-mcp-server"]
        }
      }
    }
  2. Build the Docker image (if not using docker compose):

    bash
    docker build -t telephony-mcp-server .
  3. Restart your MCP client to apply the changes.

Key Concepts

  • LLMs are content generators: They generate text, images, or video, but need external tools for actions like web search, telephony, or database access.
  • Tool calling: LLMs can invoke backend APIs (tools) to fetch data or perform actions, then parse and present the results.
  • Frameworks: Both LangChain and MCP provide a structure for defining, registering, and invoking tools from LLMs.
  • MCP: Helps you write new tools and manage function calling, making it easy to extend LLM applications with custom capabilities.

Callback Server for Vonage Events

The Telephony MCP Server also includes a Vonage Callback Server that listens on port 8080. This server is used to receive event notifications from Vonage Voice API, which are sent when voice calls are initiated, completed, or encounter errors.

Features

  • Receives and stores Vonage event callbacks
  • Provides endpoints to view and manage stored events
  • Runs as a separate service within the same application

Endpoints

  • GET / - Health check endpoint
  • POST /event - Main endpoint for receiving Vonage callbacks
  • GET /events - List all stored events (with pagination)
  • GET /events/{event_id} - Get a specific event by ID
  • DELETE /events - Clear all stored events

Configuration

To use the callback server with Vonage Voice API, you need to set the CALLBACK_SERVER_URL environment variable to your server's public URL. This URL will be used as the event_url parameter in Vonage API calls.

bash
export CALLBACK_SERVER_URL="https://your-public-url"

For local development, you can use a service like ngrok to expose your local server to the internet:

bash
ngrok http 8080

Then set the CALLBACK_SERVER_URL to the ngrok URL.

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "khan2a-telephony-mcp-server": {
      "command": "",
      "args": []
    }
  }
}

Telephony MCP Server MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal Telephony MCP Server verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

Telephony MCP Server als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu Telephony MCP Server an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "khan2a-telephony-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "telephony-mcp-server"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu Telephony MCP Server. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu Telephony MCP Server.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat Telephony MCP Server?
Telephony MCP Server
Jo. Ech hunn et gelies.
Dat hunn ech mat Telephony MCP Server fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server Telephony MCP Server benotzt?

Telephony MCP Server ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech Telephony MCP Server MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir Telephony MCP Server mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat Telephony MCP Server MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann Telephony MCP Server verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech Telephony MCP Server MCP mat TypingMind?

Telephony MCP Server leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt Telephony MCP Server MCP an TypingMind zur Verfügung?

Telephony MCP Server stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir Telephony MCP Server MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann Telephony MCP Server eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇