food402 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -7
- package/dist/shared/api.d.ts +23 -0
- package/dist/{api.js → shared/api.js} +207 -426
- package/dist/{api.d.ts → shared/types.d.ts} +0 -21
- package/dist/shared/types.js +2 -0
- package/dist/src/api.d.ts +23 -0
- package/dist/src/api.js +88 -0
- package/dist/{index.js → src/index.js} +0 -0
- package/dist/{postinstall.js → src/postinstall.js} +1 -1
- package/package.json +3 -3
- /package/dist/{auth.d.ts → src/auth.d.ts} +0 -0
- /package/dist/{auth.js → src/auth.js} +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{postinstall.d.ts → src/postinstall.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -4,7 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
An MCP (Model Context Protocol) server that enables AI assistants to order food from TGO Yemek. Simply chat with your AI assistant to browse restaurants, build your order, and complete checkout.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Deployment Options
|
|
8
|
+
|
|
9
|
+
Food402 supports two deployment methods:
|
|
10
|
+
|
|
11
|
+
| Method | Best For | Transport | Auth |
|
|
12
|
+
|--------|----------|-----------|------|
|
|
13
|
+
| **Local MCP Server** | Claude Desktop, Claude Code | stdio | Environment variables |
|
|
14
|
+
| **Remote MCP Server** | Claude.ai (web) | HTTP | OAuth 2.0 |
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Local MCP Server (npm package)
|
|
19
|
+
|
|
20
|
+
### Claude Desktop
|
|
8
21
|
|
|
9
22
|
Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
|
|
10
23
|
|
|
@@ -25,7 +38,7 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
|
|
|
25
38
|
|
|
26
39
|
Replace `your-email@example.com` and `your-password` with your TGO Yemek credentials.
|
|
27
40
|
|
|
28
|
-
|
|
41
|
+
### Claude Code
|
|
29
42
|
|
|
30
43
|
For project-specific installation with Claude Code:
|
|
31
44
|
|
|
@@ -40,7 +53,7 @@ This automatically adds `food402` to your `.mcp.json`. Open the file and update
|
|
|
40
53
|
"mcpServers": {
|
|
41
54
|
"food402": {
|
|
42
55
|
"command": "node",
|
|
43
|
-
"args": ["./node_modules/food402/dist/index.js"],
|
|
56
|
+
"args": ["./node_modules/food402/dist/src/index.js"],
|
|
44
57
|
"env": {
|
|
45
58
|
"TGO_EMAIL": "your-email@example.com",
|
|
46
59
|
"TGO_PASSWORD": "your-password"
|
|
@@ -50,6 +63,25 @@ This automatically adds `food402` to your `.mcp.json`. Open the file and update
|
|
|
50
63
|
}
|
|
51
64
|
```
|
|
52
65
|
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Remote MCP Server (Claude.ai Web)
|
|
69
|
+
|
|
70
|
+
For Claude.ai web access, use the remote MCP server deployed on Cloudflare Workers.
|
|
71
|
+
|
|
72
|
+
### Connect to Claude.ai
|
|
73
|
+
|
|
74
|
+
1. Go to Claude.ai **Settings > Connectors**
|
|
75
|
+
2. Click **"Add Custom Connector"**
|
|
76
|
+
3. Enter the remote server URL
|
|
77
|
+
4. Complete the OAuth flow by logging in with your TGO Yemek credentials
|
|
78
|
+
|
|
79
|
+
No local setup required—your credentials are securely stored via OAuth.
|
|
80
|
+
|
|
81
|
+
> **Self-hosting?** See [remote/README.md](./remote/README.md) for deployment instructions.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
53
85
|
## Prerequisites
|
|
54
86
|
|
|
55
87
|
### Account Setup Required
|
|
@@ -131,11 +163,35 @@ Here's the typical workflow when ordering food through the AI assistant:
|
|
|
131
163
|
|
|
132
164
|
## Development
|
|
133
165
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
166
|
+
### Repository Structure
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
food402/
|
|
170
|
+
├── src/ # Local MCP server (stdio transport)
|
|
171
|
+
│ ├── index.ts # MCP entry point with tool definitions
|
|
172
|
+
│ ├── auth.ts # TGO auth with token caching
|
|
173
|
+
│ ├── api.ts # Thin wrapper around shared/api.ts
|
|
174
|
+
│ └── postinstall.ts # Auto-configures .mcp.json on npm install
|
|
175
|
+
├── shared/ # Shared code between local and remote
|
|
176
|
+
│ ├── api.ts # Token-parameterized TGO API functions
|
|
177
|
+
│ └── types.ts # TypeScript interfaces
|
|
178
|
+
├── remote/ # Remote MCP server (HTTP transport)
|
|
179
|
+
│ ├── src/
|
|
180
|
+
│ │ ├── worker.ts # Cloudflare Worker entry (Hono)
|
|
181
|
+
│ │ ├── server.ts # MCP server with tool definitions
|
|
182
|
+
│ │ ├── auth/ # OAuth 2.0 provider + TGO login
|
|
183
|
+
│ │ ├── payment/ # 3DS verification page handler
|
|
184
|
+
│ │ └── session/ # Encrypted session management
|
|
185
|
+
│ ├── wrangler.toml # CF Workers config
|
|
186
|
+
│ └── package.json # Remote-specific dependencies
|
|
187
|
+
├── package.json # Root package (npm: food402)
|
|
188
|
+
├── README.md
|
|
189
|
+
└── CLAUDE.md
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Local Server Development
|
|
138
193
|
|
|
194
|
+
```bash
|
|
139
195
|
# Install dependencies
|
|
140
196
|
npm install
|
|
141
197
|
|
|
@@ -146,6 +202,23 @@ npm start
|
|
|
146
202
|
npm run build
|
|
147
203
|
```
|
|
148
204
|
|
|
205
|
+
### Remote Server Development
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
cd remote
|
|
209
|
+
|
|
210
|
+
# Install dependencies
|
|
211
|
+
npm install
|
|
212
|
+
|
|
213
|
+
# Run local dev server (http://localhost:8787)
|
|
214
|
+
npm run dev
|
|
215
|
+
|
|
216
|
+
# Deploy to Cloudflare Workers
|
|
217
|
+
npm run deploy
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
See [remote/README.md](./remote/README.md) for full deployment instructions including KV namespace setup and secrets configuration.
|
|
221
|
+
|
|
149
222
|
## License
|
|
150
223
|
|
|
151
224
|
MIT
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AddressesResponse, RestaurantsResponse, RestaurantMenuResponse, ProductRecommendationsResponse, ProductDetailsResponse, AddToBasketRequest, AddToBasketResponse, SetShippingAddressRequest, GetBasketResponse, SearchRestaurantsResponse, CitiesResponse, DistrictsResponse, NeighborhoodsResponse, AddAddressRequest, AddAddressResponse, SavedCardsResponse, CheckoutReadyResponse, PlaceOrderResponse, CustomerNoteRequest, OrdersResponse, OrderDetail } from "./types.js";
|
|
2
|
+
export declare function getAddresses(token: string): Promise<AddressesResponse>;
|
|
3
|
+
export declare function getRestaurants(token: string, latitude: string, longitude: string, page?: number): Promise<RestaurantsResponse>;
|
|
4
|
+
export declare function getRestaurantMenu(token: string, restaurantId: number, latitude: string, longitude: string): Promise<RestaurantMenuResponse>;
|
|
5
|
+
export declare function getProductRecommendations(token: string, restaurantId: number, productIds: number[]): Promise<ProductRecommendationsResponse>;
|
|
6
|
+
export declare function getProductDetails(token: string, restaurantId: number, productId: number, latitude: string, longitude: string): Promise<ProductDetailsResponse>;
|
|
7
|
+
export declare function setShippingAddress(token: string, request: SetShippingAddressRequest): Promise<void>;
|
|
8
|
+
export declare function addToBasket(token: string, request: AddToBasketRequest): Promise<AddToBasketResponse>;
|
|
9
|
+
export declare function getBasket(token: string): Promise<GetBasketResponse>;
|
|
10
|
+
export declare function removeFromBasket(token: string, itemId: string): Promise<GetBasketResponse>;
|
|
11
|
+
export declare function clearBasket(token: string): Promise<void>;
|
|
12
|
+
export declare function getCities(token: string): Promise<CitiesResponse>;
|
|
13
|
+
export declare function getDistricts(token: string, cityId: number): Promise<DistrictsResponse>;
|
|
14
|
+
export declare function getNeighborhoods(token: string, districtId: number): Promise<NeighborhoodsResponse>;
|
|
15
|
+
export declare function addAddress(token: string, request: AddAddressRequest): Promise<AddAddressResponse>;
|
|
16
|
+
export declare function updateCustomerNote(token: string, request: CustomerNoteRequest): Promise<void>;
|
|
17
|
+
export declare function getSavedCards(token: string): Promise<SavedCardsResponse>;
|
|
18
|
+
export declare function getCheckoutReady(token: string): Promise<CheckoutReadyResponse>;
|
|
19
|
+
export declare function placeOrder(token: string, cardId: number): Promise<PlaceOrderResponse>;
|
|
20
|
+
export declare function getOrders(token: string, page?: number): Promise<OrdersResponse>;
|
|
21
|
+
export declare function getOrderDetail(token: string, orderId: string): Promise<OrderDetail>;
|
|
22
|
+
export declare function searchRestaurants(token: string, searchQuery: string, latitude: string, longitude: string, page?: number): Promise<SearchRestaurantsResponse>;
|
|
23
|
+
export * from "./types.js";
|