Files
FastapiAdmin/backend/app/plugin/module_application/ai/model.py
T
zhangtao 1d54dca76c style: 统一代码格式和字符串引号使用
refactor: 优化代码结构和可读性

feat: 添加http_limit模块实现请求限制功能

fix: 修复异步任务中使用time.sleep的问题

chore: 更新依赖项并添加pytest测试框架

docs: 更新项目描述信息

perf: 优化Redis序列化方式使用JSON替代pickle

test: 添加测试相关配置和依赖
2026-01-17 20:07:25 +08:00

25 lines
1.0 KiB
Python

from sqlalchemy import JSON, Integer, String
from sqlalchemy.orm import Mapped, mapped_column
from app.core.base_model import ModelMixin, UserMixin
class McpModel(ModelMixin, UserMixin):
"""
MCP 服务器表
MCP类型:
- 0: stdio (标准输入输出)
- 1: sse (Server-Sent Events)
"""
__tablename__: str = "app_ai_mcp"
__table_args__: dict[str, str] = {"comment": "MCP 服务器表"}
__loader_options__: list[str] = ["created_by", "updated_by"]
name: Mapped[str] = mapped_column(String(50), comment="MCP 名称")
type: Mapped[int] = mapped_column(Integer, default=0, comment="MCP 类型(0:stdio 1:sse)")
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[dict[str, str] | None] = mapped_column(JSON(), default=None, comment="MCP 环境变量")