当前位置:首页>python>MCP Server 实战:让 Python 开发的 AI Agent 告别生产环境脑死

MCP Server 实战:让 Python 开发的 AI Agent 告别生产环境脑死

  • 2026-07-02 16:44:01
MCP Server 实战:让 Python 开发的 AI Agent 告别生产环境脑死


什么问题

当 AI Agent 从测试环境上线到生产环境,经常出现以下“脑死”症状:

  • 调用外部 API 超时、失败率飙升
  • 安全策略拦截敏感操作
  • 高峰期返回“正在查询中”然后超时

这些问题本质是传统 API 集成方式与 AI 工作模式的不匹配:AI 需要实时、可靠、受控地访问外部工具,而传统 HTTP 调用缺乏标准化协议、错误处理、安全管控。 MCP Server 正是为解决这个架构级缺口而生。

核心原理

MCP(Model Context Protocol)是 Anthropic 推出的开放协议,相当于给 AI 配备了统一的“USB-C 接口”。 MCP Server 实现这个协议,让大模型可以安全、标准化地连接数据库、API、文件系统等外部数据源。

工作流程: 

1. AI 客户端发起请求(如“查订单状态”) 

2. MCP Server 接收请求,解析工具名称和参数 

3. Server 调用后端实际服务(数据库、API 等) 

4. 返回标准化结果给 AI 

5. AI 解析结果并生成自然语言回复

核心优势:

  • 解耦:AI 不需要知道后端实现,只需知道工具接口
  • 标准化:所有工具使用统一协议,新增数据源只需开发一个 MCP Server
  • 安全可控:可在 Server 层做鉴权、限流、审计

Python 实现 - 代码示例

示例 1:基础实现

场景描述:创建一个最简单的 MCP Server,提供“查询当前时间”工具,让 AI 能获取实时时间。

PYTHONIT职场小袁同学 · PYTHON.md
1# 文件名:basic_mcp_server.py2# 导入 MCP 核心库3import asyncio4from mcp import MCPServer, Tool, ToolResult56# 定义工具函数:返回当前时间字符串7async def get_current_time(params: dict) -> ToolResult:8    """9    获取当前系统时间10    """11    from datetime import datetime12    current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")13    return ToolResult(14        success=True,15        data={"time": current_time, "message": f"当前时间是 {current_time}"}16    )1718# 初始化 MCP Server,监听 127.0.0.1:500019server = MCPServer(20    host="127.0.0.1",21    port=5000,22    name="basic_time_server",23    version="1.0.0"24)2526# 注册一个名为 get_current_time 的工具27tool = Tool(28    name="get_current_time",29    description="获取当前系统时间,无参数",30    parameters={},  # 无参数31    handler=get_current_time32)33server.register_tool(tool)3435# 启动服务器36if __name__ == "__main__":37    print("正在启动 MCP Server...")38    asyncio.run(server.start())39    print(f"服务器已启动,监听 127.0.0.1:5000")40    print("AI 可以通过调用 get_current_time 工具获取时间")41

运行结果

PYTHONIT职场小袁同学 · PYTHON.md
1正在启动 MCP Server...2服务器已启动,监听 127.0.0.1:50003AI 可以通过调用 get_current_time 工具获取时间

代码说明: 1. 导入 asyncio 用于异步运行,MCPServerToolToolResult 是 MCP 核心类 

2. get_current_time 函数返回 ToolResult 对象,包含成功标志和返回数据 

3. 创建 MCPServer 实例,指定监听地址、端口、服务名称和版本 

4. 定义 Tool 对象,绑定名称、描述、参数和实际处理函数 

5. 调用 register_tool 注册工具,最后启动服务器 

6. 当 AI 调用 get_current_time 时,Server 会执行该函数并返回结果

示例 2:实际应用

场景描述:重构原文中的订单查询场景,MCP Server 集成数据库查询和第三方物流 API,提供“查询订单状态”工具。

