Wweiei opened a new pull request, #6150:
URL: https://github.com/apache/shenyu/pull/6150
<!-- Describe your PR here; e.g. Fixes #issueNo -->
feat: mcpServer support object and array param.
* changed the structure of McpServerToolParameter, add a nested list
parameter.
* changed the JsonSchemaUtil.createParameterSchema() method to enable the
generation of JSON schemas (via List<McpServerToolParameter>) that support
nested object and array types.
config example:
```json
{
"name": "valuePost",
"parameters": [
{
"name": "key",
"type": "string",
"description": "key",
"required": true
},
{
"name": "keyObject",
"type": "object",
"description": "用户信息",
"required": true,
"parameters": [
{
"name": "userId",
"type": "string",
"description": "用户ID",
"required": true
},
{
"name": "userName",
"type": "string",
"description": "用户姓名",
"required": true
}
]
}
],
"requestConfig":
"{\"requestTemplate\":{\"url\":\"/demo-web/test/valuePost\",\"method\":\"POST\",\"headers\":[{\"key\":\"Content-Type\",\"value\":\"application/json\"}],\"timeout\":30000,\"argsToJsonBody\":true},\"argsPosition\":{\"key\":\"body\",\"keyObject\":\"body\"}}",
"description": "post根据key获取value"
}
```
mcp tool list result:
<img width="2198" height="1318" alt="image"
src="https://github.com/user-attachments/assets/40d35e41-4d6e-42a2-ad70-f5f6a3878f5f"
/>
<img width="1446" height="1434" alt="image"
src="https://github.com/user-attachments/assets/44b9007a-74b9-4f17-859c-5c29439dfb79"
/>
<!--
Thank you for proposing a pull request. This template will guide you through
the essential steps necessary for a pull request.
-->
Make sure that:
- [ ] You have read the [contribution
guidelines](https://shenyu.apache.org/community/contributor-guide).
- [ ] You submit test cases (unit or integration tests) that back your
changes.
- [ ] Your local test passed `./mvnw clean install
-Dmaven.javadoc.skip=true`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]