使用说明
unity mcp服务器
MCP服务器专注于Unity游戏开发工作流程。它提供了检查Unity项目、读/写文件、查询git历史、存储项目内存、通过Brave search搜索网络以及切换到面向导师模式的工具。
它做什么
- 通过MCP服务器公开Unity特定的工具(
stdio或HTTP传输) - 将文件操作限制在已配置的Unity项目目录中
- 在SQLite中持久化项目内存(
data/memory.db) - 支持通过Brave Search API查找网页/文档(可选)
- 使用OAuth 2.0通过HTTP传输支持Claude Web(对ngrok友好)
入门
可用工具
文件系统工具
list_unity_projectsget_project_structure(project_name)list_directory(path)read_file(file_path)write_file(file_path, content)create_script(project_name, script_name, script_content)search_files(project_name, pattern="*.cs", subdirectory="")get_file_info(file_path)
Git工具(只读)
detect_git_reposgit_status(project_name)git_log(project_name, max_count=15)git_diff(project_name, target="")git_branch_list(project_name)
记忆工具
store_memory(project, title, content, category="note", tags="")recall_memories(query="", project="", category="", tags="", limit=10)get_memory(memory_id)update_memory(memory_id, title="", content="", category="", tags="")delete_memory(memory_id)list_project_memories(project)
搜索工具
brave_search(query, count=5)search_unity_docs(query, count=5)fetch_url(url, max_length=10000)
导师模式工具/提示
toggle_learning_mode(enable=True)get_learning_status()explain_unity_concept(concept)- 提示:
unity_tutor(topic="general Unity development") - 提示:
unity_code_review(script_path="")
存储
- 默认数据库:
data/memory.db - 内存记录包括:项目、类别、标题、内容、标签、创建/更新的时间戳
备注
main.py是一个占位符,不用作服务器入口点。- 为了安全/可读性,大差异和提取的网络内容被截断。
- 搜索工具需要
BRAVE_API_KEY;如果没有它,它们将返回配置错误消息。