mcpField
R
RobotFrameworkLibrary-to-MCP

RobotFrameworkLibrary-to-MCP

Local
github.com/noubarDeveloper Tools2Updated 26w ago

About RobotFrameworkLibrary-to-MCP

RobotFrameworkLibrary-to-MCP describes a way for developers to expose existing Robot Framework library keywords to MCP clients. Adding a to_mcp method registers the keywords as tools, and the server can run over stdio.

Key features

  1. 01Register library keywords as MCP tools
  2. 02Add a to_mcp method to a library
  3. 03Run the server over stdio
  4. 04Configure an MCP client connection

Use cases

  1. 01Connect an existing Robot Framework library to MCP
  2. 02Let MCP clients invoke library keywords

MCP support

The project explains how to register Robot Framework library keywords as MCP tools and run the server over stdio for MCP clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

RobotFrameworkLibrary-to-MCP

How to turn any robot framework library to a mcp server

Here is How

  1. Clone your robot library
  2. open the folder and go to init.py, where the Library class with hybrid core or dynamic core is initiated. (example)
    from robotlibcore import DynamicCore
    class LibraryName(DynamicCore):
      def __init__(self):
         ...
    
  3. Add the following function to the class
    def to_mcp(self):
        from mcp.server.fastmcp import FastMCP
        mcp = FastMCP(self.__class__.__name__)
        for kw in self.keywords.values():
            mcp.add_tool(kw)
        return mcp

You can use it in any MCP Client

  1. press ctrl shift p and type MCP: Open Workspace Folder Configuration. (Click on create if does not exist)
  2. Add the following lines
{
        "servers": {
            "LibName": {
                "type": "stdio",
                "command": "uv",
                "args": [
                    "--directory",
                    "C:\\somefolder\\ABS Path to The library Root",
                    "run",
                    "test.py"] # the new py file name where you run the server
            }
        }
}

You could run the following Code in a py file in the root folder of library:

from src.LibraryName import LibraryName
if __name__ == "__main__":
    LibraryName().to_mcp().run(transport="stdio")

Or

image

Thats it

You can then check it under ctrl shift p with MCP: List Servers

Demo

I will be documenting a demo using MailClientLibrary

from src.MailClientLibrary import MailClientLibrary 
a = MailClientLibrary(Username="user", Password="pass", MailServerAddress="127.0.0.1", ImapPorts=[993,143], Pop3Ports=[995,110], SmtpPorts=[465,25]).to_mcp()
a.run(transport='stdio')
print(a)

CODEX

under project root folder add .cortex/config.toml file with the following input

[mcp_servers.mail-client]
command = "uv"
args = [
  "--directory",
  "C:\\Repos\\RobotFramework-MailClientLibrary",
  "run",
  "mail_mcp_server.py",
]
cwd = "C:\\Repos\\RobotFramework-MailClientLibrary"

open a new session and ask: ist all mcp servers you can access

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.