Skip to content

Conversation

@Libres-coder
Copy link
Contributor

Ⅰ. Describe what this PR did

Added list-plugin-instances tool to MCP Server, enabling AI Agents to query plugin instances for specific scopes (GLOBAL, DOMAIN, SERVICE, ROUTE) via MCP protocol.

Changes:

  • Added handleListPluginInstances() and getListPluginInstancesSchema() functions
  • Registered new tool in RegisterCommonPluginTools()
  • Updated Chinese and English documentation

Ⅱ. Does this pull request fix one issue?

Relates to #3019, but does not fully resolve it.

Ⅲ. Why don't you add test cases (unit test/integration test)?

  • Requires full Higress Console + Kubernetes/Istio environment
  • Depends on Console backend APIs already tested in Console repository
  • Follows existing MCP Server tool patterns
  • Integration tests can be added in future PR

Ⅳ. Describe how to verify it

Compile check:

cd plugins/golang-filter/mcp-server
go build ./servers/higress/higress-api/tools/plugins

MCP tool usage:

{
  "tool": "list-plugin-instances",
  "arguments": {
    "scope": "ROUTE",
    "resource_name": "test-route"
  }
}

API endpoints verified in Console:

  • GET /v1/{scope}/plugin-instances (scope: global/domains/services/routes)

Ⅴ. Special notes for reviews

  • Pure addition, no breaking changes
  • Depends on Console backend APIs (verified in WasmPluginInstancesController.java)
  • Complements frontend UI fix in higress-console repo
  • Follows existing code patterns and conventions

@lingma-agents
Copy link

lingma-agents bot commented Oct 22, 2025

新增 list-plugin-instances MCP 工具以支持 AI Agent 查询插件实例

变更概述
  • 新功能

    • 添加了名为 list-plugin-instances 的 MCP 工具,允许 AI Agent 根据指定范围(全局、域名、服务、路由)查询插件实例。
    • 实现了 handleListPluginInstances 处理函数和 getListPluginInstancesSchema 参数校验逻辑。
    • RegisterCommonPluginTools 中注册了该工具,使其可通过 MCP 协议调用。
    • 支持通过不同作用域路径访问控制台后端 API 来获取插件实例列表。
  • 文档

    • 更新中文 README 文件,在“插件管理”部分添加了对 list-plugin-instances 工具的说明。
    • 更新英文 README 文件,同步增加了对应的英文描述。
变更文件
文件路径 变更说明
plugins/​golang-filter/​mcp-server/​servers/​higress/​higress-api/​README.​md 在插件管理章节中添加了 `list-plugin-instances` 工具的介绍。
plugins/​golang-filter/​mcp-server/​servers/​higress/​higress-api/​README_​en.​md 在 Plugin Management 部分补充了 `list-plugin-instances` 工具的功能描述。
plugins/​golang-filter/​mcp-server/​servers/​higress/​higress-api/​tools/​plugins/​common.​go 注册并实现了 `list-plugin-instances` 工具的核心逻辑,包括参数解析、API 请求构建及响应处理。

💡 小贴士

与 lingma-agents 交流的方式

📜 直接回复评论
直接回复本条评论,lingma-agents 将自动处理您的请求。例如:

  • 在当前代码中添加详细的注释说明。

  • 请详细介绍一下你说的 LRU 改造方案,并使用伪代码加以说明。

📜 在代码行处标记
在文件的特定位置创建评论并 @lingma-agents。例如:

  • @lingma-agents 分析这个方法的性能瓶颈并提供优化建议。

  • @lingma-agents 对这个方法生成优化代码。

📜 在讨论中提问
在任何讨论中 @lingma-agents 来获取帮助。例如:

  • @lingma-agents 请总结上述讨论并提出解决方案。

  • @lingma-agents 请根据讨论内容生成优化代码。

@Libres-coder
Copy link
Contributor Author

Libres-coder commented Oct 22, 2025

@codecov-commenter
Copy link

codecov-commenter commented Oct 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.01%. Comparing base (ef31e09) to head (788a593).
⚠️ Report is 754 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3038      +/-   ##
==========================================
+ Coverage   35.91%   45.01%   +9.10%     
==========================================
  Files          69       82      +13     
  Lines       11576    10898     -678     
==========================================
+ Hits         4157     4906     +749     
+ Misses       7104     5644    -1460     
- Partials      315      348      +33     

see 97 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@johnlanni
Copy link
Collaborator

Thank you, we will review it as soon as possible. cc @cr7258

@Libres-coder
Copy link
Contributor Author

Thank you, we will review it as soon as possible. cc @cr7258

Thanks for your feedback. I will make the changes should there be any issues @johnlanni

Copy link
Collaborator

@cr7258 cr7258 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐉 LGTM
@Libres-coder Thanks for your contribution.

@Libres-coder
Copy link
Contributor Author

🐉 LGTM @Libres-coder Thanks for your contribution.

Thanks for your approval! The current PR has been approved. Could you please merge it when you have a moment? Thank you! @cr7258

@cr7258
Copy link
Collaborator

cr7258 commented Oct 25, 2025

@johnlanni, I don't have permission to merge this PR, could you please merge it?

@johnlanni johnlanni merged commit 7c4899a into alibaba:main Oct 25, 2025
12 checks passed
@johnlanni
Copy link
Collaborator

@cr7258 I've removed the requirement to update the branch to the latest before merging, so you (as the maintainer of this repository) can merge it in the future as well :)

ink-hz pushed a commit to ink-hz/higress-ai-capability-auth that referenced this pull request Nov 5, 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.

4 participants