Try Live
Add Docs
Rankings
Pricing
Enterprise
Docs
Install
Theme
Install
Docs
Pricing
Enterprise
More...
More...
Try Live
Rankings
Create API Key
Add Docs
Infobip MCP Servers
https://github.com/infobip/mcp
Admin
Infobip MCP Servers enable AI agents to interact with the Infobip platform via the Model Context
...
Tokens:
6,497
Snippets:
36
Trust Score:
8.3
Update:
1 month ago
Context
Skills
Chat
Benchmark
61
Suggestions
Latest
Show doc for...
Code
Info
Show Results
Context Summary (auto-generated)
Raw
Copy
Link
# Infobip MCP Servers Infobip MCP (Model Context Protocol) Servers provide AI agents with standardized access to the Infobip communications platform. This repository enables developers to integrate messaging capabilities (SMS, WhatsApp, Viber, RCS), two-factor authentication, customer data management, and account operations into AI applications through the Model Context Protocol. The system eliminates the complexity of traditional API integrations by providing a unified interface that AI agents can interact with naturally. The MCP servers are hosted remotely at `https://mcp.infobip.com` and support both streamable HTTP and SSE transports. Authentication is handled via API keys or OAuth 2.1, with automatic metadata discovery for OAuth flows. The servers expose tools and resources that AI frameworks can discover and invoke, enabling conversational interfaces for complex communication workflows. ## Available MCP Servers Remote MCP server endpoints for different Infobip services Each server provides specialized tools for its communication channel or service area. All servers support the Model Context Protocol specification and can be connected to any MCP-compatible AI framework. ```bash # SMS messaging server https://mcp.infobip.com/sms # WhatsApp messaging server https://mcp.infobip.com/whatsapp # Viber messaging server https://mcp.infobip.com/viber # RCS (Rich Communication Services) server https://mcp.infobip.com/rcs # Two-factor authentication server https://mcp.infobip.com/2fa # Customer data management server https://mcp.infobip.com/people # Account management server https://mcp.infobip.com/account-management # CPaaSX applications and entities server https://mcp.infobip.com/application-entity # Infobip documentation search server https://mcp.infobip.com/search # SSE transport example (append /sse to any endpoint) https://mcp.infobip.com/sms/sse ``` ## Claude Desktop Configuration with API Key Connect Infobip MCP servers to Claude Desktop using mcp-remote bridge This configuration enables Claude Desktop to access Infobip services through the MCP protocol. The API key is passed in the Authorization header using the "App" prefix format required by Infobip's authentication system. ```json { "mcpServers": { "infobip-sms": { "command": "npx", "args": [ "mcp-remote", "https://mcp.infobip.com/sms", "--header", "Authorization: App ${INFOBIP_API_KEY}" ], "env": { "INFOBIP_API_KEY": "your-api-key-here" } }, "infobip-whatsapp": { "command": "npx", "args": [ "mcp-remote", "https://mcp.infobip.com/whatsapp", "--header", "Authorization: App ${INFOBIP_API_KEY}" ], "env": { "INFOBIP_API_KEY": "your-api-key-here" } } } } ``` ## Claude Desktop Configuration with OAuth 2.1 Connect using OAuth 2.1 authentication with manual scope configuration OAuth 2.1 provides user-based authentication with fine-grained permission control. The client metadata includes scopes discovered from the authorization server's metadata endpoint at `{server-url}/.well-known/oauth-authorization-server`. ```json { "mcpServers": { "infobip-sms": { "command": "npx", "args": [ "mcp-remote", "https://mcp.infobip.com/sms", "--debug", "--static-oauth-client-metadata", "{\"scope\":\"sms:manage profile\"}" ] } } } ``` ## OpenAI Agents SDK (Python) Integration Build an SMS agent using OpenAI Agents SDK with Azure OpenAI This example creates an interactive chat agent that can send SMS messages through Infobip. The agent maintains conversation context across multiple turns and uses the MCP streamable HTTP transport to access Infobip tools. ```python import asyncio import os from agents import Agent, ModelSettings, Runner, set_default_openai_client, set_tracing_disabled from agents.mcp import MCPServerStreamableHttp from dotenv import load_dotenv from openai.lib.azure import AsyncAzureOpenAI load_dotenv() # Configure Azure OpenAI client client = AsyncAzureOpenAI( api_key=os.getenv("AZURE_OPENAI_API_KEY"), azure_endpoint=os.getenv("AZURE_OPENAI_ENDPOINT"), api_version=os.getenv("AZURE_OPENAI_API_VERSION"), ) set_default_openai_client(client=client, use_for_tracing=False) set_tracing_disabled(disabled=True) # Connect to Infobip SMS MCP server ib_sms_mcp_server = MCPServerStreamableHttp( name="InfobipSMS", params={ "url": "https://mcp.infobip.com/sms", "headers": {"Authorization": f"App {os.getenv('INFOBIP_API_KEY')}"}, }, client_session_timeout_seconds=30, ) async def main(): async with ib_sms_mcp_server: # Create SMS agent with MCP tools sms_agent = Agent( name="Infobip SMS Agent", model=os.getenv("AZURE_OPENAI_MODEL_NAME"), mcp_servers=[ib_sms_mcp_server], model_settings=ModelSettings(tool_choice="required", store=True), ) # Initial greeting reply = await Runner.run( sms_agent, """You are a helpful assistant specialized in SMS messaging services. You can help users send SMS messages through the Infobip platform.""", ) print("Assistant:", reply.final_output) # Interactive chat loop while True: user = input("You: ").strip() if user.lower() in {"exit", "quit", "bye", "goodbye"}: break if not user: continue reply = await Runner.run( sms_agent, input=user, previous_response_id=reply.last_response_id, ) print("Assistant:", reply.final_output) if __name__ == "__main__": asyncio.run(main()) ``` ## OpenAI Agents SDK (JavaScript) Integration Build an SMS agent using OpenAI Agents SDK with Node.js This Node.js implementation provides the same functionality as the Python version, with custom fetch configuration for proper header handling. The agent maintains conversation state using response IDs for context continuity. ```javascript import { Agent, MCPServerStreamableHttp, run, setDefaultOpenAIClient, setTracingDisabled, } from "@openai/agents"; import readline from "node:readline"; import { AzureOpenAI } from "openai"; // Configure Azure OpenAI client const client = new AzureOpenAI({ apiKey: process.env.AZURE_OPENAI_API_KEY, endpoint: process.env.AZURE_OPENAI_ENDPOINT, apiVersion: process.env.AZURE_OPENAI_API_VERSION, }); setDefaultOpenAIClient(client); setTracingDisabled(true); // Connect to Infobip SMS MCP server with custom fetch const ibSmsMcpServer = new MCPServerStreamableHttp({ name: "InfobipSMS", url: "https://mcp.infobip.com/sms", fetch: async (url, init) => fetch(url, { ...init, headers: { ...init?.headers, "Content-Type": "application/json", Accept: "application/json, text/event-stream", Authorization: `App ${process.env.INFOBIP_API_KEY}`, }, }), }); await ibSmsMcpServer.connect(); try { const smsAgent = new Agent({ name: "Infobip SMS Agent", model: process.env.AZURE_OPENAI_MODEL_NAME, mcpServers: [ibSmsMcpServer], modelSettings: { toolChoice: "required", store: true }, }); let reply = await run( smsAgent, `You are a helpful assistant specialized in SMS messaging services. You can help users send SMS messages through the Infobip platform.`, ); console.log("Assistant:", reply.finalOutput); // Interactive chat loop while (true) { const user = await readInput(); if (!user) continue; if (["exit", "quit", "bye", "goodbye"].includes(user.toLowerCase())) break; reply = await run(smsAgent, user, { previousResponseId: reply.id }); console.log("Assistant:", reply.finalOutput); } } finally { await ibSmsMcpServer.close(); } async function readInput() { const rl = readline.createInterface({ input: process.stdin, output: process.stdout, terminal: true, }); return new Promise((resolve) => rl.question("You: ", (input) => { rl.close(); resolve(input.trim()); }), ); } ``` ## LangGraph Integration (Python) Build an SMS agent using LangGraph with AWS Bedrock This example demonstrates using LangGraph's state graph architecture with Infobip MCP tools. The agent uses a conditional edge to determine when to call tools versus ending the conversation, with memory persistence via checkpointing. ```python import asyncio import os from dotenv import load_dotenv from langchain_aws.chat_models import ChatBedrock from langchain_mcp_adapters.client import MultiServerMCPClient from langgraph.checkpoint.memory import MemorySaver from langgraph.graph import END, START, StateGraph from langgraph.graph.message import MessagesState from langgraph.prebuilt import ToolNode load_dotenv() # Configure MCP client with Infobip SMS server client = MultiServerMCPClient({ "infobip-sms": { "url": "https://mcp.infobip.com/sms", "transport": "streamable_http", "headers": {"Authorization": f"App {os.getenv('INFOBIP_API_KEY')}"}, } }) # Configure AWS Bedrock LLM llm = ChatBedrock( model=os.getenv("AWS_MODEL_ID"), aws_access_key_id=os.getenv("AWS_ACCESS_KEY"), aws_secret_access_key=os.getenv("AWS_SECRET_KEY"), region=os.getenv("AWS_REGION") ) async def run_agent(): # Get tools from MCP server tools = await client.get_tools() tool_node = ToolNode(tools) llm_with_tools = llm.bind_tools(tools) # Define conditional edge logic def should_continue(state: MessagesState): messages = state["messages"] last_message = messages[-1] if last_message.tool_calls: return "tools" return END # Define model invocation async def call_model(state: MessagesState): messages = state["messages"] response = await llm_with_tools.ainvoke(messages) return {"messages": [response]} # Build state graph builder = StateGraph(MessagesState) builder.add_node("call_model", call_model) builder.add_node("tools", tool_node) builder.add_edge(START, "call_model") builder.add_conditional_edges("call_model", should_continue) builder.add_edge("tools", "call_model") # Compile with memory graph = builder.compile(checkpointer=MemorySaver()) config = {"configurable": {"thread_id": "chat_session_1"}} # Initial interaction reply = await graph.ainvoke( { "messages": [ ("system", """You are a helpful assistant specialized in SMS messaging. You can help users send SMS messages through the Infobip platform."""), ("user", "Hello"), ] }, config=config, ) print(f"Assistant: {reply['messages'][-1].content}") # Interactive chat loop while True: user = input("You: ").strip() if user.lower() in {"exit", "quit", "bye", "goodbye"}: break if not user: continue reply = await graph.ainvoke({"messages": [("user", user)]}, config=config) print(f"Assistant: {reply['messages'][-1].content}") if __name__ == "__main__": asyncio.run(run_agent()) ``` ## Semantic Kernel Integration (Python) Build an SMS agent using Microsoft Semantic Kernel This example uses Semantic Kernel's plugin architecture to integrate Infobip MCP tools. The MCPStreamableHttpPlugin automatically discovers and exposes tools from the MCP server as kernel functions with auto function calling. ```python import asyncio import os from dotenv import load_dotenv from semantic_kernel import Kernel from semantic_kernel.connectors.ai.function_choice_behavior import FunctionChoiceBehavior from semantic_kernel.connectors.ai.open_ai import ( AzureChatCompletion, AzureChatPromptExecutionSettings, ) from semantic_kernel.connectors.mcp import MCPStreamableHttpPlugin from semantic_kernel.contents import ChatHistory load_dotenv() # Configure Azure OpenAI service chat_service = AzureChatCompletion( deployment_name=os.getenv("AZURE_OPENAI_MODEL_NAME"), endpoint=os.getenv("AZURE_OPENAI_ENDPOINT"), api_key=os.getenv("AZURE_OPENAI_API_KEY"), api_version=os.getenv("AZURE_OPENAI_API_VERSION"), ) kernel = Kernel() kernel.add_service(chat_service) # Configure auto function calling settings = AzureChatPromptExecutionSettings() settings.function_choice_behavior = FunctionChoiceBehavior.Auto() async def main() -> None: # Connect MCP plugin to kernel async with MCPStreamableHttpPlugin( name="InfobipSMS", description="Infobip SMS Plugin - Enables sending SMS messages through the Infobip platform.", url="https://mcp.infobip.com/sms", headers={"Authorization": f"App {os.getenv('INFOBIP_API_KEY')}"} ) as infobip_plugin: kernel.add_plugin(infobip_plugin) # Initialize chat history history = ChatHistory(system_message=""" You are a helpful assistant specialized in SMS messaging services. You can help users send SMS messages through the Infobip platform. Be professional, friendly, and provide clear guidance on SMS-related tasks. """) # Initial greeting reply = await chat_service.get_chat_message_content(history, settings, kernel=kernel) print("Assistant:", reply.content) history.add_assistant_message(reply.content) # Interactive chat loop while True: user = input("You: ").strip() if user.lower() in {"exit", "quit", "bye", "goodbye"}: break if not user: continue history.add_user_message(user) reply = await chat_service.get_chat_message_content(history, settings, kernel=kernel) print("Assistant:", reply.content) history.add_assistant_message(reply.content) if __name__ == "__main__": asyncio.run(main()) ``` ## Semantic Kernel Integration (C#) Build an SMS agent using Semantic Kernel in .NET This C# implementation uses SSE transport and Azure OpenAI with Semantic Kernel. The MCP client discovers tools and converts them to kernel functions, enabling automatic function calling during chat interactions. ```csharp using System.Text.Json; using Azure.Identity; using DotNetEnv; using Microsoft.SemanticKernel.Connectors.AzureOpenAI; using Microsoft.SemanticKernel; using ModelContextProtocol.Client; using Spectre.Console; using Microsoft.SemanticKernel.ChatCompletion; Env.Load(); static string GetRequiredEnvironmentVariable(string variableName) { var value = Environment.GetEnvironmentVariable(variableName); ArgumentException.ThrowIfNullOrEmpty(value, variableName); return value; } string apiKey = GetRequiredEnvironmentVariable("ApiKey"); string apiBaseUrl = GetRequiredEnvironmentVariable("ApiBaseUrl"); string azureOpenAIBaseUrl = GetRequiredEnvironmentVariable("AzureOpenAIBaseUrl"); string azureOpenAIApiKey = GetRequiredEnvironmentVariable("AzureOpenAIApiKey"); string azureDeploymentName = GetRequiredEnvironmentVariable("AzureDeploymentName"); // Configure SSE transport for MCP string smsSendToolName = "SmsSendTool"; var transport = new SseClientTransport(new SseClientTransportOptions { Name = smsSendToolName, Endpoint = new Uri(apiBaseUrl), AdditionalHeaders = new Dictionary<string, string> { { "Authorization", $"App {apiKey}" } } }); // Connect to MCP server and get tools var mcpClient = await McpClientFactory.CreateAsync(transport); var tools = await mcpClient.ListToolsAsync(JsonSerializerOptions.Default); // Configure Semantic Kernel var builder = Kernel.CreateBuilder(); builder.AddAzureOpenAIChatCompletion(azureDeploymentName, azureOpenAIBaseUrl, azureOpenAIApiKey); var kernel = builder.Build(); var kernelFunctions = tools.Select(tool => tool.AsKernelFunction()); kernel.Plugins.AddFromFunctions(smsSendToolName, kernelFunctions); var executionSettings = new AzureOpenAIPromptExecutionSettings { Temperature = 0, FunctionChoiceBehavior = FunctionChoiceBehavior.Auto(), }; // Initialize chat var chatCompletionService = kernel.GetRequiredService<IChatCompletionService>(); ChatHistory history = []; history.AddSystemMessage("You are a helpful assistant specialized in SMS messaging services. " + "You can help users send SMS messages through the Infobip platform."); var initialReply = await chatCompletionService.GetChatMessageContentAsync( history, kernel: kernel, executionSettings: executionSettings); AnsiConsole.WriteLine("Assistant: " + initialReply.Content); history.AddAssistantMessage(initialReply.Content ?? ""); // Interactive chat loop while (true) { string user = AnsiConsole.Ask<string>("You: ").Trim().ToLower(); if (new[] { "exit", "quit", "bye", "goodbye" }.Contains(user)) break; if (user.Length == 0) continue; history.AddUserMessage(user); var reply = await chatCompletionService.GetChatMessageContentAsync( history, kernel: kernel, executionSettings: executionSettings); AnsiConsole.WriteLine("Assistant: " + reply.Content); history.AddAssistantMessage(reply.Content ?? ""); } ``` ## Spring AI Integration (Java) Build an SMS agent using Spring AI framework This Spring Boot application uses Spring AI's MCP support with automatic tool discovery and callback handling. The application runs as a command-line interface with chat memory for maintaining conversation context. ```java package com.infobip.example; import org.springframework.ai.chat.client.ChatClient; import org.springframework.ai.chat.client.advisor.MessageChatMemoryAdvisor; import org.springframework.ai.chat.memory.ChatMemory; import org.springframework.ai.tool.ToolCallbackProvider; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.WebApplicationType; import org.springframework.boot.autoconfigure.SpringBootApplication; import java.util.Set; @SpringBootApplication public class Application implements CommandLineRunner { public static void main(String[] args) { var springApp = new SpringApplication(Application.class); springApp.setWebApplicationType(WebApplicationType.NONE); springApp.run(args); } private final ChatClient chatClient; public Application( ChatClient.Builder chatClientBuilder, ChatMemory chatMemory, ToolCallbackProvider toolsProvider ) { chatClient = chatClientBuilder .defaultToolCallbacks(toolsProvider) .defaultAdvisors(MessageChatMemoryAdvisor.builder(chatMemory).build()) .defaultSystem(""" You are a helpful assistant specialized in SMS messaging services. You can help users send SMS messages through the Infobip platform. Please introduce yourself at a start of each session. Be professional, friendly, and provide clear guidance on SMS-related tasks.""" ).build(); } @Override public void run(String... args) throws Exception { // Initial greeting var initialReply = chatClient.prompt("Introduce yourself").call().content(); System.out.println("Assistant: " + initialReply); // Interactive chat loop while (true) { System.out.print("You: "); var user = System.console().readLine(); if (user == null || user.isBlank()) { continue; } else if (Set.of("exit", "quit", "bye", "goodbye") .contains(user.toLowerCase().trim())) { break; } var reply = chatClient.prompt(user).call().content(); System.out.println("Assistant: " + reply); } } } ``` ## Authentication with API Key Authenticate MCP requests using Infobip API key API key authentication uses the "App" prefix in the Authorization header. This is the simplest authentication method and works with all MCP transport types including SSE. ```bash # Set environment variable export INFOBIP_API_KEY="your-api-key-here" # Example header format for HTTP requests Authorization: App your-api-key-here # Python example headers = {"Authorization": f"App {os.getenv('INFOBIP_API_KEY')}"} # JavaScript example headers: { Authorization: `App ${process.env.INFOBIP_API_KEY}` } # Java example (in application.properties) infobip.api-key=${INFOBIP_API_KEY} ``` ## Discovering OAuth Scopes Retrieve OAuth scope requirements from authorization server metadata Each MCP server publishes OAuth 2.1 metadata at a well-known endpoint. This metadata includes supported scopes, authorization endpoints, token endpoints, and grant types. ```bash # Fetch OAuth metadata for SMS server # GET https://mcp.infobip.com/sms/.well-known/oauth-authorization-server # Example response structure: { "issuer": "https://mcp.infobip.com/sms", "authorization_endpoint": "https://oauth.infobip.com/authorize", "token_endpoint": "https://oauth.infobip.com/token", "scopes_supported": ["sms:manage", "profile"], "response_types_supported": ["code"], "grant_types_supported": ["authorization_code", "refresh_token"] } # Python example: Fetch and parse metadata import httpx import json async def get_oauth_scopes(server_url): metadata_url = f"{server_url}/.well-known/oauth-authorization-server" async with httpx.AsyncClient() as client: response = await client.get(metadata_url) metadata = response.json() return metadata["scopes_supported"] # Usage scopes = await get_oauth_scopes("https://mcp.infobip.com/sms") print(f"Required scopes: {' '.join(scopes)}") ``` ## Environment Variables Configuration Configure authentication and AI service credentials All examples require environment variables for authentication and AI service configuration. Create a `.env` file in your project root with the appropriate credentials for your chosen AI provider and Infobip account. ```bash # Infobip credentials INFOBIP_API_KEY=your-infobip-api-key # Azure OpenAI credentials (for Python/JS/C# examples) AZURE_OPENAI_API_KEY=your-azure-openai-key AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com AZURE_OPENAI_API_VERSION=2024-08-01-preview AZURE_OPENAI_MODEL_NAME=gpt-4 # AWS Bedrock credentials (for LangGraph example) AWS_MODEL_ID=anthropic.claude-3-sonnet-20240229-v1:0 AWS_ACCESS_KEY=your-aws-access-key AWS_SECRET_KEY=your-aws-secret-key AWS_REGION=us-east-1 # Load in Python from dotenv import load_dotenv load_dotenv() # Load in JavaScript/Node.js import 'dotenv/config'; # Load in C# DotNetEnv.Env.Load(); # Load in Java (application.properties) # Properties automatically loaded by Spring Boot ``` ## Summary Infobip MCP Servers provide production-ready AI agent integration for enterprise communications. The primary use cases include building conversational interfaces for SMS/WhatsApp/Viber messaging, automating two-factor authentication flows, managing customer profiles and data, and integrating communication capabilities into AI-powered applications. The servers support multiple AI frameworks (OpenAI Agents SDK, LangGraph, Semantic Kernel, Spring AI) and programming languages (Python, JavaScript, C#, Java), making them adaptable to diverse development environments and technology stacks. Integration patterns follow a consistent architecture across all frameworks: connect to the MCP server with authentication, retrieve available tools through discovery, bind tools to the AI agent or framework, and invoke tools during conversational interactions. The MCP protocol handles tool invocation, parameter validation, and response formatting automatically, allowing developers to focus on agent behavior and user experience. Both API key and OAuth 2.1 authentication methods are supported, with automatic scope discovery for OAuth flows. The system scales from simple single-channel messaging to complex multi-service workflows involving authentication, customer data management, and cross-channel communication orchestration.