Files
FastapiAdmin/backend/app/api/v1/module_ai/mcp/model.py
T
zhangtao 4c306bf430 refactor(mcp): 移除未使用的类型导入并简化模型定义
清理schema.py中未使用的Optional类型导入
移除model.py中未使用的数据库方言特定类型
2025-09-21 02:22:40 +08:00

19 lines
858 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
from sqlalchemy import JSON, String
from sqlalchemy.orm import Mapped, mapped_column
from app.core.base_model import CreatorMixin
class Mcp(CreatorMixin):
"""MCP 服务器表"""
__tablename__ = 'ai_mcp'
__table_args__ = ({'comment': 'MCP 服务器表'})
name: Mapped[str] = mapped_column(String(50), unique=True, comment='MCP 名称')
type: Mapped[int] = mapped_column(default=0, comment='MCP 类型(0stdio 1sse')
url: Mapped[str | None] = mapped_column(String(255), default=None, comment='远程 SSE 地址')
command: Mapped[str | None] = mapped_column(String(255), default=None, comment='MCP 命令')
args: Mapped[str | None] = mapped_column(String(255), default=None, comment='MCP 命令参数')
env: Mapped[str | None] = mapped_column(JSON(), default=None, comment='MCP 环境变量')