Content
# SWRDMCPServer
SWRD MCP Server, support Redfish, IPMI, playwright command forward
## 1 CodeBuddy MCP Configuration
Copy the entire `.codebuddy` directory to your project code directory, allowing CodeBuddy to use the skills and rules files inside.
In the CodeBuddy MCP configuration, perform the following configuration:
```json
{
"mcpServers": {
"SWRDMCPServer": {
"url": "http://10.41.6.8:8000/mcp",
"transport": "streamable-http",
"headers": {
"Authorization": "Basic YWRtaW46YWRtaW4="
},
"disabled": false
}
}
}
```
The `"url": "http://10.41.6.8:8000/mcp"` is the IP address where SWRDMCPServer is running.
The `"Authorization": "Basic YWRtaW46YWRtaW4="` requires changing the string after `Basic` to your domain account and password. For example, if your domain account is `admin` and password is also `admin`, you need to base64 encode the string `admin:admin` (you can use an AI to encode it).
No modifications are needed for the remaining fields.
## 2 Customizing rules & skills files
### 2.1 Customizing the rules file
In the `SystemTest.mdc` file, you need to customize it according to your test environment, including the IP of your green zone PC and BMC device.
Green zone PC IP configuration:
```json
## Test PC (PC Agent)
- Large network IP (used by MCP server): 10.41.6.8
- Device network IP (used to access BMC): 192.168.106.43
- PC agent port: 8888
- PC agent address: http://10.41.6.8:8888
```
Specify the large network IP and small network IP of your green zone PC.
BMC device IP information:
```json
## Test Device (BMC)
- Test device IP: 192.168.88.222
- Test device username: admin
- Test device password: h3c@1234
```
Include the device's IP address and username/password information.
If you need to perform serial operations and FTP file downloads, you also need to configure:
```json
## Serial Port
- Test device serial port switch port: 192.168.0.200:3004
## Firmware Upgrade Configuration
- FTP server address: 10.141.228.15
- FTP username: ftp-CCSPLSmart1
- FTP password: X2HWrK
- Firmware file path: /data-out/xxx/xxx
- Complete firmware URI: ftp://ftp-CCSPLSmart1:X2HWrK@10.141.228.15/data-out/w33199/0428/HDM3_3.05.01_FTC_signed.bin
```
### 2.2 Customizing skills
The skill for automated testing of BMC is `system-test`. This skill defines test cases for each module, but currently only uses the user management module as an example.
`system-test/module case/user management.md`:
```markdown
---
description: List of test cases for the user management module
---
Redfish commands:
1. Query user service information
2. Get user list information
3. Get detailed information for each user
4. Get role list information
5. Get specified role information
IPMI commands:
1. Get all user information
2. Get user summary information
```
If you want to add modules, you can add them in the `SKILL.md` file under the "Resource Reference" section:
```markdown
## Resource Reference
- reference/H3C HDM3 IPMI Basic Command Reference Manual.md - IPMI Basic Command Reference Manual
- reference/H3C HDM2&HDM3 Redfish Reference Manual.md - Redfish Reference Manual
- reference/module case/UserManager.md - User Management Test Cases
```
## 3 Running & Prompt Words
### 3.1 Running Instructions
Running SWRDMCPServer depends on Python 3.12 and installing the dependency packages in `requirements.txt` under the SWRDMCPServer directory (using `pip install`). Then, execute `python main.py` in the SWRDMCPServer directory. A successful execution will have the following output:
```
PS D:\Workspace\SWRDMCPServer\MCPServer> python main.py
============================================================
[Authentication] User authentication is enabled
[Authentication] Authentication method: Connection-level Basic Auth (HTTP layer)
[Authentication] MCP Client configuration example:
[Authentication] "headers": {"Authorization": "Basic YWRtaW46YWRtaW4xMjM="}
============================================================
Starting SWRDMCPServer on 0.0.0.0:8000
[32mINFO[0m: Started server process [[36m14572[0m]
[32mINFO[0m: Waiting for application startup.
StreamableHTTP session manager started
[32mINFO[0m: Application startup complete.
[32mINFO[0m: Uvicorn running on [1mhttp://0.0.0.0:8000[0m (Press CTRL+C to quit)
```
Running the proxy program on the green zone PC also depends on Python 3.12 and installing `playwright` (using `python -m playwright install`). Then, execute `python local_proxy.py` in the `TestTool` directory. A successful execution will have the following output:
```
PS D:\Workspace\SWRDMCPServer\TestTool> python local_proxy.py
Local Proxy started: https://0.0.0.0:8888
Mode: Single-threaded, supports Redfish/IPMI forwarding and browser control
Supported paths:
- /redfish: Forward Redfish requests to the target device
- /ipmi: Execute IPMI commands
- /browser/open: Open browser
- /browser/run: Execute browser operations
- /browser/close: Close browser
- /command: Execute local commands (ftp_download/serial/ssh/tftp_server/shell)
```
After running the MCP Server, on the MCP configuration page in CodeBuddy, click the refresh button, and it should connect normally. If the connection reports an error, it is likely that department information is being blocked, and you need to add department information in `security_config.yaml`, for example:
```
allowed_departments:
- "Platform Software Development Department"
- "Platform Software Development Department BMC Development Division 1"
- "Platform Software Development Department BMC Development Division 2"
- "Platform Software Development Department BMC Development Division 3"
```
### 3.2 Example Prompt Words
```
I: Please perform automated testing on my BMC user management module.
```
The AI will output:
```
The test mode involves 2 test cases (Redfish + IPMI), a total of 7 commands, as follows:
Test Case Description Command Description Command Word
Redfish - User Management
Query user service information GET /redfish/v1/AccountService
Get user list information GET /redfish/v1/AccountService/Accounts
Get detailed information for each user GET /redfish/v1/AccountService/Accounts/{user_id}
Get role list information GET /redfish/v1/AccountService/Roles
Get specified role information GET /redfish/v1/AccountService/Roles/{role_id}
IPMI - User Management
Get all user information ipmitool user list
Get user summary information ipmitool user summary
Please confirm whether to continue testing (y/n)?
The above is the test plan for the user management module, which includes 5 Redfish commands and 2 IPMI commands. Are you sure you want to continue testing?
Confirm, continue testing
Cancel testing
```
```
I: Confirm, continue testing
```
The AI will complete the testing and output the test report:
```
User Management Module Automated Test Report
A total of 2 modules (Redfish + IPMI) were tested, 2 test cases, 15 commands, with 0 test cases failing and 2 test cases passing.
Test Case Description Command Description Command Word Test Result
Redfish - User Management PASS
Query user service information GET /redfish/v1/AccountService PASS
Get user list information GET /redfish/v1/AccountService/Accounts PASS
Get user 1 detailed information GET /redfish/v1/AccountService/Accounts/1 PASS
Get user 2 detailed information GET /redfish/v1/AccountService/Accounts/2 PASS
Get user 3 detailed information GET /redfish/v1/AccountService/Accounts/3 PASS
Get user 4 detailed information GET /redfish/v1/AccountService/Accounts/4 PASS
Get user 5 detailed information GET /redfish/v1/AccountService/Accounts/5 PASS
Get user 6 detailed information GET /redfish/v1/AccountService/Accounts/6 PASS
Get role list information GET /redfish/v1/AccountService/Roles PASS
Get Administrator role GET /redfish/v1/AccountService/Roles/Administrator PASS
Get Operator role GET /redfish/v1/AccountService/Roles/Operator PASS
Get User role GET /redfish/v1/AccountService/Roles/User PASS
Get CustomRole1_1 role GET /redfish/v1/AccountService/Roles/CustomRole1_1 PASS
Get CustomRole2 role GET /redfish/v1/AccountService/Roles/CustomRole2 PASS
Get CustomRole3 role GET /redfish/v1/AccountService/Roles/CustomRole3 PASS
Get CustomRole4_2 role GET /redfish/v1/AccountService/Roles/CustomRole4_2 PASS
Get None role GET /redfish/v1/AccountService/Roles/None PASS
IPMI - User Management PASS
Get all user information ipmitool user list PASS
Get user summary information ipmitool user summary PASS
```
Connection Info
You Might Also Like
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.
awesome-claude-skills
A curated list of awesome Claude Skills, resources, and tools for...
claude-flow
Claude-Flow v2.7.0 is an enterprise AI orchestration platform.
Appwrite
Build like a team of hundreds
semantic-kernel
Build and deploy intelligent AI agents with Semantic Kernel's orchestration...
Anthropic-Cybersecurity-Skills
734+ structured cybersecurity skills for AI agents · MITRE ATT&CK mapped ·...