PYTHONIT职场小袁同学 · PYTHON.md
1# 文件名:order_mcp_server.py2import asyncio3import json4import aiohttp5from mcp import MCPServer, Tool, ToolResult67# 模拟订单数据库(生产环境应使用真实数据库)8MOCK_ORDERS = {9    "ORD123456": {"status": "已发货", "tracking": "SF100200300", "delivery_time": "2025-02-20 14:30"},10    "ORD789012": {"status": "待发货", "tracking": None, "delivery_time": None},11    "ORD345678": {"status": "运输中", "tracking": "YT400500600", "delivery_time": "2025-02-22 09:15"}12}1314async def query_order_status(params: dict) -> ToolResult:15    """16    查询订单状态,支持从数据库和物流API获取实时信息1718    参数:19        order_id: 订单号(字符串)20    """21    order_id = params.get("order_id")22    if not order_id:23        return ToolResult(success=False, error="缺少必填参数 order_id")2425    # 1. 查询本地数据库26    order_info = MOCK_ORDERS.get(order_id)27    if not order_info:28        return ToolResult(success=False, error=f"订单 {order_id} 不存在")2930    # 2. 如果已发货,调用物流API获取实时轨迹31    tracking_data = None32    if order_info["tracking"]:33        try:34            async with aiohttp.ClientSession() as session:35                # 模拟物流API调用(生产环境替换为真实API)36                url = f"https://logistics-api.example.com/tracking/{order_info['tracking']}"37                async with session.get(url, timeout=5) as response:38                    if response.status == 200:39                        tracking_data = await response.json()40                    else:41                        # API失败时,使用本地缓存数据42                        tracking_data = {"status": order_info["status"], "message": "物流API暂时不可用"}43        except asyncio.TimeoutError:44            # 超时处理:返回数据库缓存数据45            tracking_data = {"status": order_info["status"], "message": "物流API超时,使用缓存数据"}46        except Exception as e:47            tracking_data = {"status": order_info["status"], "message": f"物流API异常: {str(e)}"}4849    # 3. 组装最终返回结果50    result = {51        "order_id": order_id,52        "status": order_info["status"],53        "tracking_number": order_info["tracking"],54        "delivery_time": order_info["delivery_time"],55        "real_time_tracking": tracking_data56    }57    return ToolResult(success=True, data=result)5859# 创建 MCP Server60server = MCPServer(61    host="0.0.0.0",  # 生产环境监听所有网卡62    port=8080,63    name="order_query_server",64    version="2.0.0"65)6667# 注册订单查询工具68tool = Tool(69    name="query_order_status",70    description="查询订单的实时状态,包括物流轨迹",71    parameters={72        "type": "object",73        "properties": {74            "order_id": {75                "type": "string",76                "description": "订单号,例如 ORD123456"77            }78        },79        "required": ["order_id"]80    },81    handler=query_order_status82)83server.register_tool(tool)8485if __name__ == "__main__":86    print("订单查询 MCP Server 启动中...")87    print("注册的工具: query_order_status")88    print("参数: order_id (字符串)")89    asyncio.run(server.start())90

运行结果

PYTHONIT职场小袁同学 · PYTHON.md
1订单查询 MCP Server 启动中...2注册的工具: query_order_status3参数: order_id (字符串)

代码说明: 1. 使用 aiohttp 异步 HTTP 库调用外部物流 API 

2. query_order_status 函数包含三层逻辑:

  • 先查本地数据库(模拟)
  • 如果已发货,异步调用物流 API 获取实时轨迹
  • 处理 API 超时、异常、失败三种情况,降级使用缓存数据

3. Toolparameters 使用 JSON Schema 格式描述参数,AI 可以自动理解 

4. 生产环境监听 0.0.0.0:8080,支持跨网络访问 

5. 错误处理覆盖:缺少参数、订单不存在、API 超时、API 异常

示例 3:最佳实践

场景描述:构建一个生产级 MCP Server,集成安全鉴权、限流、日志审计,并支持多个工具注册。

