blueworm-lee/mcp_chat
3.1
If you are the rightful owner of mcp_chat and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
FastAPI MCP Chat is a Model Context Protocol-based chat service designed for efficient communication.
FastAPI MCP Chat
- FastAPI κΈ°λ°μ MCP(Model Context Protocol) μ±ν μλΉμ€μ λλ€.
- Host(UI), MCP Client, MCP Serverλ₯Ό μμ ν λΆλ¦¬μν¨ λ°λͺ¨μ λλ€.
- λ³Έ λ°λͺ¨μμ Host λΆλΆμ λΉΌκ±°λ λ³λ API μλν¬μΈνΈλ‘ μ°κ²°νλ©΄ λ©λλ€. (POST /chat/stream)
- .env νμΌ μμ±μ΄ νμν©λλ€.
- GPT ν€λ λ°λμ νμν©λλ€ (ANTHROPIC μ¬μ©νλλΌλ λΉμ©μ κ°μ μν΄ λ©μμ§ summary λΆλΆμμ gpt-miniλ₯Ό μ¬μ©ν¨)
- ANTHROPIC ν€λ μ΅μ μ λλ€
μꡬμ¬ν
- Python 3.8+
- uv - Python ν¨ν€μ§ κ΄λ¦¬μ
- Linux/macOS (systemd μ§μ)
μ€μΉ λ°©λ²
1. uv μ€μΉ (νμν κ²½μ°)
# Linux/macOS
curl -LsSf https://astral.sh/uv/install.sh | sh
2. νλ‘μ νΈ ν΄λ‘
git clone https://github.com/blueworm-lee/mcp-chat.git
cd mcp-chat
3. μλ μ€μΉ
chmod +x install/install.sh
./install/install.sh
μ€μΉ μ€ν¬λ¦½νΈλ λ€μ μμ μ μνν©λλ€:
- Python μμ‘΄μ± μ€μΉ (
uv sync
) - λ‘κ·Έ λλ ν 리 μμ± (
/var/log/mcp_chat
) - systemd μλΉμ€ λ±λ‘
4. νκ²½ μ€μ
.env νμΌμ μμ±νμΈμ:
OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
ANTHROPIC_API_KEY="sk-ant-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
TAVILY_API_KEY="tvly-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
μ°Έκ³ :
- OPENAI_API_KEY: νμ - λ©μμ§ μμ½μ μ¬μ©
- ANTHROPIC_API_KEY: μ ν - Claude λͺ¨λΈ μ¬μ© μ νμ
- TAVILY_API_KEY: νμ - μΉ κ²μ κΈ°λ₯ μ¬μ© μ νμ (κ²μ κΈ°λ₯μ κΈ°λ³Έ toolλ‘ λ£μ)
λ°λͺ¬ ꡬλ
μλΉμ€ κ΄λ¦¬
# μλΉμ€ μμ
sudo systemctl start mcp_client
# μλΉμ€ μ€μ§
sudo systemctl stop mcp_client
# μλΉμ€ μ¬μμ
sudo systemctl restart mcp_client
# μλΉμ€ μν νμΈ
sudo systemctl status mcp_client
λΆν μ μλ μμ
# μλ μμ νμ±ν
sudo systemctl enable mcp_client
# μλ μμ λΉνμ±ν
sudo systemctl disable mcp_client
λ‘κ·Έ νμΈ
# μ€μκ° λ‘κ·Έ 보기
sudo journalctl -u mcp_client -f
# μ΅κ·Ό λ‘κ·Έ νμΈ
sudo journalctl -u mcp_client --since "1 hour ago"
API μλν¬μΈνΈ
- POST
/chat/stream
- μ€νΈλ¦¬λ° μ±ν API
κ°λ° λͺ¨λ
κ°λ° μ€μλ μλΉμ€ λμ μ§μ μ€νν μ μμ΅λλ€:
# κ°λ° μλ² μ€ν
uv run uvicorn main:app --host 0.0.0.0 --port 8000 --reload
νΈλ¬λΈμν
μλΉμ€κ° μμλμ§ μλ κ²½μ°
# μλΉμ€ μν νμΈ
sudo systemctl status mcp_client
# μμΈ λ‘κ·Έ νμΈ
sudo journalctl -u mcp_client -n 50
νκ²½ λ³μ λ¬Έμ
.env νμΌμ΄ νλ‘μ νΈ λ£¨νΈμ μλμ§ νμΈνκ³ , API ν€κ° μ¬λ°λ₯Έμ§ νμΈνμΈμ.
λΌμ΄μ μ€
MIT License