We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kwenhwang/hrfco-service'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
# π TypeScript Netlify Functions λ°°ν¬ κ°μ΄λ
## β
μλ£λ TypeScript λ³ν
### π **Python β TypeScript λ³ν μλ£**
- **Python FastAPI** β **Netlify Functions**
- **Python μ μ¬λ κ³μ°** β **TypeScript λ¬Έμμ΄ λ§€μΉ**
- **Python μ§μ λ§€ν** β **TypeScript μμ κ°μ²΄**
- **μλ΅ ν¬κΈ° μ΅μ ν** β **λμΌνκ² μ μ§ (1KB λ―Έλ§)**
### π **Netlify Functions ꡬ쑰**
```
netlify/functions/
βββ utils.ts # κ³΅ν΅ μ νΈλ¦¬ν° (μ§μ λ§€ν, μ μ¬λ κ³μ°)
βββ search-station.ts # search_water_station_by_name
βββ get-water-info.ts # get_water_info_by_location
βββ recommend-stations.ts # recommend_nearby_stations
βββ openai-functions.ts # OpenAI Function μ μ
```
### π― **ν΅μ¬ κΈ°λ₯ λ³ν**
#### 1. **μ§μ λ§€ν λ‘μ§** (TypeScript)
```typescript
export const REGION_MAPPING: Record<string, string[]> = {
'μμΈ': ['μμΈ', 'νκ°', 'μ²κ³μ²'],
'λΆμ°': ['λΆμ°', 'λλκ°', 'μμκ°'],
// ... 16κ° μ§μ μμ λ§€ν
};
```
#### 2. **μ μ¬λ κ³μ°** (νκΈ νΉν)
```typescript
export function calculateSimilarity(station: Station, queryInfo: QueryInfo): number {
let score = 0;
// ν€μλ μ§μ λ§€μΉ + λ¬Έμμ΄ μ μ¬λ
return Math.min(score, 1.0);
}
```
#### 3. **API μλν¬μΈνΈ**
- `/.netlify/functions/search-station`
- `/.netlify/functions/get-water-info`
- `/.netlify/functions/recommend-stations`
- `/.netlify/functions/openai-functions`
## π **Netlify λ°°ν¬ λ¨κ³**
### 1. **GitHub μ°λ**
```bash
# GitHub μ μ₯μ μμ± ν
git init
git add .
git commit -m "TypeScript Netlify Functions"
git remote add origin https://github.com/username/hrfco-mcp.git
git push -u origin main
```
### 2. **Netlify λ°°ν¬**
1. Netlify λμ보λμμ "New site from Git" μ ν
2. GitHub μ μ₯μ μ°κ²°
3. λΉλ μ€μ :
- **Build command**: `npm run build`
- **Publish directory**: `public`
- **Functions directory**: `netlify/functions`
### 3. **νκ²½λ³μ μ€μ **
Netlify λμ보λ β Site settings β Environment variables:
```
HRFCO_API_KEY = FE18B23B-A81B-4246-9674-E8D641902A42
```
## π§ **OpenAI Function Calling μ°λ**
### **Function μ μ κ°μ Έμ€κΈ°**
```bash
curl https://hrfco-mcp.netlify.app/.netlify/functions/openai-functions
```
### **OpenAI API νΈμΆ μμ **
```javascript
// ChatGPT APIμμ μ΄λ κ² νΈμΆ
const response = await fetch(
'https://hrfco-mcp.netlify.app/.netlify/functions/get-water-info',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ query: "νκ° μμ", limit: 3 })
}
);
```
## π **μ±λ₯ μ΅μ ν μ μ§**
### β
**μλ΅ ν¬κΈ° μ ν**
- **search-station**: ~346 bytes
- **get-water-info**: ~399 bytes
- **recommend-stations**: ~522 bytes
- **λͺ¨λ μλ΅ 1KB λ―Έλ§ λ³΄μ₯**
### β
**κ²μ μ νλ**
- **μ§μ λ§€ν**: μμΈ β μμΈ μ§μ κ΄μΈ‘μ μλ λ°κ²¬
- **κ° μ΄λ¦ λ§€μΉ**: νκ° β νκ° μ μ κ΄μΈ‘μ λ§€μΉ
- **μ μ¬λ κ²μ**: λΆλΆ μΌμΉ λ° μ€ν νμ©
## π **λ°°ν¬ ν μμ κ²°κ³Ό**
### **μλν¬μΈνΈ**
```
https://hrfco-mcp.netlify.app/.netlify/functions/search-station
https://hrfco-mcp.netlify.app/.netlify/functions/get-water-info
https://hrfco-mcp.netlify.app/.netlify/functions/recommend-stations
```
### **OpenAI μ°λ**
ChatGPTμμ μμ°μ΄λ‘ "νκ° μμ μλ €μ€" μμ² μ:
1. OpenAIκ° `get_water_info_by_location` ν¨μ νΈμΆ
2. Netlify Functionμ΄ HRFCO API μ‘°ν
3. μ§λ₯ν κ²μμΌλ‘ νκ° κ΄λ ¨ κ΄μΈ‘μ λ°κ²¬
4. μ€μκ° μμ λ°μ΄ν° λ°ν
---
**π― ν΅μ¬ μ±κ³Ό**: Python μ§λ₯ν κ²μ μμ€ν
μ TypeScriptλ‘ μμ λ³ν, Netlify μλ²λ¦¬μ€ λ°°ν¬ μ€λΉ μλ£!