Skip to content

Conversation

@Wweiei
Copy link
Contributor

@Wweiei Wweiei commented Sep 12, 2025

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) that support nested object and array types.

config example:

{
  "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:
image
image

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

@Aias00 Aias00 merged commit 164ad63 into apache:master Sep 15, 2025
43 checks passed
@Wweiei Wweiei deleted the feat/mcpServer-support-objectparam branch September 17, 2025 03:06
@Aias00 Aias00 added this to the 2.7.0.3 milestone Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants