This is a simple example to show how to write a MCP tool with Mellea and instruct-validate-repair. Being able to speak the tool language allows you to integrate with Claude Desktop, Langflow, ...
See code in mcp_example.py
You need to install the mcp package:
uv pip install "mcp[cli]"and run the example in MCP debug UI:
uv run mcp dev docs/examples/mcp/mcp_example.pyFollow this path (JSON) to use it in Langflow: https://docs.langflow.org/mcp-client#mcp-stdio-mode
The JSON to register your MCP tool is the following. Be sure to insert the absolute path to the directory containing the mcp_example.py file:
{
"mcpServers": {
"mellea_mcp_server": {
"command": "uv",
"args": [
"--directory",
"<ABSOLUTE PATH>/mellea/docs/examples/mcp",
"run",
"mcp",
"run",
"mcp_example.py"
]
}
}
}