Simple mcp server running Mellea
Like we mentioned, mellea are at the end python programs. We can wrap a simplemcp server around a program and use the server as-is. Here is an example using Pydantic AI’s inbuild mcp server.
run the example stand-alone
You need to install the mcp package:Bash
Bash
use the poem tool via MCP in Langflow
Follow this tutorial to use the MCP tool in Langflow: https://docs.langflow.org/mcp-client#mcp-stdio-mode The JSON to register your MCP tool is the following. Make sure to insert the absolute path to the directory containing the mcp_example.py file:JSON
tool mode like this:

Running Mellea programs as an openai compatible server (Experimental)
We also provide an expiermentalm serve utility for serving up an OpenAI-compatible chat endpoint. This allows you to write m programs that masquerade as a “model”. To learn more about this functionality, run:
Example m serve application
While deploying programs using m serve, it is important for the programs to follow a specific structure. The programs needs a have function called serve with the following signature:
m serve command then subsequently takes this function and runs a server that is openai compatible. For more information, please have a look at this file for how to write an m serve compatible program. To run the example: