KJH
MCP 사용해보기 (/w cursor, unity) 본문
Model Context Protocol(MCP)를 간단하게 설명하고 무료버전 cursor로 사용해보는 게시글이다.
일반적으로 AI를 사용한다! 하면 LLM을 통해 질의를 하고 답변을 받아서 유저가 실행하는 방식이다.
하지만 MCP는 LLM과 Tool을 연동하여 나의 질의를 LLM이 답을 내고, Tool에 실행을 시킨다. (!!)
AI Agent와 유사하지만 이것을 사용하는 방법이 훨씬 편해졌다. 이 기능은 가파르게 성장중이고,
많은 기업들이 MCP서버를 제공하여 자신의 SW를 쉽고 편하게 사용하도록 하고 있다.
우선 첫번째 준비물 cursor를 다운 받는다.
https://www.cursor.com/downloads
Downloads | Cursor - The AI Code Editor
Download Cursor
www.cursor.com
설치 후 톱니바퀴(Setting)를 누르면 아래와 같은 MCP 설정 창을 볼 수 있다. (처음은 빈 화면일 것이다)
MCP server를 쉽게 import할 수 있는 사이트이다. (docker hub, hugging face 같은)
Smithery - Model Context Protocol Registry
Enable AI agents to seamlessly interact with VS Code, enhancing their capabilities to modify files, open projects, and check extension statuses. Streamline your development workflow by integrating AI assistance directly into your coding environment. Experi
smithery.ai
대표적으로 Agent 효과를 보려면 Desktop Commander 를 사용해야한다.
이 plugin은 로컬에 파일을 쓰고 지우고 실행하고,, 등등 명령 한번에 알아서 북치고 장구를 쳐준다.
mcp를 설치하는 화면인데 처음 할땐 npm으로 설치하는것을 권장한다.
JSON으로 밀어 넣으면 디버깅이 어렵다. (우선 확인했던건 node, npm 버전이 낮으면 에러가 발생하니 최신화 해주자)
잘 설치가 되면 mcp.json에 아래와 같은 값이 들어있을 것이고, 초록불을 확인할 수 있다.
"mcpServers": {
"desktop-commander": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@smithery/cli@latest",
"run",
"@wonderwhy-er/desktop-commander",
"--key",
"xxx"
]
},
추가로 YOLO 모드라고 Accecpt를 하지 않아도 쭉쭉 실행되게 하는 옵션을 활성화 한다! (production에선 비추)
기본적인 agent는 구성이 끝났다..!
Agent를 선택하고 질의를 하면 로컬에 파일을 만들고 코드를 짜고 디버깅도 해주고 실행도 시켜준다..
--
추가로 unity와 연동하고 싶다면 아래 github을 참고 하면 된다.
https://github.com/justinpbarnett/unity-mcp/tree/master
GitHub - justinpbarnett/unity-mcp: A Unity MCP server that allows MCP clients like Claude Desktop or Cursor to perform Unity Edi
A Unity MCP server that allows MCP clients like Claude Desktop or Cursor to perform Unity Editor actions. - justinpbarnett/unity-mcp
github.com
python을 설치 후 환경에 맞게 step2를 진행한다.
package manager를 통해 위 github을 등록한다.
그러고 나면 Windows에 Unity MCP 설정이 생긴다.
사용하는 LLM에 맞게 Auto Configration을 누르면 초록불을 확인할 수 있고,
이렇게 Cursor + Unity mcp 설정은 끝난다.. cursor에서 ctrl+L을 통해 사용하면 된다.
구조
MCP서버가 지원하는 SW용 함수들은 아래 사진 처럼 Tools로 표기된다.
mcp json에 함수가 있는 경로가 지정되어 있으며 이것은 cursor가 불러와 사용하게 되는것이다.
"unityMCP": {
"command": "uv",
"args": [
"--directory",
"C:\\Users\\xxx\\xxx\\New Unity Project\\Library\\PackageCache\\com.justinpbarnett.unity-mcp@7cfb821eb3\\Python",
"run",
"server.py"
]
}
Windows 컨텍스트 메뉴에 Cursor 추가
아래 내용을 add_cursor_context_menu.reg 으로 만들고 실행!
Windows Registry Editor Version 5.00
; 디렉토리 배경 컨텍스트 메뉴에 Cursor 추가
[HKEY_CLASSES_ROOT\Directory\Background\shell\cursor]
@="Open in Cursor"
"Icon"="C:\\Users\\mskjh\\AppData\\Local\\Programs\\cursor\\Cursor.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\cursor\command]
@="\"C:\\Users\\mskjh\\AppData\\Local\\Programs\\cursor\\Cursor.exe\" \"%V\""
; 폴더 컨텍스트 메뉴에 Cursor 추가
[HKEY_CLASSES_ROOT\Directory\shell\cursor]
@="Open in Cursor"
"Icon"="C:\\Users\\mskjh\\AppData\\Local\\Programs\\cursor\\Cursor.exe"
[HKEY_CLASSES_ROOT\Directory\shell\cursor\command]
@="\"C:\\Users\\mskjh\\AppData\\Local\\Programs\\cursor\\Cursor.exe\" \"%V\""
'Python' 카테고리의 다른 글
GIL, ASGI, Uvicorn(/w fastapi) (0) | 2025.05.04 |
---|---|
args ??? kwargs ??? (0) | 2024.07.30 |
lambda ??? (0) | 2024.07.29 |
Slack API (fastapi - slack_bolt) (0) | 2024.07.19 |
azure openAI (GPT4.0, ada-002) (0) | 2023.11.26 |