Skip to content

The use of robotlibraries as mcp server #157

Open
@noubar

Description

@noubar

There are several robot libraries implemented, which provide to robot additional functionalies (keywords).
Those same keywords are potential candidates to be used as mcp.tools.
Why should we implement the same functionality twice, let us use already implemented robot libraries as mcp servers.

Here is a very simple example:

from mcp.server.fastmcp import FastMCP

    def to_mcp(self):
        mcp = FastMCP(self.__class__.__name__)
        for kw in self.keywords.values():
            mcp.add_tool(kw)
        return mcp

i have added these lines in the class after the init of an implemented library
https://github.com/noubar/RobotFramework-MailClientLibrary/blob/55d63296c7e96236041f0ae3310a8bb0f141b3e6/src/MailClientLibrary/__init__.py#L90

this funcionality could also be directly added to the implementation of hybrid core

return sorted(self.keywords)

To run the server localy

from src.MailClientLibrary import MailClientLibrary 
a = MailClientLibrary().to_mcp()
a.run(transport='stdio')

And here it is running under vscode insiders version because the relaese version does not have this functionality yet

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions