Files
FastapiAdmin/backend/app/api/v1/module_ai/mcp/model.py
T
2025-09-21 02:09:48 +08:00

21 lines
953 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.dialects.mysql import LONGTEXT
from sqlalchemy.dialects.postgresql import TEXT
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 环境变量')