slicequeue/poc-node-mcp-server
If you are the rightful owner of poc-node-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 POC Node MCP Server is a demonstration project designed for learning and testing the development of Model Context Protocol (MCP) servers, offering various computational tools and user information resources.
add
Performs addition of two numbers.
get_weather
Retrieves random weather information for a given city.
POC Node MCP Server
POC (Proof of Concept) - MCP(Model Context Protocol) μλ² κ°λ° νμ΅ λ° ν μ€νΈλ₯Ό μν λ°λͺ¨ νλ‘μ νΈμ λλ€.
λ€μν κ³μ° λꡬμ μ¬μ©μ μ 보 리μμ€λ₯Ό μ 곡νλ MCP μλ²λ‘, MCP μλ² κ°λ° λ°©λ²μ νμ΅νκ³ ν μ€νΈν μ μμ΅λλ€.
π― νλ‘μ νΈ λͺ©μ
- MCP μλ² κ°λ° λ°©λ² νμ΅
- Toolκ³Ό Resourceμ μ°¨μ΄μ μ΄ν΄
- LLMκ³Όμ μ°λ ν μ€νΈ
- npm ν¨ν€μ§ λ°°ν¬ λ° npx μ€ν ν μ€νΈ
μ€μΉ
npm install -g poc-node-mcp-server
λλ npx
λ‘ μ§μ μ€ν:
npx poc-node-mcp-server
μ 곡νλ κΈ°λ₯
Tools (λꡬ)
1. add - μν κ³μ°
λ μ«μλ₯Ό μ λ ₯λ°μ κ·Έ ν©μ λ°νν©λλ€.
{
"method": "tools/call",
"params": {
"name": "add",
"arguments": {
"a": 5,
"b": 3
}
}
}
2. get_weather - λ μ¨ μ 보 μ‘°ν
λμ μ΄λ¦μ μ λ ₯λ°μ ν΄λΉ λμμ λλ€ λ μ¨ μ 보λ₯Ό λ°νν©λλ€.
{
"method": "tools/call",
"params": {
"name": "get_weather",
"arguments": {
"city": "μμΈ"
}
}
}
Resources (리μμ€)
1. greeting - μΈμ¬λ§
μ¬μ©μ μ΄λ¦μ λ°μ μΈμ¬λ§μ μμ±ν©λλ€.
URI: greeting://νκΈΈλ
2. user_profile - μ¬μ©μ νλ‘ν
μ¬μ©μ μ΄λ¦μ λ°μ λλ€ν νλ‘ν μ 보λ₯Ό μμ±ν©λλ€.
URI: user_profile://κΉμ² μ
Gemini CLI μ°λ
.gemini/settings.json
νμΌμ λ€μ μ€μ μ μΆκ°νμΈμ:
{
"mcpServers": {
"demo-mcp-server": {
"command": "npx",
"args": ["poc-node-mcp-server"],
"description": "POC MCP μλ² - νμ΅ λ° ν
μ€νΈμ© λ€μν κ³μ° λꡬμ μ¬μ©μ μ 보 리μμ€ μ 곡"
}
}
}
μ¬μ© μμ
LLMκ³Όμ λν
μ¬μ©μ: "5μ 3μ λν΄μ€"
LLM: add λꡬλ₯Ό μ¬μ©νμ¬ 8μ λ°ν
μ¬μ©μ: "μμΈμ λ μ¨λ₯Ό μλ €μ€"
LLM: get_weather λꡬλ₯Ό μ¬μ©νμ¬ "μμΈμ νμ¬ λ μ¨: λ§μ, κΈ°μ¨: 15Β°C, μ΅λ: 65%" λ°ν
μ¬μ©μ: "νκΈΈλμκ² μΈμ¬ν΄μ€"
LLM: greeting://νκΈΈλ 리μμ€μ μ κ·Όνμ¬ "μλ
νμΈμ, νκΈΈλλ!" λ°ν
μ¬μ©μ: "κΉμ² μμ νλ‘νμ 보μ¬μ€"
LLM: user_profile://κΉμ² μ 리μμ€μ μ κ·Όνμ¬ λλ€ νλ‘ν μ 보 λ°ν
κ°λ°
λ‘컬 κ°λ° νκ²½ μ€μ
# μμ‘΄μ± μ€μΉ
npm install
# TypeScript λΉλ
npm run build
# κ°λ° λͺ¨λ μ€ν
npm run dev
# ν
μ€νΈ μ€ν
npm test
νλ‘μ νΈ κ΅¬μ‘°
poc-node-mcp-server/
βββ src/
β βββ index.ts # λ©μΈ MCP μλ² μ½λ
βββ dist/
β βββ index.js # λΉλλ JavaScript νμΌ
βββ test-mcp.js # MCP μλ² ν
μ€νΈ μ€ν¬λ¦½νΈ
βββ package.json # νλ‘μ νΈ μ€μ
βββ tsconfig.json # TypeScript μ€μ
βββ MCP_Learning_Guide.md # MCP νμ΅ κ°μ΄λ
βββ README.md # νλ‘μ νΈ λ¬Έμ
π νμ΅ μλ£
μ΄ νλ‘μ νΈλ MCP μλ² κ°λ°μ μν νμ΅ μλ£μ
λλ€. MCP_Learning_Guide.md
νμΌμμ λ€μ λ΄μ©μ νμ΅ν μ μμ΅λλ€:
- MCP μλ² κΈ°λ³Έ κ°λ
- Tool vs Resource μ°¨μ΄μ
- LLM νμ©μ μν μ΅μ ν λ°©λ²
- Transport λ°©μ μ΄ν΄
- μ€μ ꡬν μμ
- Gemini CLI μ°λ λ°©λ²
β οΈ μ£Όμμ¬ν
- μ΄ νλ‘μ νΈλ νμ΅ λ° ν μ€νΈ λͺ©μ μΌλ‘ μ μλμμ΅λλ€.
- μ€μ νλ‘λμ νκ²½μμ μ¬μ©νκΈ°μλ λΆμ‘±ν λΆλΆμ΄ μμ μ μμ΅λλ€.
- λλ€ λ°μ΄ν°λ₯Ό μ¬μ©νλ―λ‘ μ€μ λ°μ΄ν°μ λ€λ₯Ό μ μμ΅λλ€.
λΌμ΄μ μ€
ISC
κΈ°μ¬νκΈ°
- μ΄ μ μ₯μλ₯Ό ν¬ν¬νμΈμ
- μλ‘μ΄ κΈ°λ₯ λΈλμΉλ₯Ό λ§λμΈμ (
git checkout -b feature/amazing-feature
) - λ³κ²½μ¬νμ 컀λ°νμΈμ (
git commit -m 'Add some amazing feature'
) - λΈλμΉμ νΈμνμΈμ (
git push origin feature/amazing-feature
) - Pull Requestλ₯Ό μμ±νμΈμ