### Install DocTest Plugin Package Source: https://github.com/manykarim/rf-mcp/blob/main/examples/plugins/doctest_plugin/README.md Install the example package to make Python modules and entry points discoverable by rf-mcp. Ensure this is in the same virtual environment as rf-mcp. ```bash uv pip install --editable examples/plugins/doctest_plugin # or: pip install -e examples/plugins/doctest_plugin ``` -------------------------------- ### MCP Server Configuration Example Source: https://github.com/manykarim/rf-mcp/blob/main/docs/INSTRUCTION_TEMPLATES_QUICKREF.md Example of an .mcp.json file configuring the robotmcp server with specific instruction settings. ```json { "mcpServers": { "robotmcp": { "command": "uv", "args": ["run", "-m", "robotmcp.server"], "env": { "ROBOTMCP_INSTRUCTIONS": "default", "ROBOTMCP_INSTRUCTIONS_TEMPLATE": "detailed" } } } } ``` -------------------------------- ### Custom File Placeholder Example Source: https://github.com/manykarim/rf-mcp/blob/main/docs/INSTRUCTION_TEMPLATES_GUIDE.md Example of a custom instruction file using the {available_tools} placeholder, which is automatically substituted. Ensure the file has an allowed extension. ```text Use these tools before executing any keyword: {available_tools} Never guess locators. Always inspect the page first with get_session_state. ``` -------------------------------- ### Install rf-mcp with uv and database extras Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP with optional 'database' extras, which include DatabaseLibrary. This is for database testing. ```bash uv pip install rf-mcp[database] ``` -------------------------------- ### Install DocTest Library and Optional AI Extras Source: https://github.com/manykarim/rf-mcp/blob/main/examples/plugins/doctest_plugin/README.md Install the core robotframework-doctestlibrary package. Optionally, install the '[ai]' extra for LLM helpers. Ensure system binaries like ImageMagick and Tesseract are also installed. ```bash pip install robotframework-doctestlibrary # Optional LLM helpers pip install "robotframework-doctestlibrary[ai]" ``` -------------------------------- ### Robot Framework Settings and Test Case Example Source: https://github.com/manykarim/rf-mcp/blob/main/docs/robotmcp.html Example of how to import the McpAttach library in Robot Framework settings and a basic test case structure using its keywords. ```robotframework *** Settings *** Library robotmcp.attach.McpAttach host=0.0.0.0 port=7317 token=${TOKEN} *** Test Cases *** Serve In Background Start Process python -m my_agent --attach stdout=NONE MCP Serve mode=blocking ``` -------------------------------- ### Install rf-mcp with Optional Features Source: https://github.com/manykarim/rf-mcp/blob/main/docs/RELEASE_NOTES_v0.31.0.md Install the rf-mcp library with specific optional features using pip. Choose the installation that best suits your needs, from browser automation to persistent memory. ```bash pip install rf-mcp==0.31.0 ``` ```bash # With optional features pip install rf-mcp[web]==0.31.0 # Browser + SeleniumLibrary pip install rf-mcp[api]==0.31.0 # RequestsLibrary pip install rf-mcp[memory]==0.31.0 # Persistent memory pip install rf-mcp[all]==0.31.0 # Everything ``` -------------------------------- ### Install rf-mcp with uv and mobile extras Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP with optional 'mobile' extras, which include AppiumLibrary. This is for mobile automation. ```bash uv pip install rf-mcp[mobile] ``` -------------------------------- ### Setup/Teardown as Given/Then Steps Source: https://github.com/manykarim/rf-mcp/blob/main/docs/analysis/bdd-quality-improvement-report.md Use 'Given' for setup and 'Teardown' for cleanup within test cases. This pattern encapsulates the test environment setup and teardown, making test cases cleaner. ```robotframework *** Test Cases *** Checkout Flow [Setup] Given the demoshop is open When the user adds "Backpack" to the cart Then the cart should contain 1 item [Teardown] Close Browser ``` -------------------------------- ### Robot Framework: Example of [Arguments] Keyword Source: https://github.com/manykarim/rf-mcp/blob/main/docs/proposals/bdd-scenario-quality-improvement.md This example demonstrates how to generate a single parameterized keyword with [Arguments] for multiple consecutive 'Fill Text' steps targeting related fields. It shows the input steps and the desired output structure with embedded arguments. ```robotframework # Detect: Fill Text #first-name + Fill Text #last-name + Fill Text #zip # Generate: # the user enters checkout details # [Arguments] ${first_name} ${last_name} ${zip} # Fill Text id=first-name ${first_name} # Fill Text id=last-name ${last_name} # Fill Text id=postal-code ${zip} ``` -------------------------------- ### Install rf-mcp with uv and api extras Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP with optional 'api' extras, which include RequestsLibrary. This is for API testing. ```bash uv pip install rf-mcp[api] ``` -------------------------------- ### Get Locator Guidance Source: https://context7.com/manykarim/rf-mcp/llms.txt Provides locator strategy tips, anti-patterns, and examples for web and mobile automation libraries like Browser, SeleniumLibrary, or AppiumLibrary. Can be scoped to specific error messages or library-wide. ```python tips = await get_locator_guidance( library="Browser", error_message="strict mode violation: locator('.btn') resolved to 3 elements", keyword_name="Click" ) ``` ```python tips_sel = await get_locator_guidance(library="SeleniumLibrary") ``` -------------------------------- ### Install rf-mcp with pip Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install the RobotMCP package using pip. This is the most straightforward method for basic installation. ```bash pip install rf-mcp ``` -------------------------------- ### Install rf-mcp with pip and all extras Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP with all optional extras using pip. This installs all supported Robot Framework libraries. ```bash pip install rf-mcp[all] ``` -------------------------------- ### MCP Start Source: https://github.com/manykarim/rf-mcp/blob/main/docs/robotmcp.html Starts the MCP attach bridge. This keyword is an alias for 'MCP Serve' and is provided for backward compatibility. ```APIDOC ## MCP Start ### Description Starts the MCP attach bridge. This keyword is an alias for 'MCP Serve' and is provided for backward compatibility with older suites. ### Method Not specified (assumed to be a command-line invocation or internal function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **mode** (string) - Optional - Can be 'blocking' or 'step'. Defaults to 'blocking'. - **port** (integer or None) - Optional - The port to listen on. Defaults to None. - **token** (string or None) - Optional - Authentication token. Defaults to None. - **poll_ms** (integer) - Optional - Polling interval in milliseconds while in blocking mode. Defaults to 100. ### Request Example ``` MCP Start mode=blocking ``` ### Response Success response is not explicitly defined, but the command processes and returns. ``` -------------------------------- ### Install rf-mcp with uv and frontend extras Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP with optional 'frontend' extras, which include a Django-based web dashboard. This provides a UI for interacting with RobotMCP. ```bash uv pip install rf-mcp[frontend] ``` -------------------------------- ### Install rf-mcp with pip and database extras Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP with optional 'database' extras using pip. This includes DatabaseLibrary for database testing. ```bash pip install rf-mcp[database] ``` -------------------------------- ### Install rf-mcp with pip and frontend extras Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP with optional 'frontend' extras using pip. This includes a Django-based web dashboard. ```bash pip install rf-mcp[frontend] ``` -------------------------------- ### Development installation of rf-mcp with uv Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP from a cloned repository using uv. This method is suitable for developers contributing to the project. ```bash git clone https://github.com/manykarim/rf-mcp.git cd rf-mcp uv sync # Include optional extras & dev tooling uv sync --all-extras --dev ``` -------------------------------- ### Install rf-mcp with uv and web extras Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP with optional 'web' extras, which include Browser Library and SeleniumLibrary. This is useful for web automation tasks. ```bash uv pip install rf-mcp[web] ``` -------------------------------- ### Install rf-mcp with Memory Support Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Command to install the `rf-mcp` package with the necessary dependencies for enabling persistent semantic memory. ```bash pip install rf-mcp[memory] ``` ```bash # or uv pip install rf-mcp[memory] ``` -------------------------------- ### Install rf-mcp with uv and all extras Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP with all optional extras, including all supported Robot Framework libraries. This provides a comprehensive feature set. ```bash uv pip install rf-mcp[all] ``` -------------------------------- ### Test File Layout Example Source: https://github.com/manykarim/rf-mcp/blob/main/docs/adr/ADR-019-bdd-data-driven-support.md Illustrates the directory structure for organizing unit and integration tests, including specific files for BDD and data-driven functionalities. ```text tests/unit/domains/keyword_resolution/ test_value_objects.py # ~40 tests test_services.py # ~50 tests (BddPrefixService, EmbeddedMatcher, etc.) test_aggregates.py # ~20 tests (KeywordResolver, DataDrivenSuite) test_events.py # ~10 tests test_template_renderer.py # ~15 tests test_data_source_loader.py # ~20 tests tests/integration/ test_bdd_embedded_integration.py # ~25 tests test_data_driven_integration.py # ~10 tests ``` -------------------------------- ### Default MCP Setup Source: https://github.com/manykarim/rf-mcp/blob/main/docs/INSTRUCTION_TEMPLATES_GUIDE.md Use this standard template for most LLM interactions. It can be configured via a .mcp.json file or shell environment variables. ```json { "mcpServers": { "robotmcp": { "command": "uv", "args": ["run", "-m", "robotmcp.server"], "env": { "ROBOTMCP_INSTRUCTIONS": "default", "ROBOTMCP_INSTRUCTIONS_TEMPLATE": "standard" } } } } ``` ```bash export ROBOTMCP_INSTRUCTIONS=default export ROBOTMCP_INSTRUCTIONS_TEMPLATE=standard uv run -m robotmcp.server ``` -------------------------------- ### Handlebars Environment Setup Source: https://github.com/manykarim/rf-mcp/blob/main/docs/robotmcp.html Sets up the Handlebars environment, including version information and compiler details. This is typically used internally by Handlebars. ```javascript t(eP,"\_ eviews_",()=>k,e=>k=e),t(eP,"HandlebarsEnvironment",()=>\_,e=>\_=e),t(eP,"VERSION",()=>S,e=>S=e),t(eP,"COMPILER_REVISION",()=>b,e=>b=e),t(eP,"LAST_COMPATIBLE_COMPILER_REVISION",()=>w,e=>w=e),t(eP,"REVISION_CHANGES",()=>E,e=>E=e),t(eP,"log",()=>x,e=>x=e),t(eP,"createFrame",()=>C,e=>C=e),t(eP,"logger",()=>L,e=>L=e),k=!0,\_=ts ``` -------------------------------- ### Install rf-mcp with pip and web extras Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP with optional 'web' extras using pip. This includes Browser Library and SeleniumLibrary for web automation. ```bash pip install rf-mcp[web] ``` -------------------------------- ### Install Plugin and Verify Registration Source: https://github.com/manykarim/rf-mcp/blob/main/docs/library-plugin-authoring.md Commands to install a plugin in editable mode and Python code to verify its registration with `rf-mcp`'s library registry. This confirms the plugin is discoverable. ```bash pip install -e . # or publish package ``` ```python from robotmcp.config import library_registry libs = library_registry.get_all_libraries() print("BrowserPlus" in libs) # -> True if discovery worked ``` -------------------------------- ### Install rf-mcp with pip and mobile extras Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP with optional 'mobile' extras using pip. This includes AppiumLibrary for mobile automation. ```bash pip install rf-mcp[mobile] ``` -------------------------------- ### Initialize Playwright browsers with uv Source: https://github.com/manykarim/rf-mcp/blob/main/README.md After installing RobotMCP with web extras, initialize the necessary Playwright browsers using uv. This is a prerequisite for using Browser Library. ```bash uv run rfbrowser init ``` -------------------------------- ### Start RobotMCP Server with Frontend Dashboard Enabled Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Run the RobotMCP server with the frontend dashboard enabled. The dashboard will be accessible at http://127.0.0.1:8001/. Environment variables can be used for configuration. ```bash uv run -m robotmcp.server --with-frontend ``` -------------------------------- ### Start RobotMCP HTTP server Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Start the RobotMCP server using the HTTP transport. This allows AI agents to connect to the server over a network. ```bash uv run -m robotmcp.server --transport http --host 127.0.0.1 --port 8000 ``` -------------------------------- ### Install rf-mcp with pip and api extras Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP with optional 'api' extras using pip. This includes RequestsLibrary for API testing. ```bash pip install rf-mcp[api] ``` -------------------------------- ### Scaffold Plugin Class Implementation Source: https://github.com/manykarim/rf-mcp/blob/main/docs/library-plugin-authoring.md Example of implementing a `LibraryPlugin` by subclassing `StaticLibraryPlugin` and defining metadata and capabilities. This sets up a basic plugin structure. ```python # my_plugins/browser_plus.py from robotmcp.plugins.base import StaticLibraryPlugin from robotmcp.plugins.contracts import LibraryCapabilities, LibraryMetadata class BrowserPlusPlugin(StaticLibraryPlugin): def __init__(self) -> None: metadata = LibraryMetadata( name="BrowserPlus", package_name="robotframework-browserplus", import_path="BrowserPlus", description="Browser wrapper with custom helpers", library_type="external", categories=["web", "testing"], use_cases=["web testing", "visual validation"], installation_command="pip install robotframework-browserplus", load_priority=7, ) capabilities = LibraryCapabilities( contexts=["web"], features=["visual-baseline", "grid"], supports_page_source=True, ) super().__init__(metadata=metadata, capabilities=capabilities) ``` -------------------------------- ### Configure RobotMCP Server to Attach Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Start the robotmcp.server with attach routing by setting environment variables for the bridge connection. The token must match the one in the debugged suite. ```bash export ROBOTMCP_ATTACH_HOST=127.0.0.1 export ROBOTMCP_ATTACH_PORT=7317 # optional, defaults to 7317 export ROBOTMCP_ATTACH_TOKEN=change-me # optional, defaults to 'change-me' export ROBOTMCP_ATTACH_DEFAULT=auto # auto|force|off (auto routes when reachable) export ROBOTMCP_ATTACH_STRICT=0 # set to 1/true to fail when bridge is unreachable uv run python -m robotmcp.server ``` -------------------------------- ### Initialize Playwright browsers with pip Source: https://github.com/manykarim/rf-mcp/blob/main/README.md After installing RobotMCP with web extras via pip, initialize the Playwright browsers. This is required for Browser Library functionality. ```bash rfbrowser init # or python -m Browser.entry install ``` -------------------------------- ### Install rf-mcp with uv and memory extras Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP with optional 'memory' extras, which include persistent semantic memory using sqlite-vec and model2vec. This enables long-term memory for AI agents. ```bash uv pip install rf-mcp[memory] ``` -------------------------------- ### Troubleshoot Entry Point Loading Error Source: https://github.com/manykarim/rf-mcp/blob/main/examples/plugins/doctest_plugin/README.md If 'Failed to load plugin from entry point' occurs, confirm the installation was successful by listing the registered entry points for the 'robotmcp.library_plugins' group. ```python import importlib.metadata as im print([e.name for e in im.entry_points(group='robotmcp.library_plugins')]) ``` -------------------------------- ### get_locator_guidance Source: https://context7.com/manykarim/rf-mcp/llms.txt Returns locator strategy tips, anti-patterns, and examples for Browser (Playwright), SeleniumLibrary, or AppiumLibrary, optionally scoped to a specific error message. ```APIDOC ## `get_locator_guidance` — Selector strategy reference for web/mobile Returns locator strategy tips, anti-patterns, and examples for Browser (Playwright), SeleniumLibrary, or AppiumLibrary, optionally scoped to a specific error message. ```python tips = await get_locator_guidance( library="Browser", error_message="strict mode violation: locator('.btn') resolved to 3 elements", keyword_name="Click" ) # tips["tips"] = ["Use text=Login to match by visible text", "Use id=submit for ID-based selectors", ...] # tips["examples"] = [ # {"locator": "text=Login", "description": "Matches by visible text content"}, # {"locator": "css=button#submit", "description": "CSS selector with ID"}, # ] # Selenium guidance tips_sel = await get_locator_guidance(library="SeleniumLibrary") # tips_sel["strategies"] = {"id": "id:example", "xpath": "xpath://div[@id='x']", ...} ``` ``` -------------------------------- ### Get Connected MCP Instances in Robot Framework Source: https://github.com/manykarim/rf-mcp/blob/main/docs/robotmcp.html Example of how to retrieve a dictionary of connected MCP instances and their last seen timestamps using the 'Get Connected Instances' keyword. ```robotframework ${instances}= Get Connected Instances Log ${instances} ``` -------------------------------- ### Client Initialization Response with Instructions Source: https://github.com/manykarim/rf-mcp/blob/main/docs/INSTRUCTION_TEMPLATES_GUIDE.md Shows the JSON response from an MCP server when a client initializes. The `instructions` field contains the server-level guidance for the client. ```json { "protocolVersion": "2024-11-05", "capabilities": { ... }, "serverInfo": { "name": "Robot Framework MCP Server" }, "instructions": "rf-mcp WORKFLOW GUIDE:\n\n1. DISCOVER before EXECUTE..." } ``` -------------------------------- ### Robot Framework DemoShop Purchase Test Case Source: https://github.com/manykarim/rf-mcp/blob/main/docs/proposals/bdd-scenario-quality-improvement.md An example of a complete Robot Framework test case for the DemoShop flow, demonstrating BDD steps and keyword usage. ```robotframework *** Test Cases *** DemoShop Purchase Given the user opens the demoshop When the user adds "Sauce Labs Backpack" to the cart Then the cart badge should show "1" items When the user adds "Sauce Labs Bike Light" to the cart Then the cart badge should show "2" items When the user opens the cart Then the cart should contain "Sauce Labs Backpack" And the cart should contain "Sauce Labs Bike Light" When the user proceeds to checkout And the user enters checkout details Test User 12345 And the user completes the order Then the order confirmation is displayed *** Keywords *** the user opens the demoshop New Browser chromium headless=False New Page https://demoshop.makrocode.de/ the user adds "${product}" to the cart Click role=button[name="Add ${product} to cart"] the cart badge should show "${count}" items Get Text css=.shopping_cart_badge == ${count} the user opens the cart Click role=link[name="Cart"] the cart should contain "${product}" Get Text css=.cart_list contains ${product} the user proceeds to checkout Click text=Checkout the user enters checkout details [Arguments] ${first_name} ${last_name} ${zip} Fill Text id=first-name ${first_name} Fill Text id=last-name ${last_name} Fill Text id=postal-code ${zip} the user completes the order Click text=Continue Click text=Finish the order confirmation is displayed Get Text css=.complete-header == Thank you for your order! ``` -------------------------------- ### Robot Framework BDD Example Source: https://github.com/manykarim/rf-mcp/blob/main/docs/analysis/bdd-quality-improvement-report.md This Robot Framework code demonstrates a basic BDD structure with Given, When, and Then steps, and a Keywords section defining a behavioral keyword. ```robotframework robot ``` -------------------------------- ### Server Initialization with Instructions Source: https://github.com/manykarim/rf-mcp/blob/main/docs/INSTRUCTION_TEMPLATES_GUIDE.md Demonstrates how to initialize the FastMCP server with resolved instructions. The `instructions` variable is populated by `_resolve_server_instructions()` which handles loading the appropriate template. ```python # In server.py instructions = _resolve_server_instructions() mcp = FastMCP("Robot Framework MCP Server", instructions=instructions) ``` -------------------------------- ### check_library_availability Source: https://context7.com/manykarim/rf-mcp/llms.txt Checks whether specified Robot Framework libraries are installed and importable, returning guidance for installation when missing. ```APIDOC ## `check_library_availability` — Verify libraries can be imported Checks whether specified Robot Framework libraries are installed and importable, returning guidance for installation when missing. ```python avail = await check_library_availability(["Browser", "RequestsLibrary", "DataDriver"]) # avail["results"] = { # "Browser": {"available": True, "version": "18.9.0"}, # "RequestsLibrary": {"available": True, "version": "0.9.7"}, # "DataDriver": {"available": False, "install": "pip install robotframework-datadriver"} # } ``` ``` -------------------------------- ### Creating and Rendering a Custom Instruction Template Source: https://github.com/manykarim/rf-mcp/blob/main/docs/INSTRUCTION_TEMPLATES_GUIDE.md Illustrates defining a fully custom instruction template with placeholders and then rendering it with specific values for those placeholders. ```python # 5. Create a fully custom template custom = InstructionTemplate( template_id="my_company", content="Rules for {team}: always use {available_tools} before acting.", description="Company-specific template", placeholders=("team", "available_tools"), ) result = custom.render({"team": "QA", "available_tools": "find_keywords"}) ``` -------------------------------- ### Fetch Artifact Example Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Demonstrates how to fetch full artifact content using an artifact ID. This is useful for keeping tool responses compact while preserving access to full output on demand. ```python fetch_artifact(artifact_id="abc123") ``` -------------------------------- ### Batch Execution Example Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Shows how to use the `execute_batch` tool to run multiple keywords in a single MCP call, reducing network round-trips. Steps can reference results from earlier steps using `${STEP_N}` variables. ```python execute_batch(session_id="...", steps=[ {"keyword": "Go To", "args": ["https://example.com"]}, {"keyword": "Get Title", "assign_to": "title"}, {"keyword": "Should Be Equal", "args": ["${STEP_2}", "Example Domain"]} ], on_failure="recover") ``` -------------------------------- ### Execute Single Step: New Browser and Navigation Source: https://context7.com/manykarim/rf-mcp/llms.txt Execute Robot Framework keywords like 'New Browser' and 'Go To' to open a browser and navigate to a URL. Configure arguments and session ID. ```python # Navigate to URL and open browser await execute_step( keyword="New Browser", arguments=["chromium", "headless=False"], session_id="s1" ) await execute_step( keyword="Go To", arguments=["https://saucedemo.com"], session_id="s1", timeout_ms=60000 ) ``` -------------------------------- ### Development installation of rf-mcp with pip Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP from a cloned repository using pip. This is an alternative for developers to set up the project. ```bash git clone https://github.com/manykarim/rf-mcp.git cd rf-mcp pip install -e . ``` -------------------------------- ### Custom Instructions from File Source: https://github.com/manykarim/rf-mcp/blob/main/docs/INSTRUCTION_TEMPLATES_GUIDE.md Provide custom instruction text from a file. Ensure the file has an allowed extension (.txt, .md, .instruction, .instructions) and is not subject to directory traversal. Configure via .mcp.json. ```text COMPANY TESTING STANDARDS: 1. Always initialize sessions with libraries=["Browser", "BuiltIn", "String"] 2. Use get_session_state with include_reduced_dom=True before any interaction 3. Log all test steps with BuiltIn.Log keyword 4. Use {available_tools} for keyword discovery 5. Never hardcode URLs — use environment variables via Get Variable Value 6. Always close browser sessions after tests complete ``` ```json { "mcpServers": { "robotmcp": { "command": "uv", "args": ["run", "-m", "robotmcp.server"], "env": { "ROBOTMCP_INSTRUCTIONS": "custom", "ROBOTMCP_INSTRUCTIONS_FILE": "./my_instructions.txt" } } } } ``` -------------------------------- ### Check Library Availability Source: https://context7.com/manykarim/rf-mcp/llms.txt Verifies if specified Robot Framework libraries are installed and importable. Provides installation guidance for missing libraries. ```python avail = await check_library_availability(["Browser", "RequestsLibrary", "DataDriver"]) ``` -------------------------------- ### RF SuiteRunner vs RF-MCP Execution Order Source: https://github.com/manykarim/rf-mcp/blob/main/docs/issues/namespace_architecture/rf_mcp_namespace_review.md Compares the execution order of RF's SuiteRunner.start_suite() with rf-mcp's create_context_for_session(). Highlights differences in when namespaces, contexts, and imports are handled. ```text 1. Create Namespace 2. namespace.start_suite() ← push suite variable scope 3. set_from_variable_section() ← load *** Variables *** 4. EXECUTION_CONTEXTS.start_suite() ← push context 5. ctx.set_suite_variables() ← set ${SUITE_NAME}, ${SUITE_SOURCE} etc. 6. namespace.handle_imports() ← import BuiltIn, Easter, user libraries 7. variables.resolve_delayed() ← resolve cross-referencing variables ``` ```text 1. Create VariableScopes + manually set ${True} etc. 2. Create TestSuite + Namespace 3. import_library("BuiltIn") ← BEFORE context push (can fail!) 4. EXECUTION_CONTEXTS.start_suite() ← push context 5. namespace.start_suite() ← AFTER context push (wrong order) 6. namespace.start_test() ← immediate (double-push, see Finding 1) 7. ctx.start_test() ← double-push 8. Import user libraries ``` -------------------------------- ### Open Demoshop Keyword Source: https://github.com/manykarim/rf-mcp/blob/main/tests/e2e/metrics/bdd_e2e_20260317/bdd_experiments.md Opens a new browser instance and navigates to the Demoshop URL. This keyword is used to set up the test environment. ```robotframework *** Settings *** Library Browser *** Keywords *** the demoshop is open New Browser chromium headless=False New Page https://demoshop.makrocode.de/ ``` -------------------------------- ### Install rf-mcp with uv Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP using the uv package manager. This method is recommended for managing Python environments and dependencies. ```bash uv venv # create a virtual environment uv pip install rf-mcp ``` -------------------------------- ### FastMCP Initialization Flow Source: https://github.com/manykarim/rf-mcp/blob/main/docs/INSTRUCTION_TEMPLATES_GUIDE.md Illustrates the flow of how instruction text is resolved and passed to FastMCP upon server startup, originating from environment variables. ```text Environment Variables │ ▼ FastMCPInstructionAdapter.create_config_from_env() │ ▼ InstructionResolver.resolve(config, context) │ ▼ InstructionValidator.validate(content) │ ▼ FastMCP("Robot Framework MCP Server", instructions=) │ ▼ MCP initialize response → LLM client receives instructions ``` -------------------------------- ### Install rf-mcp with pip and memory extras Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Install RobotMCP with optional 'memory' extras using pip. This includes persistent semantic memory capabilities. ```bash pip install rf-mcp[memory] ``` -------------------------------- ### Direct Template Rendering and Token Estimation Source: https://github.com/manykarim/rf-mcp/blob/main/docs/INSTRUCTION_TEMPLATES_GUIDE.md Demonstrates rendering a specific instruction template (e.g., 'browser-focused') directly and printing its content along with an estimated token count. ```python # 3. Render a template directly template = InstructionTemplate.get_by_name("browser-focused") content = template.render({"available_tools": "find_keywords, get_keyword_info"}) print(content.value) print(f"~{content.token_estimate} tokens") ``` -------------------------------- ### Programmatic Template Selection with Context Source: https://github.com/manykarim/rf-mcp/blob/main/docs/INSTRUCTION_TEMPLATES_GUIDE.md Shows how to force a specific instruction template (e.g., 'detailed') and provide custom context like available tools during programmatic instruction retrieval. ```python # 2. Force a specific template programmatically adapter = FastMCPInstructionAdapter(template_name="detailed") config = InstructionConfig.create_default() instructions = adapter.get_server_instructions( config, context={"available_tools": "find_keywords, get_keyword_info"}, ) ``` -------------------------------- ### Intent Action Examples Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Illustrates the use of the `intent_action` tool for common test actions like clicking and filling form fields. The server resolves the intent and target to the correct library-specific keyword and locator format. ```python intent_action(intent="click", target="text=Login", session_id="...") ``` ```python intent_action(intent="fill", target="#username", value="testuser", session_id="...") ``` -------------------------------- ### Add Plugin Entry Point to pyproject.toml Source: https://github.com/manykarim/rf-mcp/blob/main/examples/plugins/sample_plugin/README.md If distributing the plugin as a Python package, add this entry point configuration to your `pyproject.toml` file to make the plugin automatically available to rf-mcp. ```toml [project.entry-points."robotmcp.library_plugins"] example_calculator = "examples.plugins.sample_plugin:ExampleCalculatorPlugin" ``` -------------------------------- ### BDD Step Grouping Examples Source: https://github.com/manykarim/rf-mcp/blob/main/docs/proposals/bdd-scenario-quality-improvement.md Examples of using `bdd_group` and `bdd_intent` parameters with `execute_step` for high-quality BDD output. Use domain language for `bdd_group` values. ```python execute_step(keyword="Click", arguments=["role=link[name='Products']"], bdd_group="navigate to products", bdd_intent="when") execute_step(keyword="Click", arguments=["button[aria-label='Add X to cart']"], bdd_group="add product to cart", bdd_intent="when") execute_step(keyword="Get Text", arguments=["[data-cart-count]", "==", "1"], bdd_group="verify cart count", bdd_intent="then") ``` -------------------------------- ### Generated BDD Test Case Example Source: https://github.com/manykarim/rf-mcp/blob/main/tests/e2e/metrics/bdd_e2e_20260317/bdd_experiments.md An example of a generated BDD test case based on a heuristic for auto-generating keyword names from a sequence of actions. ```Robot Framework Given the demoshop is open When the user fills in the form Then the cart shows the expected value When the user clicks add sauce labs bike light to cart Then the cart shows the expected value When the user clicks cart Then the expected results are verified When the user fills in the form Then the complete header shows the expected value ``` -------------------------------- ### Start MCP Server Source: https://github.com/manykarim/rf-mcp/blob/main/docs/robotmcp.html Starts the MCP attach bridge, aliased as MCP Serve. This keyword is for backward compatibility. It can be configured with port, token, mode, and polling interval. ```robotframework MCP Start mode=blocking ``` -------------------------------- ### Start MCP Server in Blocking Step Mode Source: https://github.com/manykarim/rf-mcp/blob/main/docs/robotmcp.html Starts the bridge server in blocking mode, processing one command at a time. Use this for sequential command execution. ```robotframework MCP Serve mode=blocking MCP Serve port=7320 token=${TOKEN} mode=step ``` -------------------------------- ### Programmatic Instruction Loading and Resolution Source: https://github.com/manykarim/rf-mcp/blob/main/docs/INSTRUCTION_TEMPLATES_GUIDE.md Illustrates loading instruction configuration from environment variables and resolving server instructions using `FastMCPInstructionAdapter`. This is the standard usage for programmatic control. ```python from robotmcp.domains.instruction import ( FastMCPInstructionAdapter, InstructionConfig, InstructionTemplate, InstructionResolver, InstructionRenderer, ) # 1. Load config from environment (standard usage) adapter = FastMCPInstructionAdapter() config = adapter.create_config_from_env() instructions = adapter.get_server_instructions(config) ``` -------------------------------- ### MCP Server Setup with UV Source: https://github.com/manykarim/rf-mcp/blob/main/README.md Configure the RobotMCP server using UV with environment variables for the Debug Bridge. Ensure the token matches the one used in the Robot Framework suite. ```json { "servers": { "RobotMCP": { "type": "stdio", "command": "uv", "args": ["run", "src/robotmcp/server.py"], "env": { "ROBOTMCP_ATTACH_HOST": "127.0.0.1", "ROBOTMCP_ATTACH_PORT": "7317", "ROBOTMCP_ATTACH_TOKEN": "change-me", "ROBOTMCP_ATTACH_DEFAULT": "auto" } } } } ``` -------------------------------- ### Install RobotMCP Core and Extras Source: https://context7.com/manykarim/rf-mcp/llms.txt Install the RobotMCP package using pip. Use extras like [web], [mobile], [api], or [all] for additional library support. Add to Claude Code using the 'claude mcp add' command. ```bash # Minimal core pip install rf-mcp # With web/mobile/API library extras pip install rf-mcp[web] # Browser Library + SeleniumLibrary pip install rf-mcp[mobile] # AppiumLibrary pip install rf-mcp[api] # RequestsLibrary pip install rf-mcp[all] # All extras # Add to Claude Code claude mcp add rf-mcp -- uvx rf-mcp ``` -------------------------------- ### Get Connected Instances Source: https://github.com/manykarim/rf-mcp/blob/main/docs/robotmcp.html Retrieves a dictionary of connected instances and their last seen timestamps. ```APIDOC ## Get Connected Instances ### Description Get dictionary of connected instances and their last seen timestamps. ### Method N/A (Keyword) ### Returns * **Dict[str, float]** - A dictionary mapping instance IDs to their last seen timestamps. ``` -------------------------------- ### McpAttach Library Initialization Source: https://github.com/manykarim/rf-mcp/blob/main/docs/robotmcp.html Initializes the McpAttach library, configuring the host, port, and token for the HTTP bridge. ```APIDOC ## Library Initialization ### Description Initializes the McpAttach library with optional host, port, and token. ### Arguments * **host** (string, optional, default=127.0.0.1) - The host address for the HTTP bridge. * **port** (integer, optional, default=7317) - The port number for the HTTP bridge. * **token** (string, optional, default=change-me) - The authentication token for the HTTP bridge. ``` -------------------------------- ### Initialize Buffer Source: https://github.com/manykarim/rf-mcp/blob/main/docs/robotmcp.html Initializes a buffer with a quoted empty string. This is a boilerplate setup for string manipulation in code generation. ```javascript initializeBuffer:function(){ return this.quotedString("") } ``` -------------------------------- ### Prepare Program Source: https://github.com/manykarim/rf-mcp/blob/main/docs/robotmcp.html Prepares a program, which is a sequence of statements. ```javascript eu=function(e,t){if(!t&&e.length){var r=e[0].loc,n=e[e.length-1].loc;r&&n&&(t={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:n.end.line,column:n.end.column}})}return{type:"Program",body:e,strip:{},loc:t}} ``` -------------------------------- ### Troubleshoot Module Not Found Error Source: https://github.com/manykarim/rf-mcp/blob/main/examples/plugins/doctest_plugin/README.md If you encounter a 'ModuleNotFoundError', ensure the plugin package is installed within the same virtual environment as rf-mcp. ```bash uv pip install --editable examples/plugins/doctest_plugin ```