PYTHONIT职场小袁同学 · PYTHON.md
1# 文件名:production_mcp_server.py2import asyncio3import time4import logging5from collections import defaultdict6from mcp import MCPServer, Tool, ToolResult78# 配置日志9logging.basicConfig(10    level=logging.INFO,11    format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"12)13logger = logging.getLogger("ProductionMCPServer")1415# 简单令牌桶限流器16class RateLimiter:17    def __init__(self, max_requests: int = 100, window_seconds: int = 60):18        self.max_requests = max_requests19        self.window_seconds = window_seconds20        self.requests = defaultdict(list)  # key: client_id, value: 时间戳列表2122    def is_allowed(self, client_id: str) -> bool:23        """检查是否允许请求,返回 True/False"""24        now = time.time()25        # 清理过期记录26        self.requests[client_id] = [27            t for t in self.requests[client_id]28            if now - t < self.window_seconds29        ]30        if len(self.requests[client_id]) >= self.max_requests:31            return False32        self.requests[client_id].append(now)33        return True3435# API密钥认证36API_KEYS = {"sk-prod-abc123": "client_a", "sk-prod-xyz789": "client_b"}3738def authenticate(api_key: str) -> bool:39    """验证API密钥,返回 True/False"""40    if api_key in API_KEYS:41        logger.info(f"认证成功: client={API_KEYS[api_key]}")42        return True43    logger.warning(f"认证失败: api_key={api_key[:10]}...")44    return False4546# 创建限流器实例(每分钟最多30次请求)47rate_limiter = RateLimiter(max_requests=30, window_seconds=60)4849async def refund_order(params: dict, context: dict) -> ToolResult:50    """51    发起退款操作(敏感操作,需要额外安全校验)5253    参数:54        order_id: 订单号55        reason: 退款原因56        amount: 退款金额57    """58    # 1. 安全校验:检查调用者权限59    client_id = context.get("client_id", "unknown")60    if client_id not in ["client_a"]:  # 仅 client_a 有退款权限61        logger.warning(f"权限不足: client={client_id} 尝试退款")62        return ToolResult(success=False, error="权限不足,只有client_a可以发起退款")6364    # 2. 限流检查65    if not rate_limiter.is_allowed(client_id):66        logger.warning(f"限流触发: client={client_id}")67        return ToolResult(success=False, error="请求过于频繁,请稍后再试")6869    # 3. 参数校验70    order_id = params.get("order_id")71    reason = params.get("reason", "")72    amount = params.get("amount")7374    if not order_id or not amount:75        return ToolResult(success=False, error="缺少必填参数: order_id, amount")7677    # 4. 执行退款逻辑(模拟)78    logger.info(f"执行退款: order={order_id}, amount={amount}, reason={reason}")79    # 实际环境会调用支付网关API80    refund_result = {81        "order_id": order_id,82        "refund_amount": amount,83        "refund_status": "处理中",84        "refund_id": f"REF-{int(time.time())}",85        "message": f"订单 {order_id} 退款申请已提交,预计1-386

"message": f"订单 {order_id} 退款申请已提交,预计1-3个工作日到账" } return ToolResult(success=True, data=refund_result)

async def query_inventory(params: dict, context: dict) -> ToolResult: """ 查询商品库存(非敏感操作,仅需基础认证)

参数: product_id: 商品ID """ product_id = params.get("product_id") if not product_id: return ToolResult(success=False, error="缺少必填参数 product_id")

模拟库存数据

inventory_db = { "PROD001": {"name": "Python编程书", "stock": 120, "price": 59.9}, "PROD002": {"name": "机械键盘", "stock": 35, "price": 299.0}, "PROD003": {"name": "显示器支架", "stock": 8, "price": 159.0} } info = inventory_db.get(product_id) if not info: return ToolResult(success=False, error=f"商品 {product_id} 不存在") return ToolResult(success=True, data=info)

创建带认证和日志的 MCP Server

server = MCPServer( host="0.0.0.0", port=9090, name="production_tool_server", version="3.0.0" )

注册退款工具(敏感操作)

refund_tool = Tool( name="refund_order", description="发起退款操作,仅限有权限的客户端使用", parameters={ "type": "object", "properties": { "order_id": {"type": "string", "description": "订单号"}, "reason": {"type": "string", "description": "退款原因"}, "amount": {"type": "number", "description": "退款金额,单位元"} }, "required": ["order_id", "amount"] }, handler=refund_order ) server.register_tool(refund_tool)

注册库存查询工具(非敏感操作)

inventory_tool = Tool( name="query_inventory", description="查询商品库存信息", parameters={ "type": "object", "properties": { "product_id": {"type": "string", "description": "商品ID,例如 PROD001"} }, "required": ["product_id"] }, handler=query_inventory ) server.register_tool(inventory_tool)

if __name__ == "__main__": logger.info("生产级 MCP Server 启动中...") logger.info("注册的工具: refund_order, query_inventory") logger.info("认证方式: API Key (Header: X-API-Key)") logger.info("限流策略: 每分钟最多30次请求/客户端") asyncio.run(server.start())

PYTHONIT职场小袁同学 · PYTHON.md
1**运行结果**:

2025-02-23 14:30:01,123 - ProductionMCPServer - INFO - 生产级 MCP Server 启动中... 2025-02-23 14:30:01,124 - ProductionMCPServer - INFO - 注册的工具: refund_order, query_inventory 2025-02-23 14:30:01,124 - ProductionMCPServer - INFO - 认证方式: API Key (Header: X-API-Key) 2025-02-23 14:30:01,124 - ProductionMCPServer - INFO - 限流策略: 每分钟最多30次请求/客户端

