pip install mellea, pip install "mcp[cli]", Ollama running locally.
Creating an MCP server
Decorate any function with@mcp.tool(). The docstring becomes the tool description
visible to the AI client.
@mcp.tool() function becomes a callable tool. Mellea’s requirements and
sampling strategies work exactly as they do in regular code — the MCP layer just
wraps the result.
Multiple tools in one server
A singleFastMCP server can expose multiple tools, resources, and prompts:
Note: Each tool invocation creates a new MelleaSession. For high-throughput
servers, consider initializing sessions at module level and reusing them across calls.
Running the server
Start the MCP dev UI to test interactively:http://localhost:5173 where you can call
tools, inspect arguments, and see outputs.
To run the server directly:
docs/examples/notebooks/mcp_example.ipynb
See also: Backends and Configuration