refact icon indicating copy to clipboard operation
refact copied to clipboard

[Docs] : Set Up MCP & Tools to Give Agent Full Power

Open avie66 opened this issue 5 months ago • 2 comments

What to do: Set up a few MCPs, cmdline, cmdline_service to give agent full information without mannual feedback (run tests, work with custom db, compile, etc.)

What to include:

What you set up Screenshot of setup or terminal What it enabled the Agent to do

Why it matters: Great for advanced users — lets the Agent go beyond just reading code.

Link to guidelines : https://refact.fibery.io/Community/Creating-use-cases-for-Refact-docs-627?sharing-key=b2ad497c-14ff-4235-a16c-b32146f702c3

avie66 avatar Jul 15 '25 13:07 avie66

Setting Up MCPs for Autonomous Refact.AI Development

Introduction

Model Context Protocols (MCPs) transform your Refact.AI agent from a code assistant into a fully autonomous development partner. By configuring playwright, cmdline and cmdline_service MCPs, you enable the agent to execute tests, interact with databases, compile projects, deployed website assessment, and handle complex workflows without requiring manual intervention at every step.

Setup Requirements

Before configuring MCPs, ensure you have:

  • Refact.AI installed and running
  • Command line access on your system

Configuration Guide

1. Install Required MCP Packages

Option A

Run the following commands to install the necessary MCP servers:

# Install cmdline MCP server
npm install -g @modelcontextprotocol/server-cmdline

# Install cmdline service MCP server  
npm install -g @modelcontextprotocol/server-cmdline-service

Option B (preferred)

Go to Refact.AI Integrations -> choose integration you want (cmdline) -> confgure command name -> ask Refact.AI to configure the rest and follow the instruction

2. Configure Refact.AI Playwright MCP Settings

Open your Refact.AI configuration file and add the MCP server configurations:

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp@latest",
        "--browser",
        "firefox"
      ]
    }
  }
}

3. Test Agent Capabilities

Create a simple test to verify the setup works:

# Ask the agent to run this command
echo "Testing MCP cmdline integration" > test.txt && cat test.txt

The agent should execute this command directly and return the output without requiring your manual intervention.

Image

What This Enables

With cmdline and playwright MCPs configured, your Refact.AI agent can now:

Execute Development Workflows

  • Run unit tests and integration tests automatically (e.g. open deployed website, find security issues and leaked keys)
  • Compile and build projects across different languages
  • Execute database migrations and queries
  • Deploy applications and manage services

Handle Complex Tasks

  • Debug issues by running diagnostic commands (open website and make a screenshot using playwright to see appearance)
  • Install dependencies and manage package versions (pip install, npm run)
  • Generate reports by executing data processing scripts
  • Manage git operations and version control tasks

Work Independently

  • Complete multi-step development tasks without interruption
  • Verify changes by running comprehensive test suites
  • Troubleshoot problems by executing system commands
  • Maintain development environments automatically

Example

Image

Key Takeaways

Maximum Autonomy: MCPs eliminate the constant back-and-forth of manual command execution, letting the agent handle complete development workflows independently.

Enhanced Debugging: The agent can now investigate issues by running diagnostic commands, checking logs, and executing troubleshooting steps automatically.

Streamlined Testing: Automated test execution means faster feedback loops and more thorough validation of code changes.

Production-Ready Workflows: With full command line access, the agent can handle deployment, monitoring, and maintenance tasks typically requiring human oversight.

Security Consideration: Only enable these MCPs in trusted development environments, as they grant significant system access to the AI agent.

venky-cmyk avatar Jul 25 '25 20:07 venky-cmyk

Thank you @venky-cmyk for contributing here! We will let you know in case we want any changes

avie66 avatar Jul 29 '25 07:07 avie66