rf-mcp 0.1.0.dev0__py3-none-any.whl

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,14 @@
1
+ robotmcp/__init__.py,sha256=dgthoYx5LlgEyhqpxSWJAk4seuFIxMnJLwhWAs5qUkQ,98
2
+ robotmcp/server.py,sha256=_groyXC7HMM_H_TCBo1Q2FHzINuPV2Yk0Dsxx_7E7Oc,4587
3
+ robotmcp/components/__init__.py,sha256=LnOp6lg41d5EsQ8Rwvlq7Nmabhw3NwXZbuIOW-yObxU,53
4
+ robotmcp/components/execution_engine.py,sha256=GCv_Rohwdd2QXT4PLXJT4Iki38R8i1MgUIXomPg4yeU,18980
5
+ robotmcp/components/keyword_matcher.py,sha256=RPfnySSma_zbDobWTPpjpqdGDn2ideaMrbhNWuEAfdw,23959
6
+ robotmcp/components/nlp_processor.py,sha256=O_s-LDj6yqiPHJF5bGFTIv11Qod2U12AjRIp6a8G-To,22648
7
+ robotmcp/components/state_manager.py,sha256=W68JV_pszT9AdGMt8xkCffFH92MPNC0s7vP8_6jfShM,22294
8
+ robotmcp/components/test_builder.py,sha256=J5JCfosDO-Aky9l9a0EYBB0SH0BUgpebZ5o_qk1VxEw,23759
9
+ robotmcp/utils/__init__.py,sha256=JbZ4l9J1nJ2O5Uh1qnGu9q01k7J8daffo-tr6t9AnJA,53
10
+ robotmcp/utils/validation.py,sha256=lCykVa8AeZmeJoV4RCKBS61DbFY79ZJEMLx6HgrrGMM,12948
11
+ rf_mcp-0.1.0.dev0.dist-info/METADATA,sha256=mTWqVP75FQJdiaxxBGXoq9OL6nTzlisD8z1dgp9AabI,9022
12
+ rf_mcp-0.1.0.dev0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
13
+ rf_mcp-0.1.0.dev0.dist-info/entry_points.txt,sha256=q_0chRKKJm9swvoz0bNyHCCQT5gbzPvNCPovadS14Gg,50
14
+ rf_mcp-0.1.0.dev0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ robotmcp = robotmcp.server:main
robotmcp/__init__.py ADDED
@@ -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."""