Skip to main content

Cocos Creator MCP Log Bridge

Project description

Cocos MCP Log Bridge

一个强大的日志桥接工具,用于在 Cocos Creator 编辑器和 Cursor AI 之间同步日志信息,帮助开发者更有效地分析和解决问题。

GitHub stars License

Cocos Creator Cursor AI

🌟 功能特点

  • 实时日志同步: 直接从 Cocos Creator 编辑器获取最新日志
  • 智能过滤: 支持按类型过滤(普通日志、警告、错误)
  • 关键词搜索: 精确定位特定问题
  • 一键清除: 随时清空日志以减少干扰
  • 场景信息: 获取当前场景的基本信息和节点列表
  • 场景操作: 支持打开场景等基础操作
  • TCP 通信桥接: 稳定可靠的通信机制
  • Cursor AI 集成: 完全兼容 Cursor MCP 协议

🚀 快速入门

前置条件

  • Cocos Creator 3.8.0 或更高版本
  • Python 3.7 或更高版本
  • uv 包管理器 (推荐) 或 pip

安装步骤

  1. 克隆仓库

    git clone https://github.com/czh2774/cocosMCP.git
    
  2. 复制到 Cocos Creator 项目

    将克隆的 cocosMCP 目录复制到你的 Cocos Creator 项目的 extensions 目录下。

  3. 安装 Python 依赖

    cd your-project/extensions/cocosMCP/Python
    uv pip install -r requirements.txt
    
  4. 在 Cocos Creator 中启用扩展

    启动 Cocos Creator,进入 扩展 -> 扩展管理器,确保 cocosMCP 扩展已启用。

  5. 配置 Cursor AI

    在 Cursor AI 设置中配置 MCP 服务器,指向 Python 服务器脚本。

基本用法

# 查询日志
logs = await mcp.query_logs({
    "show_logs": True,
    "show_warnings": True,
    "show_errors": True
})

# 清除日志
await mcp.clear_logs()

# 检查连接状态
status = await mcp.connection_status()

# 获取场景信息
scene_info = await mcp.get_scene_info()

# 列出场景中的所有节点
nodes = await mcp.list_scene_nodes()

# 打开指定UUID的场景
await mcp.open_scene("scene-uuid-here")

📚 详细文档

本项目包含三个详细的文档:

🔧 技术架构

Cocos MCP 由三个主要部分组成:

  1. Cocos Creator 扩展: TypeScript 编写的编辑器扩展
  2. TCP 通信桥: 连接编辑器和 Python 服务器
  3. Python MCP 服务器: 处理 Cursor AI 的请求

架构图

🤝 贡献指南

欢迎贡献代码、报告问题或提出新功能建议!请查看 开发者指南 了解详情。

📄 许可证

本项目采用 MIT 许可证 - 详情请参阅 LICENSE 文件。

🙏 致谢

  • Cocos Creator 团队提供的优秀游戏引擎
  • Cursor AI 团队开发的智能编程助手
  • 所有贡献者和用户的支持和反馈

如有问题或建议,请提交 Issues

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_czh2774_cocosmcp-1.0.2.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iflow_mcp_czh2774_cocosmcp-1.0.2-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file iflow_mcp_czh2774_cocosmcp-1.0.2.tar.gz.

File metadata

  • Download URL: iflow_mcp_czh2774_cocosmcp-1.0.2.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_czh2774_cocosmcp-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f161b9d8a86bb43144081a0a0bbb294caee4234d6ac2dad27764212209a7f8b0
MD5 35d06247a0e1bdb8658c54f67256eef1
BLAKE2b-256 66fd3038b0bee28e401dd91cdc4e7cc4af70d9b48a2938b452231befe90c745d

See more details on using hashes here.

File details

Details for the file iflow_mcp_czh2774_cocosmcp-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_czh2774_cocosmcp-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_czh2774_cocosmcp-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 76c4e4ab66e0375abb83524ef0c317e55e712e59929b6d1426284698c283bf5a
MD5 735da5c45dd5281a691c847a905ea6b8
BLAKE2b-256 479d394c7600cf3464918c67b469f1e8014e24a25b91e8fd70eddfb0061f8e80

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page