Merge branch 'feature/1.7-cxx' into 'main'

feature/1.7-MCP

See merge request apipark/APIPark!306
This commit is contained in:
lichunxian
2025-04-11 17:28:46 +08:00
7 changed files with 66 additions and 6 deletions
@@ -55,6 +55,7 @@ export const TranslateWord = () => {
{$t('打开 OpenAPI YAML 编辑器')}
{$t('无需审核:允许任何消费者调用该服务')}
{$t('人工审核:仅允许通过人工审核的消费者调用该服务')}
{$t('开启:AI Agent 等产品能够通过 MCP 方式调用服务')}
{$t('永久')}
{$t('否')}
{$t('是')}
@@ -498,7 +498,7 @@
"K370a3eb2": "Service Marketplace",
"Kf7ec36d": "Service Details",
"K58ca9485": "Subscribe",
"K59cdbec3": "Intro",
"K59cdbec3": "Readme",
"K4aa9ed2c": "Subscribe",
"K6c060779": "Service Information",
"Kb97544cb": "Provider",
@@ -900,5 +900,17 @@
"Kea608112": "Load Preset Template",
"Kee7de862": "Edit Provider( (0) )",
"Kb0e0aeda": "New API Key",
"K9d81999c": "The API Key can be used to call system-level Open API and MCP."
"K9d81999c": "The API Key can be used to call system-level Open API and MCP.",
"Ka7ca8fde": "OpenAPI & MCP Invocation Address",
"K6e9c928f": "MCP Config",
"Kb6d0eb39": "Open API Docs",
"Ke6908f16": "Integration to AI Agent",
"Kf106bc62": "MCP Service",
"K7c2bfeff": "MCP Service acts as a bridge between AI models and APIs, enabling intelligent assistants (such as Claude) to dynamically discover and invoke APIs on the Gateway without the need for tedious manual configuration or custom integration.",
"K30595880": "Disable MCP",
"Kc081047c": "After turning it off, you wont be able to use the service through the MCP.",
"K373c8ab3": "MCP",
"K3ba29a85": "API",
"K3d52b756": "Number of invocations within 30 days",
"Ke959f135": "Enable: AI Agent and other products can invoke services through MCP."
}
@@ -922,5 +922,17 @@
"Kea608112": "プリセットテンプレートを読み込む",
"Kee7de862": "サプライヤーを編集( (0) )",
"Kb0e0aeda": "APIキーを新規作成",
"K9d81999c": "APIキーは、システムレベルのOpen APIおよびMCPの呼び出しに使用できます。"
"K9d81999c": "APIキーは、システムレベルのOpen APIおよびMCPの呼び出しに使用できます。",
"Ka7ca8fde": "OpenAPI & MCP 呼び出しアドレス",
"K6e9c928f": "MCP 設定",
"Kb6d0eb39": "Open API ドキュメント",
"Ke6908f16": "AI プロキシ統合",
"Kf106bc62": "MCP サービス",
"K7c2bfeff": "MCP サービスは、AI モデルと API の間の橋渡し役を果たし、スマートアシスタント(Claude など)が、面倒な手動設定やカスタム統合なしで、ゲートウェイ上の API を動的に発見し、呼び出すことを可能にします。",
"K30595880": "MCP 無効化",
"Kc081047c": "無効化すると、MCP を通じてサービスを呼び出すことができなくなります。",
"K373c8ab3": "MCP",
"K3ba29a85": "API",
"K3d52b756": "30日以内の呼び出し回数",
"Ke959f135": "有効化:AI Agent などの製品が MCP 経由でサービスを呼び出すことができる"
}
@@ -853,5 +853,17 @@
"Kea608112": "载入预置模板",
"Kee7de862": "编辑供应商( (0) )",
"Kb0e0aeda": "新增 API Key",
"K9d81999c": "API 密钥可用于调用系统级 Open API 和 MCP。"
"K9d81999c": "API 密钥可用于调用系统级 Open API 和 MCP。",
"Ka7ca8fde": "OpenAPI & MCP 调用地址",
"K6e9c928f": "MCP 配置",
"Kb6d0eb39": "Open API 文档",
"Ke6908f16": "AI 代理集成",
"Kf106bc62": "MCP 服务",
"K7c2bfeff": "MCP Service 充当 AI 模型与 API 之间的桥梁,允许智能助手(如 Claude)动态发现和调用 Gateway 上的 API,无需繁琐的手动配置或自定义集成。",
"K30595880": "关闭 MCP",
"Kc081047c": "关闭后将无法通过MCP方式调用服务",
"K373c8ab3": "MCP",
"K3ba29a85": "API",
"K3d52b756": "30天内调用次数",
"Ke959f135": "开启:AI Agent 等产品能够通过 MCP 方式调用服务"
}
@@ -922,5 +922,17 @@
"Kea608112": "載入預設模板",
"Kee7de862": "編輯供應商( (0) )",
"Kb0e0aeda": "新增 API 金鑰",
"K9d81999c": "API 金鑰可用於調用系統級 Open API 和 MCP。"
"K9d81999c": "API 金鑰可用於調用系統級 Open API 和 MCP。",
"Ka7ca8fde": "OpenAPI & MCP 呼叫地址",
"K6e9c928f": "MCP 設定",
"Kb6d0eb39": "Open API 文件",
"Ke6908f16": "AI 代理整合",
"Kf106bc62": "MCP 服務",
"K7c2bfeff": "MCP 服務作為 AI 模型與 API 之間的橋樑,允許智能助手(如 Claude)動態發現並呼叫 Gateway 上的 API,而無需繁瑣的手動設定或自訂整合。",
"K30595880": "關閉 MCP",
"Kc081047c": "關閉後將無法透過 MCP 方式呼叫服務",
"K373c8ab3": "MCP",
"K3ba29a85": "API",
"K3d52b756": "30 天內呼叫次數",
"Ke959f135": "開啟:AI Agent 等產品能夠透過 MCP 方式呼叫服務"
}
@@ -12,6 +12,7 @@ import { z } from 'zod'
import { useNavigate } from 'react-router-dom'
import { ServiceDetailType } from '@market/const/serviceHub/type'
import useCopyToClipboard from '@common/hooks/copy'
import { useGlobalContext } from '@common/contexts/GlobalStateContext'
type ConfigList = {
openApi?: {
@@ -54,6 +55,7 @@ const IntegrationAIContainer = ({
const [apiKey, setApiKey] = useState<string>('')
const [apiKeyList, setApiKeyList] = useState<{ value: string; label: string }[]>([])
const [mcpServerUrl, setMcpServerUrl] = useState<string>('')
const { state } = useGlobalContext()
const navigator = useNavigate()
const { copyToClipboard } = useCopyToClipboard()
const [errors, setErrors] = useState<Record<string, string | null>>({
@@ -242,6 +244,9 @@ const IntegrationAIContainer = ({
useEffect(() => {
setupComponent()
}, [service])
useEffect(() => {
initTabsData()
}, [state.language])
useEffect(() => {
if (type === 'service') {
currentTab === 'MCP' ? setActiveTab('mcp') : setActiveTab('openApi')
@@ -2,14 +2,20 @@ import InsidePage from "@common/components/aoplatform/InsidePage"
import { $t } from '@common/locales/index.ts'
import IntegrationAIContainer from "./IntegrationAIContainer"
import { Tool } from "@modelcontextprotocol/sdk/types.js"
import { useState } from "react"
import { useEffect, useState } from "react"
import McpToolsContainer from "./McpToolsContainer"
import { useGlobalContext } from "@common/contexts/GlobalStateContext"
const McpServiceContainer = () => {
const [tools, setTools] = useState<Tool[]>([]);
const [, forceUpdate] = useState<unknown>(null)
const { state } = useGlobalContext()
const handleToolsChange = (value: Tool[]) => {
setTools(value)
}
useEffect(() => {
forceUpdate({})
}, [state.language])
return (
<>
<InsidePage