TypeScript MCP Server Boilerplate
This is a Vercel-deployed MCP server built on Next.js App Router, offering tools, prompts, and resources accessible via Streamable HTTP transport.
π οΈ Tools
greetβ Generate a greeting by providing a name and language (kooren)calculateβ Perform basic arithmetic (add,subtract,multiply,divide) on two numberstimeβ Get the current date and time for a specified timezone (default:Asia/Seoul)geocodeβ Look up latitude/longitude coordinates for a city name using Open-Meteoweatherβ Retrieve current weather conditions for given coordinates using Open-Meteogenerate-imageβ Generate images using HuggingFace's FLUX.1-schnell model (requiresHF_TOKENenv variable orx-hf-tokenrequest header)
π Prompts
code-reviewβ Generate a structured, senior-engineer-style code review from provided code
π¦ Resources
server-info(mcp://my-mcp-server/info) β Returns server metadata as JSON
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TypeScript MCP Server Boilerplatecalculate 5 + 3"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
my-mcp-server (Vercel Β· Streamable HTTP)
Next.js App Router μ mcp-handler μμμ
λμνλ Vercel λ°°ν¬ν MCP μλ²μ
λλ€. κΈ°μ‘΄ StdioServerTransport κΈ°λ° λ‘컬
μλ²λ₯Ό Streamable HTTP νΈλμ€ν¬νΈλ‘ μ΄μ νμ¬ μμμ MCP ν΄λΌμ΄μΈνΈ(Cursor,
Claude Desktop, MCP Inspector λ±) μμ μ격μΌλ‘ νΈμΆν μ μμ΅λλ€.
μν€ν μ²
MCP Client (Cursor / Inspector)
β Streamable HTTP
β + x-hf-token header (μ ν)
βΌ
Next.js App Router (on Vercel)
app/api/[transport]/route.ts
β
βΌ
createMcpHandler ββΊ McpServer
ββ tools: greet / calculate / time / geocode / weather / generate-image
ββ prompts: code-review
ββ resources: server-info[transport] λμ μΈκ·Έλ¨ΌνΈλ₯Ό μ¬μ©ν΄ λ§€ μμ²λ§λ€ νΈλ€λ¬λ₯Ό μλ‘ λ§λ€κ³ , μμ² ν€λ
(x-hf-token) μ νκ²½λ³μ(HF_TOKEN) λ₯Ό ν΄λ‘μ λ‘ μΊ‘μ²ν΄ generate-image λꡬμ
μ λ¬ν©λλ€.
Related MCP server: TypeScript MCP Server Boilerplate
νλ‘μ νΈ κ΅¬μ‘°
.
βββ app/
β βββ api/
β β βββ [transport]/
β β βββ route.ts # MCP HTTP μλν¬μΈνΈ
β βββ layout.tsx
β βββ page.tsx # μλ΄μ© μ μ νμ΄μ§
βββ next.config.mjs
βββ next-env.d.ts
βββ package.json
βββ tsconfig.json
βββ .env.exampleλΉ λ₯Έ μμ
1. μμ‘΄μ± μ€μΉ
npm install2. νκ²½λ³μ μ€μ (μ ν)
generate-image λꡬλ₯Ό μ¬μ©ν κ³νμ΄λΌλ©΄ .env.example μ .env.local λ‘ λ³΅μ¬ν
λ€ HuggingFace ν ν°μ μ±μ λ£μ΅λλ€.
cp .env.example .env.local
# κ·Έλ¦¬κ³ HF_TOKEN=hf_xxx... λ‘ μμ νκ²½λ³μκ° μμ΄λ ν΄λΌμ΄μΈνΈκ° λ§€ μμ²λ§λ€
x-hf-tokenν€λλ₯Ό 보λ΄λ©΄ λμν©λλ€.
3. λ‘컬 μ€ν
npm run devκΈ°λ³Έ μλν¬μΈνΈ:
μλ΄ νμ΄μ§: http://localhost:3000
MCP Streamable HTTP: http://localhost:3000/api/mcp
4. MCP Inspector λ‘ κ²μ¦
npx @modelcontextprotocol/inspector@latestInspector UI μμ:
Transport: Streamable HTTP
URL:
http://localhost:3000/api/mcp(μ ν) Custom Headers μ
x-hf-token: hf_xxx...μΆκ°Connect β List Tools β κ° λꡬ νΈμΆ ν μ€νΈ
ν΄λΌμ΄μΈνΈ μ°κ²°
Cursor (./.cursor/mcp.json)
{
"mcpServers": {
"my-mcp-server": {
"url": "https://<your-app>.vercel.app/api/mcp",
"headers": {
"x-hf-token": "hf_xxx..."
}
}
}
}url λ§ μμΌλ©΄ 5κ° λꡬ(greet/calculate/time/geocode/weather)λ μ μ
λμν©λλ€. generate-image λ₯Ό μ¬μ©νλ €λ©΄ headers.x-hf-token λλ μλ²μΈ‘
HF_TOKEN νκ²½λ³μ μ€ νλκ° λ°λμ νμν©λλ€.
Streamable HTTP λ―Έμ§μ ν΄λΌμ΄μΈνΈ (mcp-remote λΈλ¦Ώμ§)
{
"mcpServers": {
"my-mcp-server": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://<your-app>.vercel.app/api/mcp",
"--header",
"x-hf-token:hf_xxx..."
]
}
}
}Vercel λ°°ν¬
λ°©λ² 1: Vercel CLI
npm i -g vercel
vercelλ°©λ² 2: GitHub μ°λ
GitHub μ μ₯μμ νΈμ
https://vercel.com/new μμ μ μ₯μ μ ν
Framework Preset: Next.js (μλ κ°μ§)
Environment Variables μμ (μ ν)
HF_TOKENμΆκ°Deploy
λ°°ν¬κ° μλ£λλ©΄ https://<your-app>.vercel.app/api/mcp κ° MCP μλν¬μΈνΈμ
λλ€.
λ±λ‘λ λꡬ
μ΄λ¦ | μ€λͺ |
| μ΄λ¦κ³Ό μΈμ΄(ko/en)λ‘ μΈμ¬λ§ μμ± |
| λ μ«μ μ¬μΉμ°μ° (add/subtract/multiply/divide) |
| νμμ‘΄λ³ νμ¬ μκ° |
| Open-Meteo λ‘ λμλͺ β μκ²½λ μ‘°ν |
| Open-Meteo λ‘ μκ²½λ β νμ¬ λ μ¨ μ‘°ν |
| HuggingFace FLUX.1-schnell μ΄λ―Έμ§ μμ± ( |
ν둬ννΈ / 리μμ€
ν둬ννΈ
code-review: μ½λλ₯Ό μ λ ₯λ°μ μλμ΄ μμ§λμ΄ κ΄μ μ 체κ³μ 리뷰 λ©μμ§ μμ±λ¦¬μμ€
server-info(mcp://my-mcp-server/info): μλ² λ©νλ°μ΄ν°(JSON)
HF_TOKEN μ²λ¦¬ μ μ±
x-hf-token ν€λ ββ(μμΌλ©΄ μ¬μ©)βββΊ HuggingFace Inference
β (μμ)
βΌ
HF_TOKEN νκ²½λ³μ ββ(μμΌλ©΄ μ¬μ©)βββΊ HuggingFace Inference
β (μμ)
βΌ
generate-image λκ΅¬κ° λͺ
νν μλ¬ λ©μμ§ λ°νν€λκ° μ°μ μ΄λ―λ‘ λμΌ λ°°ν¬ μΈμ€ν΄μ€λ₯Ό μ¬λ¬ μ¬μ©μκ° κ°μμ ν ν°μΌλ‘ μ¬μ©ν μ μμ΅λλ€.
μ€ν¬λ¦½νΈ
npm run dev: λ‘컬 κ°λ° μλ²npm run build: νλ‘λμ λΉλnpm run start: λΉλ κ²°κ³Ό μ€νnpm run lint: Next.js lint
μ°Έκ³ μλ£
λΌμ΄μ μ€
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kimhailey/my-mcp-server-260528'
If you have feedback or need assistance with the MCP directory API, please join our Discord server