food402 1.1.0 → 1.1.1
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 +51 -4
- package/dist/src/postinstall.js +46 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/food402)
|
|
4
4
|
|
|
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.
|
|
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. Works with Claude, ChatGPT (Developer Mode), and Codex CLI via MCP.
|
|
6
6
|
|
|
7
7
|
## Deployment Options
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ Food402 supports two deployment methods:
|
|
|
10
10
|
|
|
11
11
|
| Method | Best For | Transport | Auth |
|
|
12
12
|
|--------|----------|-----------|------|
|
|
13
|
-
| **Local MCP Server** | Claude Desktop, Claude Code | stdio | Environment variables |
|
|
13
|
+
| **Local MCP Server** | Claude Desktop, Claude Code, ChatGPT (Developer Mode), Codex CLI | stdio | Environment variables |
|
|
14
14
|
| **Remote MCP Server** | Claude.ai (web) | HTTP | OAuth 2.0 |
|
|
15
15
|
|
|
16
16
|
---
|
|
@@ -46,7 +46,7 @@ For project-specific installation with Claude Code:
|
|
|
46
46
|
npm install food402
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
This automatically adds `food402` to your `.mcp.json`. Open the file and update your credentials:
|
|
49
|
+
This automatically adds `food402` to your `.mcp.json` and creates/updates `.codex/config.toml` for Codex CLI. Open the file(s) and update your credentials:
|
|
50
50
|
|
|
51
51
|
```json
|
|
52
52
|
{
|
|
@@ -65,6 +65,53 @@ This automatically adds `food402` to your `.mcp.json`. Open the file and update
|
|
|
65
65
|
|
|
66
66
|
---
|
|
67
67
|
|
|
68
|
+
### ChatGPT (Developer Mode)
|
|
69
|
+
|
|
70
|
+
ChatGPT apps in Developer Mode can connect to local MCP servers over stdio. Use the same local server configuration and provide your credentials as environment variables.
|
|
71
|
+
|
|
72
|
+
1. Open ChatGPT **Settings > Developer** (or your app’s Developer Mode settings)
|
|
73
|
+
2. Add a **Custom MCP Server**
|
|
74
|
+
3. Set the command to run the local server:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"command": "npx",
|
|
79
|
+
"args": ["-y", "food402"],
|
|
80
|
+
"env": {
|
|
81
|
+
"TGO_EMAIL": "your-email@example.com",
|
|
82
|
+
"TGO_PASSWORD": "your-password"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
> **Tip:** If your ChatGPT client supports project-level MCP config files, you can reuse the same JSON from Claude Code (`.mcp.json`) with the command above.
|
|
88
|
+
|
|
89
|
+
### Codex CLI (Terminal)
|
|
90
|
+
|
|
91
|
+
Codex supports MCP servers over stdio and uses TOML config files (not `.mcp.json`). You can add servers via the CLI (global) or a project-scoped `.codex/config.toml` (trusted projects).
|
|
92
|
+
|
|
93
|
+
**Option A: CLI (global config: `~/.codex/config.toml`)**
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
codex mcp add food402 --env TGO_EMAIL=your-email@example.com --env TGO_PASSWORD=your-password -- npx -y food402
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Option B: Project config (`.codex/config.toml`)**
|
|
100
|
+
|
|
101
|
+
```toml
|
|
102
|
+
[mcp_servers.food402]
|
|
103
|
+
command = "node"
|
|
104
|
+
args = ["./node_modules/food402/dist/src/index.js"]
|
|
105
|
+
|
|
106
|
+
[mcp_servers.food402.env]
|
|
107
|
+
TGO_EMAIL = "your-email@example.com"
|
|
108
|
+
TGO_PASSWORD = "your-password"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
> **Tip:** Installing via `npm install food402` will create or update `.codex/config.toml` in the project root and add the `food402` entry automatically.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
68
115
|
## Remote MCP Server (Claude.ai Web)
|
|
69
116
|
|
|
70
117
|
For Claude.ai web access, use the remote MCP server deployed on Cloudflare Workers.
|
|
@@ -73,7 +120,7 @@ For Claude.ai web access, use the remote MCP server deployed on Cloudflare Worke
|
|
|
73
120
|
|
|
74
121
|
1. Go to Claude.ai **Settings > Connectors**
|
|
75
122
|
2. Click **"Add Custom Connector"**
|
|
76
|
-
3. Enter the
|
|
123
|
+
3. Enter the server URL: `https://food402-remote.food402.workers.dev`
|
|
77
124
|
4. Complete the OAuth flow by logging in with your TGO Yemek credentials
|
|
78
125
|
|
|
79
126
|
No local setup required—your credentials are securely stored via OAuth.
|
package/dist/src/postinstall.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { readFileSync, writeFileSync, existsSync } from 'fs';
|
|
2
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
// Find project root (where npm install was run)
|
|
5
5
|
const projectRoot = process.env.INIT_CWD || process.cwd();
|
|
6
6
|
const mcpJsonPath = join(projectRoot, '.mcp.json');
|
|
7
|
+
const codexConfigPath = join(projectRoot, '.codex', 'config.toml');
|
|
7
8
|
const food402Config = {
|
|
8
9
|
command: "node",
|
|
9
10
|
args: ["./node_modules/food402/dist/src/index.js"],
|
|
@@ -12,6 +13,15 @@ const food402Config = {
|
|
|
12
13
|
TGO_PASSWORD: "your-password"
|
|
13
14
|
}
|
|
14
15
|
};
|
|
16
|
+
const codexConfigBlock = [
|
|
17
|
+
'[mcp_servers.food402]',
|
|
18
|
+
'command = "node"',
|
|
19
|
+
'args = ["./node_modules/food402/dist/src/index.js"]',
|
|
20
|
+
'',
|
|
21
|
+
'[mcp_servers.food402.env]',
|
|
22
|
+
'TGO_EMAIL = "your-email@example.com"',
|
|
23
|
+
'TGO_PASSWORD = "your-password"'
|
|
24
|
+
].join('\n');
|
|
15
25
|
let config = { mcpServers: {} };
|
|
16
26
|
if (existsSync(mcpJsonPath)) {
|
|
17
27
|
try {
|
|
@@ -23,7 +33,38 @@ if (existsSync(mcpJsonPath)) {
|
|
|
23
33
|
// Invalid JSON, start fresh
|
|
24
34
|
}
|
|
25
35
|
}
|
|
26
|
-
config.mcpServers.food402
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
if (config.mcpServers.food402) {
|
|
37
|
+
console.log('✓ food402 already present in .mcp.json');
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
config.mcpServers.food402 = food402Config;
|
|
41
|
+
writeFileSync(mcpJsonPath, JSON.stringify(config, null, 2) + '\n');
|
|
42
|
+
console.log('✓ Added food402 to .mcp.json');
|
|
43
|
+
console.log('→ Update TGO_EMAIL and TGO_PASSWORD in .mcp.json with your credentials');
|
|
44
|
+
}
|
|
45
|
+
let codexConfig = '';
|
|
46
|
+
if (existsSync(codexConfigPath)) {
|
|
47
|
+
try {
|
|
48
|
+
codexConfig = readFileSync(codexConfigPath, 'utf-8');
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
codexConfig = '';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (codexConfig.includes('[mcp_servers.food402]')) {
|
|
55
|
+
console.log('✓ food402 already present in .codex/config.toml');
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
mkdirSync(join(projectRoot, '.codex'), { recursive: true });
|
|
59
|
+
let nextCodexConfig = codexConfig;
|
|
60
|
+
if (nextCodexConfig.length && !nextCodexConfig.endsWith('\n')) {
|
|
61
|
+
nextCodexConfig += '\n';
|
|
62
|
+
}
|
|
63
|
+
if (nextCodexConfig.length) {
|
|
64
|
+
nextCodexConfig += '\n';
|
|
65
|
+
}
|
|
66
|
+
nextCodexConfig += codexConfigBlock + '\n';
|
|
67
|
+
writeFileSync(codexConfigPath, nextCodexConfig);
|
|
68
|
+
console.log('✓ Added food402 to .codex/config.toml');
|
|
69
|
+
console.log('→ Update TGO_EMAIL and TGO_PASSWORD in .codex/config.toml with your credentials');
|
|
70
|
+
}
|