Python์ผ๋ก ๊ตฌํ๋ MCP ์์ ์ ๋๋ค.
- OpenAI API ํค ์ค์ ์ด ํ์ํฉ๋๋ค. (
_mcp_client.py์์ ์ค์ )
mcp.json:
{
"mcpServers": {
"mcp-test": {
"command": "{python_path}",
"args": ["{_mcp_server.py path (relative path allowed)}"]
}
}
}- Python 3.x
- Python ์์กด์ฑ ์ค์น:
pip install -r requirements.txt- MCP Client ์คํ:
python _mcp_client.py- ์น ๋ธ๋ผ์ฐ์ ์์
http://localhost:8000์ ์
Spring AI๋ฅผ ์ฌ์ฉํ MCP ์์ ์ ๋๋ค.
Spring AI์ Starter ํตํด ๊ตฌ์ฑ๋๋ฉฐ application.properties์์ ์ปค์คํฐ๋ง์ด์ง ๊ฐ๋ฅํฉ๋๋ค.
- OpenAI API ํค ์ค์ (application.properties์์)
-
Java 21 ์ค์น
-
ํ๋ก์ ํธ ๋น๋ ๋ฐ ์คํ:
./gradlew bootRun- ์น ๋ธ๋ผ์ฐ์ ์์
http://localhost:8080์ ์