rf-mcp 0.1.0.dev0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,324 @@
1
+ Metadata-Version: 2.4
2
+ Name: rf-mcp
3
+ Version: 0.1.0.dev0
4
+ Summary: Robot Framework MCP Server - Natural Language Test Automation Bridge
5
+ Author: Robot MCP Team
6
+ License: MIT
7
+ Requires-Python: >=3.10
8
+ Requires-Dist: aiohttp>=3.8.0
9
+ Requires-Dist: asyncio-mqtt
10
+ Requires-Dist: beautifulsoup4>=4.11.0
11
+ Requires-Dist: fastmcp>=2.0.0
12
+ Requires-Dist: lxml>=4.9.0
13
+ Requires-Dist: numpy>=1.21.0
14
+ Requires-Dist: pydantic>=2.0.0
15
+ Requires-Dist: robotframework-databaselibrary
16
+ Requires-Dist: robotframework-requests
17
+ Requires-Dist: robotframework-seleniumlibrary
18
+ Requires-Dist: robotframework>=6.0
19
+ Requires-Dist: scipy>=1.7.0
20
+ Requires-Dist: sentence-transformers>=2.2.0
21
+ Provides-Extra: dev
22
+ Requires-Dist: black>=22.0.0; extra == 'dev'
23
+ Requires-Dist: mypy>=1.0.0; extra == 'dev'
24
+ Requires-Dist: pre-commit>=2.20.0; extra == 'dev'
25
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
26
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
27
+ Description-Content-Type: text/markdown
28
+
29
+ # Robot Framework MCP Server
30
+
31
+ A Model Context Protocol (MCP) server that provides an intelligent bridge between natural language test descriptions and Robot Framework execution. This server enables AI agents to dynamically create and execute Robot Framework test steps from natural language, then generate complete test suites from successful executions.
32
+
33
+ ## Features
34
+
35
+ - **Natural Language Processing**: Converts human language test descriptions into structured test actions
36
+ - **Semantic Keyword Matching**: Uses AI to find the most appropriate Robot Framework keywords for each action
37
+ - **Interactive Test Execution**: Execute test steps individually with real-time state tracking
38
+ - **State-Aware Testing**: Captures and analyzes application state after each step
39
+ - **Intelligent Suggestions**: AI-driven recommendations for next test steps
40
+ - **Test Suite Generation**: Automatically generates optimized Robot Framework test suites
41
+ - **Multi-Context Support**: Handles web, mobile, API, and database testing scenarios
42
+
43
+ ## Architecture
44
+
45
+ ### Core Components
46
+
47
+ 1. **Natural Language Processor** - Analyzes test scenarios and extracts structured actions
48
+ 2. **Keyword Matcher** - Maps natural language actions to Robot Framework keywords using semantic similarity
49
+ 3. **Execution Engine** - Executes Robot Framework keywords and manages test sessions
50
+ 4. **State Manager** - Tracks application state (DOM, API responses, database state)
51
+ 5. **Test Builder** - Converts successful execution paths into optimized Robot Framework test suites
52
+
53
+ ## MCP Tools
54
+
55
+ The server provides 7 MCP tools for comprehensive test automation:
56
+
57
+ ### 1. `analyze_scenario`
58
+ Process natural language test descriptions into structured test intents.
59
+
60
+ ```json
61
+ {
62
+ "scenario": "Test that users can search for products and add them to cart",
63
+ "context": "web"
64
+ }
65
+ ```
66
+
67
+ ### 2. `discover_keywords`
68
+ Find matching Robot Framework keywords for specific actions.
69
+
70
+ ```json
71
+ {
72
+ "action_description": "click the login button",
73
+ "context": "web",
74
+ "current_state": {}
75
+ }
76
+ ```
77
+
78
+ ### 3. `execute_step`
79
+ Execute individual Robot Framework keywords with session management.
80
+
81
+ ```json
82
+ {
83
+ "keyword": "Open Browser",
84
+ "arguments": ["https://example.com", "chrome"],
85
+ "session_id": "default"
86
+ }
87
+ ```
88
+
89
+ ### 4. `get_application_state`
90
+ Retrieve current application state for decision making.
91
+
92
+ ```json
93
+ {
94
+ "state_type": "dom",
95
+ "elements_of_interest": ["button", "input"],
96
+ "session_id": "default"
97
+ }
98
+ ```
99
+
100
+ ### 5. `suggest_next_step`
101
+ Get AI-driven suggestions for the next test step.
102
+
103
+ ```json
104
+ {
105
+ "current_state": {...},
106
+ "test_objective": "complete user login",
107
+ "executed_steps": [...],
108
+ "session_id": "default"
109
+ }
110
+ ```
111
+
112
+ ### 6. `build_test_suite`
113
+ Generate Robot Framework test suite from successful execution.
114
+
115
+ ```json
116
+ {
117
+ "session_id": "default",
118
+ "test_name": "User Login Test",
119
+ "tags": ["login", "smoke"],
120
+ "documentation": "Test successful user login flow"
121
+ }
122
+ ```
123
+
124
+ ### 7. `validate_scenario`
125
+ Validate scenario feasibility before execution.
126
+
127
+ ```json
128
+ {
129
+ "parsed_scenario": {...},
130
+ "available_libraries": ["SeleniumLibrary", "BuiltIn"]
131
+ }
132
+ ```
133
+
134
+ ## Installation
135
+
136
+ ```bash
137
+ # Clone the repository
138
+ git clone <repository-url>
139
+ cd robotmcp
140
+
141
+ # Install dependencies using uv (recommended)
142
+ uv sync
143
+
144
+ # Or install using pip
145
+ pip install -e .
146
+
147
+ # Install optional dependencies for full functionality
148
+ pip install sentence-transformers beautifulsoup4
149
+ ```
150
+
151
+ ## Usage
152
+
153
+ ### Starting the Server
154
+
155
+ Using uv (recommended):
156
+ ```bash
157
+ uv run python src/robotmcp/server.py
158
+ ```
159
+
160
+ Or using the FastMCP CLI:
161
+ ```bash
162
+ uv run fastmcp run src/robotmcp/server.py
163
+ ```
164
+
165
+ Traditional method:
166
+ ```bash
167
+ robotmcp
168
+ ```
169
+
170
+ ### Example Workflow
171
+
172
+ 1. **Analyze a test scenario**:
173
+ ```
174
+ "Test login functionality with valid credentials showing dashboard"
175
+ ```
176
+
177
+ 2. **Execute steps interactively**:
178
+ - Import SeleniumLibrary
179
+ - Open Browser to login page
180
+ - Enter username and password
181
+ - Click login button
182
+ - Verify dashboard appears
183
+
184
+ 3. **Generate test suite**:
185
+ - Optimized Robot Framework test case
186
+ - Complete with imports, setup, and teardown
187
+ - Ready for execution in CI/CD pipelines
188
+
189
+ ### Integration with Claude Desktop
190
+
191
+ Add to your Claude Desktop MCP configuration using FastMCP 2.0:
192
+
193
+ ```json
194
+ {
195
+ "mcpServers": {
196
+ "robotmcp": {
197
+ "command": "uv",
198
+ "args": [
199
+ "run",
200
+ "--with",
201
+ "fastmcp",
202
+ "fastmcp",
203
+ "run",
204
+ "/path/to/robotmcp/src/robotmcp/server.py"
205
+ ],
206
+ "cwd": "/path/to/robotmcp"
207
+ }
208
+ }
209
+ }
210
+ ```
211
+
212
+ Or generate the configuration automatically using FastMCP CLI:
213
+ ```bash
214
+ uv run fastmcp install mcp-json src/robotmcp/server.py --name "Robot Framework MCP"
215
+ ```
216
+
217
+ ## Dependencies
218
+
219
+ ### Required
220
+ - `robotframework>=6.0`
221
+ - `fastmcp>=2.0.0`
222
+ - `pydantic>=2.0.0`
223
+ - `aiohttp>=3.8.0`
224
+
225
+ ### Optional (for enhanced functionality)
226
+ - `sentence-transformers>=2.2.0` - For semantic keyword matching
227
+ - `beautifulsoup4>=4.11.0` - For DOM parsing
228
+ - `robotframework-seleniumlibrary` - For web automation
229
+ - `robotframework-requests` - For API testing
230
+ - `robotframework-databaselibrary` - For database testing
231
+
232
+ ## Supported Test Contexts
233
+
234
+ - **Web Applications**: Using SeleniumLibrary for browser automation
235
+ - **Mobile Applications**: Using AppiumLibrary for mobile testing
236
+ - **API Testing**: Using RequestsLibrary for HTTP/REST APIs
237
+ - **Database Testing**: Using DatabaseLibrary for SQL operations
238
+
239
+ ## Example Generated Test Suite
240
+
241
+ ```robot
242
+ *** Settings ***
243
+ Documentation Test case that opens browser, navigates to page, enters data, performs click action, verifies result.
244
+ Library SeleniumLibrary
245
+ Library BuiltIn
246
+ Force Tags automated generated web
247
+
248
+ *** Test Cases ***
249
+ User Login Test
250
+ [Documentation] Test successful user login flow
251
+ [Tags] login smoke
252
+ Open Browser https://example.com chrome # Open chrome and navigate to https://example.com
253
+ Go To https://example.com/login
254
+ Input Text id=username testuser # Enter 'testuser' into id=username
255
+ Input Text id=password testpass # Enter 'testpass' into id=password
256
+ Click Button id=login-btn # Click on id=login-btn
257
+ Page Should Contain Welcome # Verify page contains 'Welcome'
258
+ [Teardown] Close Browser # Cleanup: Close browser
259
+ ```
260
+
261
+ ## Development
262
+
263
+ ### Running Tests
264
+
265
+ ```bash
266
+ pytest tests/
267
+ ```
268
+
269
+ ### Code Quality
270
+
271
+ ```bash
272
+ # Format code
273
+ black src/
274
+
275
+ # Type checking
276
+ mypy src/
277
+
278
+ # Linting
279
+ flake8 src/
280
+ ```
281
+
282
+ ## Contributing
283
+
284
+ 1. Fork the repository
285
+ 2. Create a feature branch
286
+ 3. Make your changes
287
+ 4. Add tests for new functionality
288
+ 5. Submit a pull request
289
+
290
+ ## License
291
+
292
+ MIT License - see LICENSE file for details.
293
+
294
+ ## Support
295
+
296
+ - Create issues for bugs or feature requests
297
+ - Check the documentation for detailed usage examples
298
+ - Join our community discussions
299
+
300
+ ## FastMCP 2.0 Migration
301
+
302
+ This project has been successfully migrated from MCP 1.0 to FastMCP 2.0, bringing the following improvements:
303
+
304
+ ### Key Changes
305
+ - **Simplified Server Definition**: Uses FastMCP's declarative approach with decorators
306
+ - **Improved Performance**: Better transport handling and connection management
307
+ - **Enhanced Developer Experience**: More intuitive API and better error messages
308
+ - **Better Integration**: Seamless integration with modern MCP clients
309
+
310
+ ### Migration Notes
311
+ - Dependencies updated from `mcp>=1.0.0` to `fastmcp>=2.0.0`
312
+ - Server implementation converted to use FastMCP's decorator-based tools
313
+ - Maintained full backward compatibility with existing MCP protocol features
314
+ - All 7 MCP tools (analyze_scenario, discover_keywords, execute_step, etc.) preserved
315
+
316
+ ### Running with FastMCP 2.0
317
+ The server can be run in multiple ways:
318
+ 1. **Direct Python execution**: `uv run python src/robotmcp/server.py`
319
+ 2. **FastMCP CLI**: `uv run fastmcp run src/robotmcp/server.py`
320
+ 3. **MCP Client Integration**: Use generated JSON configuration
321
+
322
+ ---
323
+
324
+ **Note**: This is an MVP implementation focused on demonstrating the core concept. Production use would require additional error handling, security considerations, and integration with actual Robot Framework execution environments.
@@ -0,0 +1,296 @@
1
+ # Robot Framework MCP Server
2
+
3
+ A Model Context Protocol (MCP) server that provides an intelligent bridge between natural language test descriptions and Robot Framework execution. This server enables AI agents to dynamically create and execute Robot Framework test steps from natural language, then generate complete test suites from successful executions.
4
+
5
+ ## Features
6
+
7
+ - **Natural Language Processing**: Converts human language test descriptions into structured test actions
8
+ - **Semantic Keyword Matching**: Uses AI to find the most appropriate Robot Framework keywords for each action
9
+ - **Interactive Test Execution**: Execute test steps individually with real-time state tracking
10
+ - **State-Aware Testing**: Captures and analyzes application state after each step
11
+ - **Intelligent Suggestions**: AI-driven recommendations for next test steps
12
+ - **Test Suite Generation**: Automatically generates optimized Robot Framework test suites
13
+ - **Multi-Context Support**: Handles web, mobile, API, and database testing scenarios
14
+
15
+ ## Architecture
16
+
17
+ ### Core Components
18
+
19
+ 1. **Natural Language Processor** - Analyzes test scenarios and extracts structured actions
20
+ 2. **Keyword Matcher** - Maps natural language actions to Robot Framework keywords using semantic similarity
21
+ 3. **Execution Engine** - Executes Robot Framework keywords and manages test sessions
22
+ 4. **State Manager** - Tracks application state (DOM, API responses, database state)
23
+ 5. **Test Builder** - Converts successful execution paths into optimized Robot Framework test suites
24
+
25
+ ## MCP Tools
26
+
27
+ The server provides 7 MCP tools for comprehensive test automation:
28
+
29
+ ### 1. `analyze_scenario`
30
+ Process natural language test descriptions into structured test intents.
31
+
32
+ ```json
33
+ {
34
+ "scenario": "Test that users can search for products and add them to cart",
35
+ "context": "web"
36
+ }
37
+ ```
38
+
39
+ ### 2. `discover_keywords`
40
+ Find matching Robot Framework keywords for specific actions.
41
+
42
+ ```json
43
+ {
44
+ "action_description": "click the login button",
45
+ "context": "web",
46
+ "current_state": {}
47
+ }
48
+ ```
49
+
50
+ ### 3. `execute_step`
51
+ Execute individual Robot Framework keywords with session management.
52
+
53
+ ```json
54
+ {
55
+ "keyword": "Open Browser",
56
+ "arguments": ["https://example.com", "chrome"],
57
+ "session_id": "default"
58
+ }
59
+ ```
60
+
61
+ ### 4. `get_application_state`
62
+ Retrieve current application state for decision making.
63
+
64
+ ```json
65
+ {
66
+ "state_type": "dom",
67
+ "elements_of_interest": ["button", "input"],
68
+ "session_id": "default"
69
+ }
70
+ ```
71
+
72
+ ### 5. `suggest_next_step`
73
+ Get AI-driven suggestions for the next test step.
74
+
75
+ ```json
76
+ {
77
+ "current_state": {...},
78
+ "test_objective": "complete user login",
79
+ "executed_steps": [...],
80
+ "session_id": "default"
81
+ }
82
+ ```
83
+
84
+ ### 6. `build_test_suite`
85
+ Generate Robot Framework test suite from successful execution.
86
+
87
+ ```json
88
+ {
89
+ "session_id": "default",
90
+ "test_name": "User Login Test",
91
+ "tags": ["login", "smoke"],
92
+ "documentation": "Test successful user login flow"
93
+ }
94
+ ```
95
+
96
+ ### 7. `validate_scenario`
97
+ Validate scenario feasibility before execution.
98
+
99
+ ```json
100
+ {
101
+ "parsed_scenario": {...},
102
+ "available_libraries": ["SeleniumLibrary", "BuiltIn"]
103
+ }
104
+ ```
105
+
106
+ ## Installation
107
+
108
+ ```bash
109
+ # Clone the repository
110
+ git clone <repository-url>
111
+ cd robotmcp
112
+
113
+ # Install dependencies using uv (recommended)
114
+ uv sync
115
+
116
+ # Or install using pip
117
+ pip install -e .
118
+
119
+ # Install optional dependencies for full functionality
120
+ pip install sentence-transformers beautifulsoup4
121
+ ```
122
+
123
+ ## Usage
124
+
125
+ ### Starting the Server
126
+
127
+ Using uv (recommended):
128
+ ```bash
129
+ uv run python src/robotmcp/server.py
130
+ ```
131
+
132
+ Or using the FastMCP CLI:
133
+ ```bash
134
+ uv run fastmcp run src/robotmcp/server.py
135
+ ```
136
+
137
+ Traditional method:
138
+ ```bash
139
+ robotmcp
140
+ ```
141
+
142
+ ### Example Workflow
143
+
144
+ 1. **Analyze a test scenario**:
145
+ ```
146
+ "Test login functionality with valid credentials showing dashboard"
147
+ ```
148
+
149
+ 2. **Execute steps interactively**:
150
+ - Import SeleniumLibrary
151
+ - Open Browser to login page
152
+ - Enter username and password
153
+ - Click login button
154
+ - Verify dashboard appears
155
+
156
+ 3. **Generate test suite**:
157
+ - Optimized Robot Framework test case
158
+ - Complete with imports, setup, and teardown
159
+ - Ready for execution in CI/CD pipelines
160
+
161
+ ### Integration with Claude Desktop
162
+
163
+ Add to your Claude Desktop MCP configuration using FastMCP 2.0:
164
+
165
+ ```json
166
+ {
167
+ "mcpServers": {
168
+ "robotmcp": {
169
+ "command": "uv",
170
+ "args": [
171
+ "run",
172
+ "--with",
173
+ "fastmcp",
174
+ "fastmcp",
175
+ "run",
176
+ "/path/to/robotmcp/src/robotmcp/server.py"
177
+ ],
178
+ "cwd": "/path/to/robotmcp"
179
+ }
180
+ }
181
+ }
182
+ ```
183
+
184
+ Or generate the configuration automatically using FastMCP CLI:
185
+ ```bash
186
+ uv run fastmcp install mcp-json src/robotmcp/server.py --name "Robot Framework MCP"
187
+ ```
188
+
189
+ ## Dependencies
190
+
191
+ ### Required
192
+ - `robotframework>=6.0`
193
+ - `fastmcp>=2.0.0`
194
+ - `pydantic>=2.0.0`
195
+ - `aiohttp>=3.8.0`
196
+
197
+ ### Optional (for enhanced functionality)
198
+ - `sentence-transformers>=2.2.0` - For semantic keyword matching
199
+ - `beautifulsoup4>=4.11.0` - For DOM parsing
200
+ - `robotframework-seleniumlibrary` - For web automation
201
+ - `robotframework-requests` - For API testing
202
+ - `robotframework-databaselibrary` - For database testing
203
+
204
+ ## Supported Test Contexts
205
+
206
+ - **Web Applications**: Using SeleniumLibrary for browser automation
207
+ - **Mobile Applications**: Using AppiumLibrary for mobile testing
208
+ - **API Testing**: Using RequestsLibrary for HTTP/REST APIs
209
+ - **Database Testing**: Using DatabaseLibrary for SQL operations
210
+
211
+ ## Example Generated Test Suite
212
+
213
+ ```robot
214
+ *** Settings ***
215
+ Documentation Test case that opens browser, navigates to page, enters data, performs click action, verifies result.
216
+ Library SeleniumLibrary
217
+ Library BuiltIn
218
+ Force Tags automated generated web
219
+
220
+ *** Test Cases ***
221
+ User Login Test
222
+ [Documentation] Test successful user login flow
223
+ [Tags] login smoke
224
+ Open Browser https://example.com chrome # Open chrome and navigate to https://example.com
225
+ Go To https://example.com/login
226
+ Input Text id=username testuser # Enter 'testuser' into id=username
227
+ Input Text id=password testpass # Enter 'testpass' into id=password
228
+ Click Button id=login-btn # Click on id=login-btn
229
+ Page Should Contain Welcome # Verify page contains 'Welcome'
230
+ [Teardown] Close Browser # Cleanup: Close browser
231
+ ```
232
+
233
+ ## Development
234
+
235
+ ### Running Tests
236
+
237
+ ```bash
238
+ pytest tests/
239
+ ```
240
+
241
+ ### Code Quality
242
+
243
+ ```bash
244
+ # Format code
245
+ black src/
246
+
247
+ # Type checking
248
+ mypy src/
249
+
250
+ # Linting
251
+ flake8 src/
252
+ ```
253
+
254
+ ## Contributing
255
+
256
+ 1. Fork the repository
257
+ 2. Create a feature branch
258
+ 3. Make your changes
259
+ 4. Add tests for new functionality
260
+ 5. Submit a pull request
261
+
262
+ ## License
263
+
264
+ MIT License - see LICENSE file for details.
265
+
266
+ ## Support
267
+
268
+ - Create issues for bugs or feature requests
269
+ - Check the documentation for detailed usage examples
270
+ - Join our community discussions
271
+
272
+ ## FastMCP 2.0 Migration
273
+
274
+ This project has been successfully migrated from MCP 1.0 to FastMCP 2.0, bringing the following improvements:
275
+
276
+ ### Key Changes
277
+ - **Simplified Server Definition**: Uses FastMCP's declarative approach with decorators
278
+ - **Improved Performance**: Better transport handling and connection management
279
+ - **Enhanced Developer Experience**: More intuitive API and better error messages
280
+ - **Better Integration**: Seamless integration with modern MCP clients
281
+
282
+ ### Migration Notes
283
+ - Dependencies updated from `mcp>=1.0.0` to `fastmcp>=2.0.0`
284
+ - Server implementation converted to use FastMCP's decorator-based tools
285
+ - Maintained full backward compatibility with existing MCP protocol features
286
+ - All 7 MCP tools (analyze_scenario, discover_keywords, execute_step, etc.) preserved
287
+
288
+ ### Running with FastMCP 2.0
289
+ The server can be run in multiple ways:
290
+ 1. **Direct Python execution**: `uv run python src/robotmcp/server.py`
291
+ 2. **FastMCP CLI**: `uv run fastmcp run src/robotmcp/server.py`
292
+ 3. **MCP Client Integration**: Use generated JSON configuration
293
+
294
+ ---
295
+
296
+ **Note**: This is an MVP implementation focused on demonstrating the core concept. Production use would require additional error handling, security considerations, and integration with actual Robot Framework execution environments.
@@ -0,0 +1,59 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "rf-mcp"
7
+ version = "0.1.0dev"
8
+ description = "Robot Framework MCP Server - Natural Language Test Automation Bridge"
9
+ authors = [{name = "Robot MCP Team"}]
10
+ license = {text = "MIT"}
11
+ readme = "README.md"
12
+ requires-python = ">=3.10"
13
+ dependencies = [
14
+ "fastmcp>=2.0.0",
15
+ "robotframework>=6.0",
16
+ "sentence-transformers>=2.2.0",
17
+ "numpy>=1.21.0",
18
+ "scipy>=1.7.0",
19
+ "pydantic>=2.0.0",
20
+ "asyncio-mqtt",
21
+ "aiohttp>=3.8.0",
22
+ "beautifulsoup4>=4.11.0",
23
+ "lxml>=4.9.0",
24
+ "robotframework-seleniumlibrary",
25
+ "robotframework-requests",
26
+ "robotframework-databaselibrary"
27
+ ]
28
+
29
+ [project.optional-dependencies]
30
+ dev = [
31
+ "pytest>=7.0.0",
32
+ "pytest-asyncio>=0.21.0",
33
+ "black>=22.0.0",
34
+ "mypy>=1.0.0",
35
+ "pre-commit>=2.20.0"
36
+ ]
37
+
38
+ [project.scripts]
39
+ robotmcp = "robotmcp.server:main"
40
+
41
+ [tool.hatch.build.targets.wheel]
42
+ packages = ["src/robotmcp"]
43
+
44
+ [tool.hatch.build.targets.sdist]
45
+ include = [
46
+ "src/robotmcp",
47
+ "README.md",
48
+ "pyproject.toml",
49
+ ]
50
+
51
+ [tool.black]
52
+ line-length = 88
53
+ target-version = ['py38']
54
+
55
+ [tool.mypy]
56
+ python_version = "3.10"
57
+ warn_return_any = true
58
+ warn_unused_configs = true
59
+ disallow_untyped_defs = true
@@ -0,0 +1,3 @@
1
+ """Robot Framework MCP Server - Natural Language Test Automation Bridge."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1 @@
1
+ """Core components for Robot Framework MCP Server."""