RobotFrameworkLibrary-to-MCP
@noubar
How to turn any robot framework library to a mcp server
Overview
What is RobotFrameworkLibrary-to-MCP?
It is a method to convert any Robot Framework library built on robotlibcore's DynamicCore or hybrid core into an MCP (Model Context Protocol) server. This allows library keywords to be automatically exposed as MCP tools, enabling integration with MCP clients like AI assistants or IDEs.
How to use RobotFrameworkLibrary-to-MCP?
Add a to_mcp method to your library class that creates a FastMCP instance and adds each keyword as a tool. Then create a Python script that instantiates your library, calls to_mcp(), and runs the server via a.run(transport='stdio'). Finally, configure your MCP client (e.g., VSCode) with a stdio server entry pointing to that script using uv run as the command.
Key features of RobotFrameworkLibrary-to-MCP
- Converts any robotlibcore-based library into an MCP server.
- Exposes all library keywords as MCP tools automatically.
- Uses stdio transport for integration with MCP clients.
- Requires only a small code addition to the library class.
- Works with both hybrid and dynamic core library types.
- Demonstrated with MailClientLibrary as an example.
Use cases of RobotFrameworkLibrary-to-MCP
- Making Robot Framework test libraries available to AI assistants via MCP.
- Exposing email operations (e.g., MailClientLibrary) as MCP tools in an IDE.
- Converting existing keyword libraries for use in MCP-compatible development environments.
FAQ from RobotFrameworkLibrary-to-MCP
What type of Robot Framework libraries can be converted?
Libraries that use robotlibcore's DynamicCore or hybrid core, as they contain a keywords dictionary that can be iterated over