Skip to main content
Glama

Nexmo Messages MCP Server

main.py2.5 kB
# generated by fastapi-codegen: # filename: openapi.yaml # timestamp: 2025-06-29T07:36:03+00:00 import argparse import json import os from typing import * from typing import Optional, Union from autogen.mcp.mcp_proxy import MCPProxy from autogen.mcp.mcp_proxy.security import BaseSecurity, HTTPBasic, HTTPBearer from models import ( ErrorInternal, ErrorPaymentRequired, ErrorThrottled, FieldDatamodelCodeGeneratorRootSpecialPostRequest, FieldDatamodelCodeGeneratorRootSpecialPostResponse, FieldDatamodelCodeGeneratorRootSpecialPostResponse6, FieldDatamodelCodeGeneratorRootSpecialPostResponse7, ) from models.field__request import BodyCallbackPostRequest app = MCPProxy( contact={ 'email': 'devrel@nexmo.com', 'name': 'Nexmo DevRel', 'url': 'https://developer.nexmo.com/', }, description='The Messages API consolidates and normalises exchanges across all messaging channels. It allows you to use a single API to interact with our various channels such as SMS, MMS, WhatsApp, Viber and Facebook Messenger', title='Messages API', version='1.4.0', servers=[{'url': 'https://api.nexmo.com/v1/messages'}], ) @app.post( '/#-datamodel-code-generator-#-root-#-special-#', description=""" Send a Message """, tags=['channel_message_management'], security=[ HTTPBearer(name="None"), HTTPBasic(name="None"), ], ) def send_message(body: FieldDatamodelCodeGeneratorRootSpecialPostRequest): """ Send a message to the given channel. """ raise RuntimeError("Should be patched by MCPProxy and never executed") if __name__ == "__main__": parser = argparse.ArgumentParser(description="MCP Server") parser.add_argument( "transport", choices=["stdio", "sse", "streamable-http"], help="Transport mode (stdio, sse or streamable-http)", ) args = parser.parse_args() if "CONFIG_PATH" in os.environ: config_path = os.environ["CONFIG_PATH"] app.load_configuration(config_path) if "CONFIG" in os.environ: config = os.environ["CONFIG"] app.load_configuration_from_string(config) if "SECURITY" in os.environ: security_params = BaseSecurity.parse_security_parameters_from_env( os.environ, ) app.set_security_params(security_params) mcp_settings = json.loads(os.environ.get("MCP_SETTINGS", "{}")) app.get_mcp(**mcp_settings).run(transport=args.transport)

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ag2-mcp-servers/messages-api'

If you have feedback or need assistance with the MCP directory API, please join our Discord server