duddn2012/ruby-on-rails-mcp-server
If you are the rightful owner of ruby-on-rails-mcp-server 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.
The Model Context Protocol (MCP) server is designed to facilitate AI-driven cosmetic recommendations by analyzing user skin data and preferences.
register_user_skin_info
Registers user skin information for personalized recommendations.
get_cosmetic_recommendations
Requests cosmetic recommendations based on user data.
get_product_details
Retrieves detailed information about a specific product.
๋ด ํ์ฅํ์ ์ฐพ์์ค!
๊ฐ์
์ฌ์ฉ์์ ํผ๋ถ ์ํ์ ๊ณ ๋ฏผ์ฌํญ์ ๋ถ์ํ์ฌ ์ต์ ์ ํ์ฅํ์ ์ถ์ฒํด์ฃผ๋ AI ๊ธฐ๋ฐ ์๋น์ค์ ๋๋ค.
์ฃผ์ ๊ธฐ๋ฅ
- ๊ฐ์ธ ๋ง์ถคํ ํ์ฅํ ์ถ์ฒ: ํผ๋ถํ์ , ๊ณ ๋ฏผ์ฌํญ, ์ฐ๋ น๋๋ฅผ ๊ณ ๋ คํ ๋ง์ถค ์ถ์ฒ
- ์ฑ๋ถ ๊ธฐ๋ฐ ๋ถ์: ํ์ฅํ ์ฑ๋ถ์ ํจ๊ณผ์ ์์ ์ฑ์ ๋ฐ์ดํฐ๋ก ๋ถ์
- AI ์ด์์คํดํธ ์ฐ๋: MCP ์๋ฒ๋ฅผ ํตํ ์์ฐ์ด ๊ธฐ๋ฐ ์๋ด ์๋น์ค
๐ ์์คํ ์ํคํ ์ฒ
์ฌ์ฉ์ โ AI ์ด์์คํดํธ โ Rails ์ฑ (API + MCP ์๋ฒ) โ Database
๊ธฐ์ ์คํ
- Backend: Ruby on Rails
- Database: SQLite (๊ฐ๋ฐ) / PostgreSQL (์ด์)
- AI ์ฐ๋: MCP (Model Context Protocol) ์๋ฒ
- ๋ฐฐํฌ: Heroku
๐ ๋ฐ์ดํฐ ๋ชจ๋ธ
User (์ฌ์ฉ์)
- skin_type: ํผ๋ถํ์ (๊ฑด์ฑ/์ง์ฑ/๋ณตํฉ์ฑ)
- concerns: ๊ณ ๋ฏผ์ฌํญ (์ฌ๋๋ฆ/์ฃผ๋ฆ/๋ฏธ๋ฐฑ ๋ฑ)
- age_group: ์ฐ๋ น๋
Product (ํ์ฅํ)
- name, brand, category, ingredients, effects, price_range
Recommendation (์ถ์ฒ)
- user_id, product_id, score: ๋งค์นญ ์ ์
๐ค MCP ์๋ฒ ๊ตฌํ
ํ๋ก์ ํธ ๊ตฌ์กฐ
app/ โโโ controllers/ # ๊ธฐ์กด API ์ปจํธ๋กค๋ฌ โโโ models/ # ๊ธฐ์กด ๋ชจ๋ธ โโโ mcp/ # MCP ์๋ฒ (์๋ก ์ถ๊ฐ) โ โโโ server.rb # MCP ์๋ฒ ๋ฉ์ธ ํด๋์ค โ โโโ tools/ # MCP ๋๊ตฌ๋ค โ โโโ schemas/ # ์คํค๋ง ์ ์ โโโ views/ # ๊ธฐ์กด ๋ทฐ
MCP ๋๊ตฌ
- register_user_skin_info: ์ฌ์ฉ์ ํผ๋ถ ์ ๋ณด ๋ฑ๋ก
- get_cosmetic_recommendations: ํ์ฅํ ์ถ์ฒ ์์ฒญ
- get_product_details: ์ ํ ์์ธ ์ ๋ณด ์กฐํ
๐ ์ถ์ฒ ์๊ณ ๋ฆฌ์ฆ
๊ธฐ๋ณธ ์ถ์ฒ ๋ก์ง
- ์ฌ์ฉ์ ํผ๋ถํ์ ๊ณผ ๊ณ ๋ฏผ์ฌํญ ๋ถ์
- ์ฑ๋ถ ๋ฐ์ดํฐ๋ฒ ์ด์ค์์ ์ ํฉํ ์ฑ๋ถ ์ฐพ๊ธฐ
- ํด๋น ์ฑ๋ถ์ด ํฌํจ๋ ์ ํ๋ค ํํฐ๋ง
- ๊ฐ๊ฒฉ๋, ๋ธ๋๋ ์ ํธ๋ ๊ณ ๋ คํ์ฌ ์์ ๊ฒฐ์
๋งค์นญ ์ ์ ๊ณ์ฐ
- ํผ๋ถํ์ ๋งค์นญ: 40์
- ๊ณ ๋ฏผ์ฌํญ ๋งค์นญ: 30์
- ์ฐ๋ น๋ ๋งค์นญ: 20์
- ๊ฐ๊ฒฉ๋ ๋งค์นญ: 10์
๐จ AI ์ด์์คํดํธ ์ฐ๋
์ฌ์ฉ ์์
์ฌ์ฉ์: "๊ฑด์ฑ ํผ๋ถ์ธ๋ฐ ์ฃผ๋ฆ์ด ๋ง์ด ์๊ธฐ๊ณ ์์ด์. ์ถ์ฒํด์ฃผ์ธ์."
AI ์ด์์คํดํธ โ MCP ์๋ฒ:
- register_user_skin_info ํธ์ถ
- get_cosmetic_recommendations ํธ์ถ
- ๊ฒฐ๊ณผ๋ฅผ ์์ฐ์ด๋ก ๋ณํํ์ฌ ์๋ต
์์ฐ์ด ๋ช ๋ น์ด ์์
- "๊ฑด์ฑ ํผ๋ถ์ ์ข์ ์ธ๋ผ ์ถ์ฒํด์ค"
- "์ฌ๋๋ฆ์ฑ ํผ๋ถ์ฉ ํ ๋ ์ฐพ์์ค"
- "30๋ ์ฌ์ฑ์ฉ ์ํฐ์์ด์ง ํฌ๋ฆผ ์ถ์ฒ"
- "์ถ์ฒ๋ฐ์ ์ ํ์ ์ฑ๋ถ ๋ถ์ํด์ค"
๐ ๊ฐ๋ฐ ๋ฐ ๋ฐฐํฌ
๊ฐ๋ฐ ํ๊ฒฝ ์ค์
bash bundle install rails db:create db:migrate db:seed rails server
MCP ์๋ฒ ์คํ
bash rails mcp:server:start
๋๋
ruby app/mcp/server.rb
ํ๊ฒฝ ์ค์
ruby
config/mcp_server.yml
development: port: 3001 host: "localhost" api_base_url: "http://localhost:3000/api"
Heroku ๋ฐฐํฌ
bash git push heroku main heroku ps:scale mcp=1
๐ API ์๋ํฌ์ธํธ
์ฌ์ฉ์ ๊ด๋ฆฌ
- POST /api/users - ์ฌ์ฉ์ ํผ๋ถ ์ ๋ณด ๋ฑ๋ก
- GET /api/users/:id - ์ฌ์ฉ์ ์ ๋ณด ์กฐํ
์ ํ ๊ด๋ฆฌ
- GET /api/products - ํ์ฅํ ๋ชฉ๋ก ์กฐํ
- GET /api/products/:id - ์ ํ ์์ธ ์ ๋ณด
์ถ์ฒ ์์คํ
- POST /api/recommendations - ํ์ฅํ ์ถ์ฒ ์์ฒญ
- GET /api/recommendations/:user_id - ์ฌ์ฉ์๋ณ ์ถ์ฒ ๊ฒฐ๊ณผ ์กฐํ
์ด์ AI ์ด์์คํดํธ๊ฐ MCP ์๋ฒ๋ฅผ ํตํด ์ง๋ฅ์ ์ธ ํ์ฅํ ์ถ์ฒ ์๋น์ค๋ฅผ ์ ๊ณตํ ์ ์์ต๋๋ค!