cloudtypej/mcp-server
If you are the rightful owner of 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.
This project is an implementation example of a Remote MCP (Model Context Protocol) server using StreamableHTTPServerTransport.
calculator
Performs simple arithmetic calculations
user-list
Retrieves a list of users over a specified period
user-statistics
Retrieves subscriber statistics over a specified period
MCP Server Example
์ด ํ๋ก์ ํธ๋ StreamableHTTPServerTransport๋ฅผ ์ฌ์ฉํ Remote MCP (Model Context Protocol) ์๋ฒ์ ๊ตฌํ ์์ ์ ๋๋ค.
๐ก ํ: MCP ์๋ฒ๋ฅผ ์ฒ์ ์ฌ์ฉํ์๋ ๊ฒฝ์ฐ, MCP ๊ณต์ ๋ฌธ์๋ฅผ ์ฐธ์กฐํ์ธ์.
์์ํ๊ธฐ
์์กด์ฑ ์ค์น
npm install
์คํ ๋ฐฉ๋ฒ
๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ
npm run dev
ํ๋ก๋์ ํ๊ฒฝ
npm run build
npm start
์ ๊ณต ๋๊ตฌ
calculator
- ๊ธฐ๋ฅ: ๊ฐ๋จํ ์์ ๊ณ์ฐ ์ํ
user-list
- ๊ธฐ๋ฅ: ํน์ ๊ธฐ๊ฐ ๋์์ ์ฌ์ฉ์ ๋ชฉ๋ก ์กฐํ
user-statistics
- ๊ธฐ๋ฅ: ํน์ ๊ธฐ๊ฐ ๋์์ ๊ฐ์ ์ ํต๊ณ ์กฐํ
ํ๊ฒฝ ์ค์
ํ๊ฒฝ ๋ณ์
๋ณ์๋ช | ์ค๋ช | ํ์ ์ฌ๋ถ |
---|---|---|
TOKEN | API ์ธ์ฆ ํ ํฐ Authorization ํค๋์ ์ผ์นํ๋ ๊ฒฝ์ฐ ์ธ์ฆ | ํ์ |
ALLOWED_ORIGIN | CORS Origin | ์ ํ |
ํ๊ฒฝ ๋ณ์ ์ค์ ์์
# .env ํ์ผ
TOKEN=your-secret-token-here
ALLOWED_ORIGIN=
ํด๋ผ์ด์ธํธ ์ค์
Cursor IDE ์ค์
.cursor-settings.json
ํ์ผ์ ๋ค์๊ณผ ๊ฐ์ด ์ค์ :
{
"mcpServers": {
"example": {
"url": "http://localhost:3000/mcp",
"headers": {
"Authorization": "Bearer <TOKEN>"
}
}
}
}
๐ ์ฐธ๊ณ :
<TOKEN>
์ ์ค์ ํ๊ฒฝ๋ณ์TOKEN
๊ฐ์ผ๋ก ๊ต์ฒดํ์ธ์.
API ์๋ํฌ์ธํธ
- Base URL:
http://localhost:3000
- MCP Endpoint:
/mcp
์ธ์ฆ
์๋ฒ๋ Bearer Token ์ธ์ฆ์ ์ฌ์ฉํฉ๋๋ค:
Authorization: Bearer <TOKEN>
์ถ๊ฐ ์ ๋ณด
๊ฐ๋ฐ ํ๊ฒฝ ์ค์
# ์์กด์ฑ ์ค์น
npm install
# ๊ฐ๋ฐ ์๋ฒ ์์
npm run dev
ํ๋ก๋์ ๋ฐฐํฌ
# ๋น๋
npm run build
# ํ๋ก๋์
์๋ฒ ์์
npm start
๋ฌธ์ ํด๊ฒฐ
์์ฃผ ๋ฐ์ํ๋ ๋ฌธ์ ๋ค
- 401 Unauthorized: TOKEN ํ๊ฒฝ๋ณ์๊ฐ ์ค์ ๋์ด ์๋์ง ํ์ธ
- Connection refused: ์๋ฒ๊ฐ ์ฌ๋ฐ๋ฅด๊ฒ ์์๋์๋์ง ํ์ธ
๐ ๋ผ์ด์ผ์ค
MIT License