[ADD]mcp market: Obtain the list of MCP services from MCP Market Source - ModelScope
This commit is contained in:
@@ -9,6 +9,8 @@ from .generic_file_model import GenericFile
|
||||
from .models_model import ModelConfig, ModelProvider, ModelType, ModelApiKey, ModelBase, LoadBalanceStrategy
|
||||
from .memory_short_model import ShortTermMemory, LongTermMemory
|
||||
from .knowledgeshare_model import KnowledgeShare
|
||||
from .mcp_market_model import McpMarket
|
||||
from .mcp_market_config_model import McpMarketConfig
|
||||
from .app_model import App
|
||||
from .agent_app_config_model import AgentConfig
|
||||
from .app_release_model import AppRelease
|
||||
@@ -50,6 +52,8 @@ __all__ = [
|
||||
"ModelType",
|
||||
"ModelApiKey",
|
||||
"KnowledgeShare",
|
||||
"McpMarket",
|
||||
"McpMarketConfig",
|
||||
"App",
|
||||
"AgentConfig",
|
||||
"AppRelease",
|
||||
|
||||
16
api/app/models/mcp_market_config_model.py
Normal file
16
api/app/models/mcp_market_config_model.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import datetime
|
||||
import uuid
|
||||
from sqlalchemy import Column, Integer, String, DateTime, ForeignKey
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
from app.db import Base
|
||||
|
||||
class McpMarketConfig(Base):
|
||||
__tablename__ = "mcp_market_configs"
|
||||
|
||||
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4, index=True)
|
||||
mcp_market_id = Column(UUID(as_uuid=True), nullable=False, comment="mcp_markets.id")
|
||||
token = Column(String, nullable=True, comment="mcp market token")
|
||||
status = Column(Integer, default=0, comment="connect status(0: Not connected, 1: connected)")
|
||||
tenant_id = Column(UUID(as_uuid=True), nullable=False, comment="tenant.id")
|
||||
created_by = Column(UUID(as_uuid=True), nullable=False, comment="users.id")
|
||||
created_at = Column(DateTime, default=datetime.datetime.now)
|
||||
18
api/app/models/mcp_market_model.py
Normal file
18
api/app/models/mcp_market_model.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import datetime
|
||||
import uuid
|
||||
from sqlalchemy import Column, Integer, String, DateTime, ForeignKey
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
from app.db import Base
|
||||
|
||||
class McpMarket(Base):
|
||||
__tablename__ = "mcp_markets"
|
||||
|
||||
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4, index=True)
|
||||
name = Column(String, index=True, nullable=False, comment="mcp market name")
|
||||
description = Column(String, index=True, nullable=True, comment="mcp market description")
|
||||
logo_url = Column(String, index=True, nullable=True, comment="logo url")
|
||||
mcp_count = Column(Integer, default=1, comment="mcp count")
|
||||
url = Column(String, index=True, nullable=False, comment="mcp market url")
|
||||
category = Column(String, index=True, nullable=False, comment="category")
|
||||
created_by = Column(UUID(as_uuid=True), nullable=False, comment="users.id")
|
||||
created_at = Column(DateTime, default=datetime.datetime.now)
|
||||
Reference in New Issue
Block a user