公司有必要建设网站吗lamp环境做网站
2026/3/11 3:17:17 网站建设 项目流程
公司有必要建设网站吗,lamp环境做网站,微信推广软件,深圳社保个人网页代码cline写的 MCP客户端示例 可用的MCP服务器#xff1a; - blender-tool: Blender 工具服务器 - ue-tool: Unreal Engine工具服务器 - browser-tool: 浏览器工具服务器 - computer-tool: 计算机 控制工具服务器 - ocr-tool: OCR工具服务 器 - likefavarite-tools: 点…代码cline写的MCP客户端示例 可用的MCP服务器 - blender-tool: Blender 工具服务器 - ue-tool: Unreal Engine工具服务器 - browser-tool: 浏览器工具服务器 - computer-tool: 计算机 控制工具服务器 - ocr-tool: OCR工具服务 器 - likefavarite-tools: 点赞收藏检测工具服务器 示例1列出Blender工具 Blender工具服务器 (blender-tool) 可用工具 - activate_blender_window: 激活Blender窗口精 确匹配窗口标题如果没有运行则启动Blender - fix_model: 执行 Fix Model 操作 - import_pmx_file: 导入PMX文件 - delete_all_objects: 删除所有对象和集合 - parent_object_to_armature: 将选中的对象设置为骨骼绑定父级 - set_blender_scale_settings: 设置Blender场景的单 位比例和当前对象的缩放 - delete_objects_by_name: 删除名称包含指定模式的物体 Args: name_pattern (str): 要匹配的名称模式 - clear_parent_keep_transform: 清除选中对象的父级关系但保持变换位置、旋转、缩放 - apply_armature_pose: 切换到姿态模式并应用选中的骨架 - scale_objects_to_match_height: 将所有不包含ObjectName的物体缩放到与ObjectName物体相同的高度三轴等比例缩放 - import_psk_file: 导入PSK文件外部选择文件路径 - parent_object_to_bone: 将选中的对象设置为骨骼父级 - add_data_transfer_modifier: 添加数据传输修改器并配置顶点组权重传输 示例2调用Blender的activate_blender_window工具 调用 blender-tool 的 activate_blender_window 工 具结果 false 示例3调用computer工具 的click_mouse工具示例 坐标 调用 computer-tool 的 click_mouse 工具结果 点击成功: (100, 100), 类型: left, 次数: 1 示例4调用OCR工具的find_text_coordinates工具 调用 ocr-tool 的 find_text_coordinates 工具结果 { text: 示例文本, target_text: 示例文本, center_x: 429, center_y: 694 } 演示完成。#!/usr/bin/env python3 MCP客户端示例脚本 - 调用MCP服务器中的工具 此脚本演示如何使用mcp库连接到已配置的MCP服务器并调用其工具。 支持的服务器包括blender-tool, ue-tool, browser-tool, computer-tool, ocr-tool, likefavarite-tools import asyncio import sys import os # 导入mcp客户端相关模块 from mcp import ClientSession, StdioServerParameters from mcp.client.stdio import stdio_client class MCPClient: MCP客户端类用于连接和调用MCP服务器工具 def __init__(self): self.servers { blender-tool: { command: sys.executable, args: [os.path.join(my_python_server, blender_cline, blender_api_tool.py)], description: Blender工具服务器 }, ue-tool: { command: sys.executable, args: [os.path.join(my_python_server, ue_cline, ue_api_tool.py)], description: Unreal Engine工具服务器 }, browser-tool: { command: sys.executable, args: [os.path.join(my_python_server, browser_cline, browser_api_tool.py)], description: 浏览器工具服务器 }, computer-tool: { command: sys.executable, args: [os.path.join(my_python_server, computer_cline, computer_api_tool.py)], description: 计算机控制工具服务器 }, ocr-tool: { command: sys.executable, args: [os.path.join(my_python_server, ocr, ocr.py)], description: OCR工具服务器 }, likefavarite-tools: { command: sys.executable, args: [os.path.join(my_python_server, yolo, detect_like_favorite.py)], description: 点赞收藏检测工具服务器 } } async def list_tools(self, server_name): 列出指定服务器的所有可用工具 if server_name not in self.servers: print(f错误未知的服务器 {server_name}) return [] server_config self.servers[server_name] server_params StdioServerParameters( commandserver_config[command], argsserver_config[args], envNone ) try: async with stdio_client(server_params) as (read, write): async with ClientSession(read, write) as session: # 初始化会话 await session.initialize() # 获取可用工具 tools_result await session.list_tools() tools tools_result.tools print(f\n{server_config[description]} ({server_name}) 可用工具) for tool in tools: print(f- {tool.name}: {tool.description}) return tools except Exception as e: print(f连接到 {server_name} 时出错: {e}) return [] async def call_tool(self, server_name, tool_name, argumentsNone): 调用指定服务器的指定工具 if server_name not in self.servers: print(f错误未知的服务器 {server_name}) return None if arguments is None: arguments {} server_config self.servers[server_name] server_params StdioServerParameters( commandserver_config[command], argsserver_config[args], envNone ) try: async with stdio_client(server_params) as (read, write): async with ClientSession(read, write) as session: # 初始化会话 await session.initialize() # 调用工具 result await session.call_tool(tool_name, arguments) print(f\n调用 {server_name} 的 {tool_name} 工具结果) for content in result.content: if hasattr(content, text): print(content.text) elif hasattr(content, type): print(f[{content.type}]: {content}) return result except Exception as e: print(f调用 {server_name} 的 {tool_name} 时出错: {e}) return None async def main(): 主函数演示如何使用MCP客户端 client MCPClient() print(MCP客户端示例) print( * 50) # 选择要使用的服务器 print(\n可用的MCP服务器) for name, config in client.servers.items(): print(f- {name}: {config[description]}) # 示例1列出Blender工具 print(\n示例1列出Blender工具) await client.list_tools(blender-tool) # 示例2调用一个简单的工具如果可用 print(\n示例2调用Blender的activate_blender_window工具) await client.call_tool(blender-tool, activate_blender_window) # 示例3调用computer工具的click_mouse需要坐标参数 print(\n示例3调用computer工具的click_mouse工具示例坐标) await client.call_tool(computer-tool, click_mouse, { x: 100, y: 100, click_type: left, clicks: 1 }) # 示例4调用OCR工具 print(\n示例4调用OCR工具的find_text_coordinates工具) await client.call_tool(ocr-tool, find_text_coordinates, { text_to_find: 示例文本 }) print(\n演示完成。) if __name__ __main__: # 运行异步主函数 asyncio.run(main())

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询