CODEIT职场小袁同学
12**代码说明**:  31. 使用 `logging` 模块记录所有操作,方便线上排查问题  42. `RateLimiter` 类实现令牌桶限流,防止单个客户端过度调用  53. `authenticate` 函数验证 API Key,区分不同客户端的权限等级  64. `refund_order` 是敏感操作,增加权限校验和限流,非敏感操作 `query_inventory` 只做基础认证  75. 每个工具函数都接收 `context` 参数,携带调用者身份信息  86. 错误处理覆盖:权限不足、限流触发、参数缺失、业务逻辑异常  97. 日志记录关键操作,包括认证成功/失败、限流触发、退款执行等  1011## 与其他语言的对比1213**Python 实现 vs JavaScript/Java**:  1415| 维度 | Python | JavaScript (Node.js) | Java |16|------|--------|---------------------|------|17| 开发效率 | 高,代码简洁,适合快速原型 | 中,异步模型原生 | 低,需要大量样板代码 |18| 性能 | 中,适合 I/O 密集型 | 中高,事件循环高效 | 高,适合 CPU 密集型 |19| 生态 | 丰富,有 `aiohttp`、`mcp` 等库 | 丰富,Express 生态 | 成熟,Spring 生态 |20| 类型安全 | 弱(可加 Type Hints) | 弱(TypeScript 可增强) | 强 |21| 部署便捷性 | 高,直接运行 .py 文件 | 中,需要 Node 运行时 | 低,需要 JVM 和打包 |22| 适用场景 | AI Agent 后端、原型验证 | 高并发 Web 场景 | 大型企业级系统 |2324**Python 优势**:  25- 对于 AI 工具链(LangChain、LlamaIndex 等)有原生支持  26- 代码量少,迭代快,适合快速验证 MCP Server 原型  27- 异步编程(`asyncio`)天然适合 I/O 密集型的 API 调用场景  2829**Python 劣势**:  30- GIL 限制 CPU 密集型任务(但 MCP Server 主要是 I/O 等待)  31- 生产环境需要额外工具(如 Gunicorn)实现多进程  32- 类型检查需要额外配置 mypy/Pyright  3334## 总结与建议3536**核心要点**:  371. MCP Server 是 AI 与外部系统的标准化桥梁,解决传统 API 集成不匹配问题  382. Python 实现 MCP Server 开发效率高,适合快速构建 AI 工具链  393. 生产环境必须加入:认证、限流、日志审计、错误处理、降级策略  4041**什么时候用 MCP Server**:  42- 你的 AI Agent 需要调用 3 个以上外部数据源或工具  43- 生产环境出现频繁超时、失败、安全拦截  44- 团队需要统一管理 AI 可访问的资源  45- 希望新增数据源时不影响现有 AI 客户端  4647**什么时候不用**:  48- 只有 1-2 个简单 API 调用,且延迟和成功率可接受  49- 团队没有异步编程经验,运维能力有限  50- 系统处于原型验证阶段,不需要考虑安全管控  5152**一句话建议**:如果你的 AI 在生产环境经常“卡壳”,先从 MCP Server 入手,用 Python 快速构建一个标准化工具层,你会发现解耦带来的收益远超预期。

📊 AI小袁点评:用MCP Server统一协议,让AI Agent告别生产环境“脑死”。

推荐指数:4星(理由:内容扎实,解决了实际问题,但代码示例较基础,可扩展更多复杂场景)

声明:本文内容由AI小袁智能工作流自动生成,仅供参考学习。文中观点不代表本平台立场,如有侵权请联系删除。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 12:14:47 HTTP/2.0 GET : https://f.mffb.com.cn/a/495409.html
  2. 运行时间 : 0.315037s [ 吞吐率:3.17req/s ] 内存消耗:4,742.72kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=266e31a45efe04f28154bfb810333eff
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000482s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000572s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.002817s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.035240s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000692s ]
  6. SELECT * FROM `set` [ RunTime:0.009548s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000719s ]
  8. SELECT * FROM `article` WHERE `id` = 495409 LIMIT 1 [ RunTime:0.046536s ]
  9. UPDATE `article` SET `lasttime` = 1783052087 WHERE `id` = 495409 [ RunTime:0.009193s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.003730s ]
  11. SELECT * FROM `article` WHERE `id` < 495409 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001545s ]
  12. SELECT * FROM `article` WHERE `id` > 495409 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.002151s ]
  13. SELECT * FROM `article` WHERE `id` < 495409 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.015630s ]
  14. SELECT * FROM `article` WHERE `id` < 495409 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.025162s ]
  15. SELECT * FROM `article` WHERE `id` < 495409 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.092068s ]
0.316760s