@karashiiro/my-cool-proxy 1.0.2 → 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
CHANGED
|
@@ -81,23 +81,22 @@ pnpm build
|
|
|
81
81
|
|
|
82
82
|
### 1. Configure
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
The gateway **auto-creates a default config** on first run. Just run it once to generate the config file:
|
|
85
85
|
|
|
86
86
|
```bash
|
|
87
|
-
#
|
|
88
|
-
|
|
89
|
-
cp config.example.json ~/.config/my-cool-proxy/config.json
|
|
87
|
+
my-cool-proxy # Creates config and starts (with no servers)
|
|
88
|
+
```
|
|
90
89
|
|
|
91
|
-
|
|
92
|
-
mkdir -p ~/Library/Preferences/my-cool-proxy
|
|
93
|
-
cp config.example.json ~/Library/Preferences/my-cool-proxy/config.json
|
|
90
|
+
Then edit the config to add your MCP servers:
|
|
94
91
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
```bash
|
|
93
|
+
# Find your config location
|
|
94
|
+
my-cool-proxy --config-path
|
|
95
|
+
|
|
96
|
+
# Edit to add servers (see CONFIG.md for all options)
|
|
98
97
|
```
|
|
99
98
|
|
|
100
|
-
|
|
99
|
+
Example config structure:
|
|
101
100
|
|
|
102
101
|
```json
|
|
103
102
|
{
|
|
@@ -112,7 +111,21 @@ Edit `config.json` to add your MCP servers (see [CONFIG.md](./CONFIG.md) for all
|
|
|
112
111
|
}
|
|
113
112
|
```
|
|
114
113
|
|
|
115
|
-
|
|
114
|
+
**Or**, copy the example config for a more complete starting point:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Linux
|
|
118
|
+
mkdir -p ~/.config/my-cool-proxy
|
|
119
|
+
cp config.example.json ~/.config/my-cool-proxy/config.json
|
|
120
|
+
|
|
121
|
+
# macOS
|
|
122
|
+
mkdir -p ~/Library/Application\ Support/my-cool-proxy
|
|
123
|
+
cp config.example.json ~/Library/Application\ Support/my-cool-proxy/config.json
|
|
124
|
+
|
|
125
|
+
# Windows (PowerShell)
|
|
126
|
+
mkdir "$env:APPDATA\my-cool-proxy"
|
|
127
|
+
Copy-Item config.example.json "$env:APPDATA\my-cool-proxy\config.json"
|
|
128
|
+
```
|
|
116
129
|
|
|
117
130
|
### 2. Run
|
|
118
131
|
|
|
@@ -203,9 +216,9 @@ pnpm build && node dist/index.js
|
|
|
203
216
|
|
|
204
217
|
Run the gateway as a stdio-based MCP server that clients launch directly. This is ideal when:
|
|
205
218
|
|
|
206
|
-
- You want the MCP client
|
|
219
|
+
- You want the MCP client to manage the gateway process's lifecycle
|
|
207
220
|
- You're running everything locally and don't need a persistent server
|
|
208
|
-
- You prefer simpler deployment without managing an HTTP server
|
|
221
|
+
- You prefer simpler deployment without managing an HTTP server, or your client doesn't support localhost HTTP (e.g. Claude Desktop)
|
|
209
222
|
|
|
210
223
|
**Key differences from HTTP mode:**
|
|
211
224
|
|
|
@@ -215,18 +228,9 @@ Run the gateway as a stdio-based MCP server that clients launch directly. This i
|
|
|
215
228
|
|
|
216
229
|
#### 1. Configure
|
|
217
230
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
```bash
|
|
221
|
-
# Linux
|
|
222
|
-
mkdir -p ~/.config/my-cool-proxy
|
|
223
|
-
# macOS
|
|
224
|
-
mkdir -p ~/Library/Preferences/my-cool-proxy
|
|
225
|
-
# Windows (PowerShell)
|
|
226
|
-
mkdir "$env:APPDATA\my-cool-proxy\Config"
|
|
227
|
-
```
|
|
231
|
+
The gateway auto-creates a config on first run, but for stdio mode you'll need to edit it to set `transport: "stdio"`. You can find your config location with `my-cool-proxy --config-path`.
|
|
228
232
|
|
|
229
|
-
|
|
233
|
+
Example config (port and host are ignored in stdio mode):
|
|
230
234
|
|
|
231
235
|
```json
|
|
232
236
|
{
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { ServerConfig } from "../types/interfaces.js";
|
|
2
|
+
export declare const DEFAULT_CONFIG: ServerConfig;
|
|
3
|
+
export declare function createDefaultConfig(): string;
|
|
2
4
|
export declare function loadConfig(): ServerConfig;
|
|
3
5
|
export declare function mergeEnvConfig(config: ServerConfig): ServerConfig;
|
|
4
6
|
//# sourceMappingURL=config-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../src/utils/config-loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../src/utils/config-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAO3D,eAAO,MAAM,cAAc,EAAE,YAK5B,CAAC;AAQF,wBAAgB,mBAAmB,IAAI,MAAM,CAe5C;AAeD,wBAAgB,UAAU,IAAI,YAAY,CAiHzC;AASD,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAMjE"}
|
|
@@ -1,14 +1,27 @@
|
|
|
1
|
-
import { readFileSync } from "fs";
|
|
2
|
-
import {
|
|
1
|
+
import { mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
2
|
+
import { dirname } from "path";
|
|
3
|
+
import { getActiveConfigPath, getPlatformConfigPath } from "./config-paths.js";
|
|
4
|
+
export const DEFAULT_CONFIG = {
|
|
5
|
+
port: 3000,
|
|
6
|
+
host: "localhost",
|
|
7
|
+
transport: "http",
|
|
8
|
+
mcpClients: {},
|
|
9
|
+
};
|
|
10
|
+
export function createDefaultConfig() {
|
|
11
|
+
const configPath = getPlatformConfigPath();
|
|
12
|
+
const configDir = dirname(configPath);
|
|
13
|
+
mkdirSync(configDir, { recursive: true });
|
|
14
|
+
writeFileSync(configPath, JSON.stringify(DEFAULT_CONFIG, null, 2) + "\n", "utf-8");
|
|
15
|
+
return configPath;
|
|
16
|
+
}
|
|
3
17
|
export function loadConfig() {
|
|
4
18
|
const activePath = getActiveConfigPath();
|
|
5
19
|
if (!activePath) {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
`Create a config file at ${getPlatformConfigPath()} or set the CONFIG_PATH environment variable.`);
|
|
20
|
+
const createdPath = createDefaultConfig();
|
|
21
|
+
console.error(`\n Created default config at: ${createdPath}`);
|
|
22
|
+
console.error(` Edit this file to add your MCP servers.`);
|
|
23
|
+
console.error(` See CONFIG.md for configuration options.\n`);
|
|
24
|
+
return { ...DEFAULT_CONFIG };
|
|
12
25
|
}
|
|
13
26
|
const configPath = activePath.path;
|
|
14
27
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.js","sourceRoot":"","sources":["../../src/utils/config-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"config-loader.js","sourceRoot":"","sources":["../../src/utils/config-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAM/E,MAAM,CAAC,MAAM,cAAc,GAAiB;IAC1C,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,WAAW;IACjB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,EAAE;CACf,CAAC;AAQF,MAAM,UAAU,mBAAmB,GAAW;IAC5C,MAAM,UAAU,GAAG,qBAAqB,EAAE,CAAC;IAC3C,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAGtC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAG1C,aAAa,CACX,UAAU,EACV,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,EAAE,CAA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