Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
a6d32cd
feat: MCP Server 管理 + 沙箱托管 + 协议标准化
githuuuuub Mar 19, 2026
ad32ee3
fix(frontend): require subscription before starting model chat test (…
lexburner Mar 18, 2026
cec8756
fix(deploy): fix nacos startup config, api response parsing, and mult…
lexburner Mar 18, 2026
dc24839
fix: 沙箱部署异步获取工具列表 + 管理后台来源展示优化
githuuuuub Mar 19, 2026
8f44ead
Merge branch 'main' into AgentRuntimeIntegrate
githuuuuub Mar 19, 2026
344afe9
style: format McpServerServiceImpl code style
githuuuuub Mar 19, 2026
6551825
Merge remote-tracking branch 'origin/main' into AgentRuntimeIntegrate
githuuuuub Mar 23, 2026
dcc25e7
Backend:
githuuuuub Mar 23, 2026
4c497d9
feat: unify MCP protocol handling and improve MCP config display
githuuuuub Mar 24, 2026
3b48201
fix: unify SSE endpoint URL normalization to prevent double-slash bug
githuuuuub Mar 24, 2026
875f3e4
feat: restrict Open API MCP endpoints to published products only
githuuuuub Mar 25, 2026
4a7e23b
refactor: format McpServerServiceImpl with spotless
githuuuuub Mar 25, 2026
dbecbd4
feat: add batch import MCP from third-party vendors (ModelScope, MCP …
githuuuuub Mar 26, 2026
58e4167
fix: store CRD resourceName in subscribe_params to fix sandbox undepl…
githuuuuub Mar 26, 2026
980e252
fix: persist token revocation blacklist to database (#202)
githuuuuub Mar 26, 2026
1530e8b
fix: prevent arbitrary file upload vulnerability (Issue #198)
githuuuuub Mar 26, 2026
b5b9bbb
Merge branch 'SecurityBugFix' into AgentRuntimeIntegrate-reconstruct
githuuuuub Mar 26, 2026
1949b3a
fix: rename V14 migration to V16 to resolve Flyway version conflict
githuuuuub Mar 26, 2026
afe3ca9
fix: sanitize subscribeParams from MCP meta API for non-admin users
githuuuuub Mar 27, 2026
06497c1
feat: add API Key auth for AgentRuntime sandbox deployment
githuuuuub Mar 28, 2026
661dcd2
fix: show import MCP button only on MCP Server tab
githuuuuub Mar 28, 2026
11e2a4f
fix: display sandbox name instead of ID in hosting config
githuuuuub Mar 28, 2026
9382c06
fix: collapse auth credentials by default, expand on click
githuuuuub Mar 28, 2026
01dc0df
merge: integrate origin/main into AgentRuntimeIntegrate-reconstruct
githuuuuub Mar 28, 2026
2595a89
fix: MCP config improvements and sandbox deploy UX enhancements
githuuuuub Mar 30, 2026
4e3c53e
merge: integrate origin/main (#223, #224) into AgentRuntimeIntegrate-…
githuuuuub Mar 30, 2026
8a49b8a
refactor: improve Open API security and split McpServerServiceImpl
githuuuuub Mar 30, 2026
0f64f28
fix: restore V15 migration to match main, unify endpoint access throu…
githuuuuub Mar 30, 2026
4261624
fix: replace hardcoded sourceType string with SourceType.CUSTOM enum
githuuuuub Mar 30, 2026
3220177
fix: address multiple review findings
githuuuuub Mar 30, 2026
76c5406
fix: security hardening, code quality improvements, and dead code cle…
githuuuuub Mar 30, 2026
0e3e30b
merge: integrate origin/main and fix publishProduct status consistency
githuuuuub Mar 30, 2026
4b32d23
refactor: redesign MCP Square page to align with Skills/Workers
githuuuuub Mar 31, 2026
0e83895
Merge remote-tracking branch 'origin/main' into AgentRuntimeIntegrate…
githuuuuub Mar 31, 2026
bd5631b
fix: revert fabric8 version to 6.1.1 (all used APIs are compatible)
githuuuuub Mar 31, 2026
360bc5d
Merge remote-tracking branch 'origin/main' into AgentRuntimeIntegrate…
githuuuuub Apr 1, 2026
1f3d83e
perf: batch-load MCP meta/endpoint in fillProducts, merge frontend co…
githuuuuub Apr 1, 2026
06a2054
Merge remote-tracking branch 'origin/main' into AgentRuntimeIntegrate…
githuuuuub Apr 1, 2026
b57ed92
fix: add auth guard to /mcp/create route and fix MCP Square total cou…
githuuuuub Apr 1, 2026
4409d31
docs: align design docs with actual SQL schema and API implementation
githuuuuub Apr 1, 2026
640e95d
fix: remove unused Button import and setActiveTab in McpSquare
githuuuuub Apr 1, 2026
504665f
fix: replace fabric8 Serialization.unmarshal with Jackson YAML to avo…
githuuuuub Apr 1, 2026
47af8ca
feat(admin): 重构 MCP 创建入口,统一创建流程 & 优化配置体验
githuuuuub Apr 7, 2026
335063b
feat: MCP 管理页面支持手动编辑工具列表
githuuuuub Apr 8, 2026
9c5bf43
merge: 合入 main 分支(解决批量导入功能冲突)
githuuuuub Apr 8, 2026
07b7678
fix: MCP 市场卡片高度调整 & 修复 CardGridSkeleton 类型错误
githuuuuub Apr 8, 2026
691a480
fix: MCP 详情页来源标签补全所有 origin 类型的中文映射
githuuuuub Apr 8, 2026
0fb4878
fix: 移除沙箱部署后自动获取工具列表,避免覆盖手动编辑的工具配置
githuuuuub Apr 8, 2026
fe74f26
feat: MCP UX 优化六项改进
githuuuuub Apr 10, 2026
e020edf
merge: 合入 main 分支(#257 下载计数重构, #258 CoPaw图标优化, #259 文档更新, #260 HiCodi…
githuuuuub Apr 10, 2026
0d94318
chore: 移除分支独有的 docs 文件,避免合入时改变 main 的 docs 目录
githuuuuub Apr 10, 2026
20e6271
fix: remove unused handleSubscribe/handleUnsubscribe and onDisconnect…
githuuuuub Apr 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public class SecurityConfig {
// System endpoints
private static final String[] SYSTEM_WHITELIST = {"/favicon.ico", "/error"};

// Open API endpoints (API Key auth handled in controller)
private static final String[] OPEN_API_WHITELIST = {"/open-api/**"};

@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
List<PublicAccessEndpoint> publicEndpoints =
Expand Down Expand Up @@ -108,6 +111,9 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.permitAll()
// Permit system endpoints
.requestMatchers(SYSTEM_WHITELIST)
.permitAll()
// Permit open API endpoints
.requestMatchers(OPEN_API_WHITELIST)
.permitAll();
// Permit @PublicAccess annotated endpoints with HTTP method precision
for (PublicAccessEndpoint endpoint : publicEndpoints) {
Expand Down
3 changes: 3 additions & 0 deletions himarket-bootstrap/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ acp:
supports-mcp: true
supports-skill: true

open-api:
api-key: ${OPEN_API_KEY:}

observability:
log-source: ${OBSERVABILITY_LOG_SOURCE:SLS}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
CREATE TABLE IF NOT EXISTS `sandbox_instance` (
`id` bigint NOT NULL AUTO_INCREMENT,
`sandbox_id` varchar(64) NOT NULL,
`admin_id` varchar(64) NOT NULL,
`sandbox_name` varchar(64) NOT NULL,
`sandbox_type` varchar(32) NOT NULL COMMENT 'AGENT_RUNTIME / SELF_HOSTED',
`cluster_attribute` json DEFAULT NULL COMMENT '集群属性JSON: clusterId, clusterName, slbType, vpcId, mappingIP, mappingPort等',
`api_server` varchar(256) DEFAULT NULL,
`kube_config` text DEFAULT NULL,
`description` varchar(512) DEFAULT NULL,
`extra_config` json DEFAULT NULL COMMENT '扩展配置,不同sandbox类型的特定参数',
`status` varchar(32) NOT NULL DEFAULT 'RUNNING' COMMENT 'RUNNING / STOPPED / ERROR',
`status_message` varchar(512) DEFAULT NULL,
`created_at` datetime(3) DEFAULT CURRENT_TIMESTAMP(3),
`updated_at` datetime(3) DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
`last_checked_at` datetime(3) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_sandbox_id` (`sandbox_id`),
UNIQUE KEY `uk_admin_sandbox_name` (`admin_id`, `sandbox_name`),
UNIQUE KEY `uk_api_server` (`api_server`),
KEY `idx_admin_id` (`admin_id`),
KEY `idx_sandbox_type` (`sandbox_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
-- ========================================
-- MCP Server Meta (冷数据 — 元信息)
-- ========================================
CREATE TABLE IF NOT EXISTS `mcp_server_meta` (
`id` bigint NOT NULL AUTO_INCREMENT,
`mcp_server_id` varchar(64) NOT NULL,
`product_id` varchar(64) NOT NULL,
`mcp_name` varchar(128) NOT NULL,
`repo_url` varchar(512) DEFAULT NULL,
`source_type` varchar(32) DEFAULT NULL COMMENT 'npm / docker / git / config',
`origin` varchar(32) NOT NULL DEFAULT 'ADMIN' COMMENT 'ADMIN / GATEWAY / USER / THIRD_PARTY',
`tags` json DEFAULT NULL,
`protocol_type` varchar(32) NOT NULL COMMENT 'stdio / sse / http',
`connection_config` json NOT NULL,
`extra_params` json DEFAULT NULL,
`tools_config` json DEFAULT NULL,
`created_by` varchar(64) DEFAULT NULL,
`sandbox_required` tinyint(1) DEFAULT NULL,
`created_at` datetime(3) DEFAULT CURRENT_TIMESTAMP(3),
`updated_at` datetime(3) DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
PRIMARY KEY (`id`),
UNIQUE KEY `uk_mcp_server_id` (`mcp_server_id`),
UNIQUE KEY `uk_product_mcp_name` (`product_id`, `mcp_name`),
KEY `idx_product_id` (`product_id`),
KEY `idx_mcp_name` (`mcp_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ========================================
-- MCP Server Endpoint (热数据 — 运行时连接)
-- ========================================
CREATE TABLE IF NOT EXISTS `mcp_server_endpoint` (
`id` bigint NOT NULL AUTO_INCREMENT,
`endpoint_id` varchar(64) NOT NULL,
`mcp_server_id` varchar(64) NOT NULL,
`mcp_name` varchar(128) NOT NULL,
`endpoint_url` varchar(512) NOT NULL,
`hosting_type` varchar(32) NOT NULL COMMENT 'NACOS / GATEWAY / SANDBOX',
`protocol` varchar(32) NOT NULL COMMENT 'stdio / sse / http',
`user_id` varchar(64) NOT NULL DEFAULT '*' COMMENT '* = all users',
`hosting_instance_id` varchar(64) DEFAULT NULL,
`hosting_identifier` varchar(128) DEFAULT NULL,
`subscribe_params` json DEFAULT NULL COMMENT '用户订阅时提交的参数 JSON',
`status` varchar(32) NOT NULL DEFAULT 'ACTIVE' COMMENT 'ACTIVE / INACTIVE',
`created_at` datetime(3) DEFAULT CURRENT_TIMESTAMP(3),
`updated_at` datetime(3) DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
PRIMARY KEY (`id`),
UNIQUE KEY `uk_endpoint_id` (`endpoint_id`),
KEY `idx_mcp_server_id` (`mcp_server_id`),
KEY `idx_user_hosting` (`user_id`, `hosting_type`),
UNIQUE KEY `uk_server_user_hosting` (`mcp_server_id`, `user_id`, `hosting_instance_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package com.alibaba.himarket.converter;

import com.alibaba.himarket.support.common.Encryptor;
import jakarta.persistence.AttributeConverter;
import jakarta.persistence.Converter;

@Converter
public class EncryptedStringConverter implements AttributeConverter<String, String> {

@Override
public String convertToDatabaseColumn(String attribute) {
return Encryptor.encrypt(attribute);
}

@Override
public String convertToEntityAttribute(String dbData) {
return Encryptor.decrypt(dbData);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package com.alibaba.himarket.entity;

import jakarta.persistence.*;
import lombok.*;

/**
* MCP Server 运行时连接信息(热数据)。
* 存储 MCP 的 endpoint、托管方式等运行时信息,查询频率高。
*/
@Entity
@Table(
name = "mcp_server_endpoint",
uniqueConstraints = {
@UniqueConstraint(
columnNames = {"endpoint_id"},
name = "uk_endpoint_id"),
@UniqueConstraint(
columnNames = {"mcp_server_id", "user_id", "hosting_instance_id"},
name = "uk_server_user_hosting"),
})
@Data
@EqualsAndHashCode(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class McpServerEndpoint extends BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(name = "endpoint_id", length = 64, nullable = false)
private String endpointId;

@Column(name = "mcp_server_id", length = 64, nullable = false)
private String mcpServerId;

@Column(name = "mcp_name", length = 128, nullable = false)
private String mcpName;

@Column(name = "endpoint_url", length = 512, nullable = false)
private String endpointUrl;

@Column(name = "hosting_type", length = 32, nullable = false)
private String hostingType;

@Column(name = "protocol", length = 32, nullable = false)
private String protocol;

@Column(name = "user_id", length = 64, nullable = false)
private String userId;

@Column(name = "hosting_instance_id", length = 64)
private String hostingInstanceId;

@Column(name = "hosting_identifier", length = 128)
private String hostingIdentifier;

@Column(name = "subscribe_params", columnDefinition = "json")
private String subscribeParams;

@Column(name = "status", length = 32, nullable = false)
private String status;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package com.alibaba.himarket.entity;

import cn.hutool.core.util.StrUtil;
import jakarta.persistence.*;
import lombok.*;

/**
* MCP Server 技术配置(冷数据)。
*
* <p>只存储 MCP 独有的技术字段(协议、连接、工具等)。
* 展示信息(名称、描述、图标、文档)统一由关联的 Product 管理。
*/
@Entity
@Table(
name = "mcp_server_meta",
uniqueConstraints = {
@UniqueConstraint(
columnNames = {"mcp_server_id"},
name = "uk_mcp_server_id"),
@UniqueConstraint(
columnNames = {"product_id", "mcp_name"},
name = "uk_product_mcp_name"),
})
@Data
@EqualsAndHashCode(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class McpServerMeta extends BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(name = "mcp_server_id", length = 64, nullable = false)
private String mcpServerId;

@Column(name = "product_id", length = 64, nullable = false)
private String productId;

@Column(name = "mcp_name", length = 128, nullable = false)
private String mcpName;

@Column(name = "repo_url", length = 512)
private String repoUrl;

@Column(name = "source_type", length = 32)
private String sourceType;

@Column(name = "origin", length = 32, nullable = false)
private String origin;

@Column(name = "tags", columnDefinition = "json")
private String tags;

@Column(name = "protocol_type", length = 32, nullable = false)
private String protocolType;

@Column(name = "connection_config", columnDefinition = "json", nullable = false)
private String connectionConfig;

@Column(name = "extra_params", columnDefinition = "json")
private String extraParams;

@Column(name = "tools_config", columnDefinition = "json")
private String toolsConfig;

@Column(name = "sandbox_required")
private Boolean sandboxRequired;

@Column(name = "created_by", length = 64)
private String createdBy;

/** 持久化前将空字符串的 JSON 列置为 null,避免 MySQL JSON 列写入非法值 */
@PrePersist
@PreUpdate
private void sanitizeJsonFields() {
if (StrUtil.isBlank(toolsConfig)) toolsConfig = null;
if (StrUtil.isBlank(tags)) tags = null;
if (StrUtil.isBlank(extraParams)) extraParams = null;
}
}
Loading
Loading