Mcp Tools Management Page Development#2771
Mcp Tools Management Page Development#2771HelloWorldGitHub114 wants to merge 31 commits intoModelEngine-Group:developfrom
Conversation
…式的MCP服务; 添加公共市场的浏览和搜索。
- Added new service enabling and disabling messages in English and Chinese localization files. - Updated API endpoints for enabling and disabling MCP tools. - Introduced new container service addition functionality in the MCP tools service. - Refactored mcpToolsService to handle container services and improve error handling. - Updated types for MCP tools to reflect new transport types and service details. - Created a new SQL migration script to extend the mcp_record_t table for additional MCP tool attributes. - Implemented a custom hook for managing MCP tools page state and interactions. 功能亮点:增强 MCP 工具的功能与用户界面 - 在英文和中文本地化文件中添加了启用和禁用服务的提示信息。 - 更新了用于启用和禁用 MCP 工具的 API 接口。 - 在 MCP 工具服务中引入了新增容器服务的功能。 - 重构了 mcpToolsService 以处理容器服务并改进错误处理机制。 - 更新了 MCP 工具的类型,以反映新的传输类型和服务详情。 - 创建了新的 SQL 迁移脚本,用于扩展 mcp_record_t 表以支持 MCP 工具的额外属性。 - 实现了自定义钩子,用于管理 MCP 工具页面的状态和交互。
Remove the “market_name” field from the mcp_record_t SQL extension and correct the spelling error in the source code 重构代码,将market命名转为registry 移除mcp_record_t扩展sql的market_name,修正拼写错误souce
…MCPs to the community marketplace for other users to browse and discover. 添加社区市场功能,用户可以上传自己的MCP到社区市场供其它用户浏览发现。
…uring quick addition in MCP Registry; Removal of the old MCP Tools interface and uniform migration to the new interface; Caching of the search bar in external marketplaces; Update to the logic of the tool list on the Agent page, synchronized with the MCP Tools page 外部市场支持快速添加时的变量和请求头显示和填写; 去除mcp tools的旧接口,统一改为新接口; 外部市场搜索栏缓冲; 智能体页面工具列表逻辑更新,和mcp tools页面同步更新
增加来源和传输方式筛选
…s logic” to “only making calls and mapping exceptions.” Aggregation of props for frontend detail pop-ups. New MCP domain exceptions have been added; the service layer throws MCP exceptions, and the App layer uniformly maps them to HTTP status codes. /container/add 由 App 层“做业务”改为“只做调用+异常映射”。 前端详情弹窗 props 聚合。 新增 MCP 领域异常,service 层抛出MCP异常,app 层统一映射 HTTP 状态。
将tags改为数组形式存储,新增用tag筛选mcp。
…ization header are allowed.增加请求头填写限制,只允许Authorization的Bearer Token填写
…ng and collapsing descriptions, and supports descriptions of unlimited length. 支持描述markdown形式展示,支持描述展开和收起,支持无限长的描述。
…methods and tags; add filtering by shipping methods and tags. 社区市场添加分页,添加传输方式和tag显示,添加传输方式和tag筛选.
… market details page; Added a hyperlink entry point to the Modelscope MCP Plaza. 优化外部市场详情界面安装包变量显示; 新增魔搭mcp广场超链接入口。
…rt features; When quickly adding a container from the external market, a port needs to be filled in; Refactored the code of mcp_management_app and service, moving a large amount of data validation handling to the app, using Pydantic for validation, simplifying the code. 添加了容器服务端口冲突校验和推荐端口功能; 外部市场快速添加容器需要填写端口; 重构了mcp_managemeny_app和service的代码,讲大量数据检验处理移动到app中,利用Pydantic校验,简化代码。
Fix the front-end and back-end integration errors of My Posts and Community Market; Fix the display of description editing in My Posts editing and Community Market. mcptools前端表单进行数据校验; 修复我的发布和社区市场前后端对接错误; 修复我的发布编辑和社区市场的描述编辑显示。
添加MCP.so超链接
Slightly optimized the backend code for OCI unsupported cases. 优化前端对oci的不支持显示。 稍微优化了后端对oci不支持的代码。
去除重复代码
Recommended ports are now random Fixed container name duplication issue Abstracted front-end code port handling to reduce duplicate code Added a prompt for failed addition of services with duplicate names Loading state between each MCP card is independent and does not interfere 优化 推荐端口现在改为随机 容器重名问题修复 前端代码端口处理问题抽象,减少重复代码 增加对重复命名服务添加失败的提示 每个mcp卡片之间加载状态独立不干扰
…he community market, and optimized redundant code 修复社区市场添加时附带registry_json错误的问题,并优化冗余代码
重新调整,把stdio改成容器
There was a problem hiding this comment.
Pull request overview
This PR introduces a new /mcp-tools management experience, including centralized MCP lifecycle management (list/filter/add/update/delete/enable/stop/healthcheck) and marketplace flows (registry/community browsing and publishing), spanning frontend UI/types/services plus backend/SDK support.
Changes:
- Added MCP Tools page UI/service layer and shared TypeScript types to support local/registry/community MCP workflows.
- Updated container/pod naming in SDK Docker/Kubernetes clients to include a UUID suffix to avoid name collisions.
- Extended backend DB/service capabilities for MCP management, including new record operations and related tests.
Reviewed changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/types/mcpTools.ts | Adds MCP tools domain types/enums for tabs, transport, status, payloads. |
| frontend/services/mcpToolsService.ts | Adds frontend API wrappers and helpers for MCP tools management + registry/community operations. |
| frontend/app/[locale]/mcp-tools/components/AddMcpServiceRegistrySection.tsx | Implements registry “quick add” UI; includes unsupported-option warning rendering. |
| frontend/app/[locale]/mcp-tools/components/McpServiceDetailModal.tsx | Implements MCP detail/edit modal; includes tool list wiring. |
| sdk/nexent/container/docker_client.py | Appends UUID segment to generated MCP container names. |
| sdk/nexent/container/k8s_client.py | Appends UUID segment to generated MCP pod names. |
| backend/database/remote_mcp_db.py | Adds MCP management DB helpers including container-port lookup logic. |
| backend/services/mcp_container_service.py | Adds/updates container lifecycle helpers including “start existing container” path. |
| test/backend/database/test_remote_mcp_db.py | Adds tests for restoring a soft-deleted MCP record. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from backend.database.remote_mcp_db import ( | ||
| create_mcp_record, | ||
| delete_mcp_record_by_name_and_url, | ||
| restore_mcp_record_by_name_and_url, | ||
| delete_mcp_record_by_container_id, |
There was a problem hiding this comment.
restore_mcp_record_by_name_and_url is imported/used in these tests, but there is no implementation in backend.database.remote_mcp_db (searching the module returns no matches). This will cause an ImportError and fail the test suite; either implement the restore helper in remote_mcp_db.py (and export it) or remove/update the tests to match the actual API.
| """ | ||
| with get_db_session() as session: | ||
| query = session.query(McpRecord).filter( | ||
| McpRecord.container_port == container_port, |
There was a problem hiding this comment.
get_mcp_records_by_container_port claims to return enabled MCP records, but the query only filters by container_port and delete_flag. This can incorrectly report a port as “in use” even when the MCP is disabled, preventing users from enabling/starting a container on a free port. Filter by McpRecord.enabled.is_(True) (and/or status if that’s the intended definition of enabled) or adjust the docstring/consumers to match the actual behavior.
| McpRecord.container_port == container_port, | |
| McpRecord.container_port == container_port, | |
| McpRecord.enabled.is_(True), |
| async def start_existing_mcp_container(self, container_id: str) -> Dict[str, str]: | ||
| """ | ||
| Start an existing container by container ID and return runtime access fields. | ||
|
|
||
| Args: | ||
| container_id: Existing container ID or name | ||
|
|
||
| Returns: | ||
| Dictionary with container_id, mcp_url, host_port, status, container_name | ||
|
|
||
| Raises: | ||
| MCPContainerError: If startup fails or runtime info cannot be resolved | ||
| """ | ||
| try: | ||
| # SDK Docker client exposes the native docker client as `client`. | ||
| container = self.client.client.containers.get(container_id) | ||
| container.start() | ||
| container.reload() | ||
| if container.status != "running": |
There was a problem hiding this comment.
start_existing_mcp_container directly uses Docker SDK internals (self.client.client.containers.get(...).start()), but MCPContainerManager can be initialized with a Kubernetes client when IS_DEPLOYED_BY_KUBERNETES is true. In Kubernetes mode this will raise at runtime because the SDK client exposes core_v1/apps_v1 instead of client.containers. This method should either be implemented via the SDK container-client abstraction for both runtimes, or guard Kubernetes mode and raise a clear MCPContainerError (or implement the Kubernetes equivalent start/reconcile logic).
| interface McpServiceDetailModalProps { | ||
| open: boolean; | ||
| selectedService: McpServiceItem | null; | ||
| draftService: McpServiceItem | null; | ||
| tagDrafts: string[]; | ||
| tagInputValue: string; | ||
| healthCheckLoading: boolean; | ||
| healthErrorModalVisible: boolean; | ||
| healthErrorModalTitle: string; | ||
| healthErrorModalDetail: string; | ||
| loadingTools: boolean; | ||
| toolsModalVisible: boolean; | ||
| currentServerTools: any[]; | ||
| publishLoading?: boolean; |
There was a problem hiding this comment.
Prop currentServerTools is typed as any[], which removes type safety despite McpTool being available in the codebase and already used in related APIs. Prefer a concrete type (e.g., McpTool[]) so the tool list modal and callers are checked at compile time.
| <Alert | ||
| type="warning" | ||
| showIcon | ||
| title={t("mcpTools.registry.quickAddUnsupported")} |
There was a problem hiding this comment.
Ant Design Alert doesn’t support a title prop; the title text will be ignored and the warning may render blank. Use message (and optionally description) to display the translated warning content.
| title={t("mcpTools.registry.quickAddUnsupported")} | |
| message={t("mcpTools.registry.quickAddUnsupported")} |
Added the /mcp-tools management page, allowing centralized management of browsing, filtering, adding, deleting, enabling, stopping, and modifying MCPs;






Added remote marketplace and community marketplace, allowing users to browse and obtain MCPs, allowing users to upload MCPs to the community marketplace, and allowing users to manage their own published MCPs.
添加了/mcp-tools管理页面,允许集中管理mcp的浏览筛选添加删除启用停止修改;
新增远程市场和社区市场,允许用户浏览和获取mcp,允许用户上传mcp到社区市场,允许用户管理自己发布的mcp。