mcpocket 0.1.1 → 0.2.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/CHANGELOG.md +30 -0
- package/README.md +52 -4
- package/dist/cli.js +23 -4
- package/dist/cli.js.map +1 -1
- package/dist/clients/antigravity.d.ts +5 -0
- package/dist/clients/antigravity.d.ts.map +1 -0
- package/dist/clients/antigravity.js +94 -0
- package/dist/clients/antigravity.js.map +1 -0
- package/dist/clients/codex.d.ts +5 -0
- package/dist/clients/codex.d.ts.map +1 -0
- package/dist/clients/codex.js +78 -0
- package/dist/clients/codex.js.map +1 -0
- package/dist/clients/copilot-cli.d.ts +5 -0
- package/dist/clients/copilot-cli.d.ts.map +1 -0
- package/dist/clients/copilot-cli.js +90 -0
- package/dist/clients/copilot-cli.js.map +1 -0
- package/dist/clients/cursor.d.ts +5 -0
- package/dist/clients/cursor.d.ts.map +1 -0
- package/dist/clients/cursor.js +77 -0
- package/dist/clients/cursor.js.map +1 -0
- package/dist/clients/providers.d.ts +7 -0
- package/dist/clients/providers.d.ts.map +1 -0
- package/dist/clients/providers.js +80 -0
- package/dist/clients/providers.js.map +1 -0
- package/dist/clients/types.d.ts +27 -1
- package/dist/clients/types.d.ts.map +1 -1
- package/dist/commands/dedupe.d.ts +2 -0
- package/dist/commands/dedupe.d.ts.map +1 -0
- package/dist/commands/dedupe.js +114 -0
- package/dist/commands/dedupe.js.map +1 -0
- package/dist/commands/provider-options.d.ts +18 -0
- package/dist/commands/provider-options.d.ts.map +1 -0
- package/dist/commands/provider-options.js +34 -0
- package/dist/commands/provider-options.js.map +1 -0
- package/dist/commands/pull.d.ts +2 -1
- package/dist/commands/pull.d.ts.map +1 -1
- package/dist/commands/pull.js +90 -75
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/push.d.ts +2 -1
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +82 -50
- package/dist/commands/push.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/storage/gist.d.ts.map +1 -1
- package/dist/storage/gist.js +17 -7
- package/dist/storage/gist.js.map +1 -1
- package/dist/sync/agents.d.ts +6 -2
- package/dist/sync/agents.d.ts.map +1 -1
- package/dist/sync/agents.js +35 -33
- package/dist/sync/agents.js.map +1 -1
- package/dist/sync/mcp.d.ts.map +1 -1
- package/dist/sync/mcp.js +75 -9
- package/dist/sync/mcp.js.map +1 -1
- package/dist/sync/plugins.d.ts +5 -1
- package/dist/sync/plugins.d.ts.map +1 -1
- package/dist/sync/plugins.js +14 -0
- package/dist/sync/plugins.js.map +1 -1
- package/dist/sync/pocket.d.ts +3 -0
- package/dist/sync/pocket.d.ts.map +1 -0
- package/dist/sync/pocket.js +16 -0
- package/dist/sync/pocket.js.map +1 -0
- package/dist/sync/skills.d.ts +3 -2
- package/dist/sync/skills.d.ts.map +1 -1
- package/dist/sync/skills.js +28 -18
- package/dist/sync/skills.js.map +1 -1
- package/dist/utils/crypto.d.ts +11 -0
- package/dist/utils/crypto.d.ts.map +1 -1
- package/dist/utils/crypto.js +17 -3
- package/dist/utils/crypto.js.map +1 -1
- package/dist/utils/files.d.ts +16 -0
- package/dist/utils/files.d.ts.map +1 -0
- package/dist/utils/files.js +168 -0
- package/dist/utils/files.js.map +1 -0
- package/dist/utils/paths.d.ts +16 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +38 -3
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/sparkle.d.ts.map +1 -1
- package/dist/utils/sparkle.js +27 -10
- package/dist/utils/sparkle.js.map +1 -1
- package/package.json +4 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [0.2.0] - 2026-04-09
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- GitHub Gist storage as an alternative backend for syncing configuration.
|
|
9
|
+
- A `de-dupe` command to clean up stale synced agents, skills, and plugins.
|
|
10
|
+
- Multi-provider push and pull targeting with provider-specific CLI flags.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Push and pull now mirror synced agent and skill files to prevent stale duplicates from accumulating.
|
|
14
|
+
- Sync logic was cleaned up to better handle provider-scoped MCP configuration flows.
|
|
15
|
+
- Internal imports were updated to use the `node:` prefix consistently.
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
- README package assets and branding were aligned with the published `mcpocket` package.
|
|
19
|
+
- Error messages and package metadata were updated to reflect the `mcpocket` name.
|
|
20
|
+
|
|
21
|
+
## [0.1.1] - 2026-04-09
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
- Renamed the package to `mcpocket` for npm publishing.
|
|
25
|
+
- Refreshed package branding and metadata for the npm release.
|
|
26
|
+
|
|
27
|
+
## [0.1.0] - 2026-04-09
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- Initial release of `carry-on`, including encrypted MCP configuration sync across supported clients.
|
package/README.md
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
<img src="https://img.shields.io/github/license/davidsmorais/carry-on" alt="license" />
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
|
+
<p align="center">
|
|
8
|
+
<img src="./logo.png" alt="mcpocket logo" width="200" />
|
|
9
|
+
</p>
|
|
10
|
+
|
|
7
11
|
# mcpocket
|
|
8
12
|
|
|
9
13
|
> Your AI setup. Every pocket. ✨
|
|
@@ -20,11 +24,13 @@ You install 8 MCP servers, configure your Claude Code plugins, and build up a li
|
|
|
20
24
|
|
|
21
25
|
## Features
|
|
22
26
|
|
|
23
|
-
- **Multi-client sync** — Claude Desktop, Claude Code, and
|
|
27
|
+
- **Multi-client sync** — Claude Desktop, Claude Code, OpenCode, Copilot CLI, Cursor, Codex, and Antigravity configs in one shot
|
|
24
28
|
- **Two storage backends** — private GitHub repo (full git history) or lightweight GitHub Gist
|
|
25
|
-
- **
|
|
29
|
+
- **Provider-scoped sync** — target one or more providers with flags like `--copilot-cli` or `--opencode`
|
|
30
|
+
- **End-to-end encryption** — secrets in MCP `env`, `headers`, and `http_headers` are encrypted with AES-256-GCM using a passphrase you choose
|
|
26
31
|
- **Cross-platform paths** — Windows ↔ Linux ↔ macOS paths round-trip seamlessly
|
|
27
32
|
- **Additive pull** — pulling merges remote servers into your local config without overwriting anything
|
|
33
|
+
- **De-duplicated file sync** — push/pull mirror synced files so stale agent, skill, and plugin files don't pile up
|
|
28
34
|
- **Zero dependencies on external services** — only GitHub and Git
|
|
29
35
|
|
|
30
36
|
---
|
|
@@ -55,7 +61,10 @@ mcpocket push
|
|
|
55
61
|
# 3. Pull on a new machine
|
|
56
62
|
mcpocket pull
|
|
57
63
|
|
|
58
|
-
# 4.
|
|
64
|
+
# 4. Clean up stale synced files if needed
|
|
65
|
+
mcpocket de-dupe
|
|
66
|
+
|
|
67
|
+
# 5. Check sync status
|
|
59
68
|
mcpocket status
|
|
60
69
|
```
|
|
61
70
|
|
|
@@ -101,6 +110,18 @@ Reads MCP configs, plugin manifests, agents, and skills from the current machine
|
|
|
101
110
|
mcpocket push
|
|
102
111
|
```
|
|
103
112
|
|
|
113
|
+
Target specific providers by passing one or more flags:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
mcpocket push --copilot-cli
|
|
117
|
+
mcpocket push --cursor --codex
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
When provider flags are present, they scope the whole command:
|
|
121
|
+
|
|
122
|
+
- Only the selected providers' MCP configs are read and packed into `mcp-config.json`
|
|
123
|
+
- Claude home assets (`~/.claude/plugins`, `~/.claude/agents`, `~/.claude/skills`) are only synced when `--claude-code` is included
|
|
124
|
+
|
|
104
125
|
- In **repo mode**: commits and pushes to your private GitHub repo.
|
|
105
126
|
- In **gist mode**: uploads files to your private GitHub Gist (directory structure is flattened with `__` separators).
|
|
106
127
|
|
|
@@ -112,14 +133,39 @@ Downloads your config from the remote pocket, decrypts secrets with your passphr
|
|
|
112
133
|
mcpocket pull
|
|
113
134
|
```
|
|
114
135
|
|
|
136
|
+
You can also pull into only the providers you want:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
mcpocket pull --opencode
|
|
140
|
+
mcpocket pull --cursor --copilot-cli
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
With provider flags, pull only writes MCP servers to those selected providers. Claude home assets are only restored when `--claude-code` is included.
|
|
144
|
+
|
|
115
145
|
| Client | Config file |
|
|
116
146
|
|---|---|
|
|
117
147
|
| Claude Desktop | `claude_desktop_config.json` |
|
|
118
148
|
| Claude Code | `~/.claude/settings.json` |
|
|
119
149
|
| OpenCode | `~/.config/opencode/config.json` |
|
|
150
|
+
| Copilot CLI | VS Code/Copilot user `mcp.json` |
|
|
151
|
+
| Cursor | `~/.cursor/mcp.json` |
|
|
152
|
+
| Codex | `~/.codex/config.toml` |
|
|
153
|
+
| Antigravity | `~/.gemini/antigravity/mcp_config.json` |
|
|
120
154
|
|
|
121
155
|
Pull is **additive** — it adds servers that exist remotely but not locally, without overwriting your existing local config. Restart Claude Desktop after pulling to apply MCP changes.
|
|
122
156
|
|
|
157
|
+
For synced files, pull also removes stale agent and skill files that were previously synced but no longer exist in your pocket.
|
|
158
|
+
|
|
159
|
+
### `mcpocket de-dupe`
|
|
160
|
+
|
|
161
|
+
Refreshes the pocket, mirrors the current synced files, removes stale duplicates on both sides, and writes the cleaned result back to your configured backend.
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
mcpocket de-dupe
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Use this if you already have duplicate or renamed agent/skill/plugin files from earlier syncs. In normal use, `push` and `pull` now keep these folders de-duplicated automatically.
|
|
168
|
+
|
|
123
169
|
### `mcpocket status`
|
|
124
170
|
|
|
125
171
|
Shows a diff of what's synced, what's local-only, and what's remote-only:
|
|
@@ -148,11 +194,13 @@ mcpocket status
|
|
|
148
194
|
|
|
149
195
|
| Category | Source | Details |
|
|
150
196
|
|---|---|---|
|
|
151
|
-
| MCP server configs | Claude Desktop, Claude Code, OpenCode | Merged across all
|
|
197
|
+
| MCP server configs | Claude Desktop, Claude Code, OpenCode, Copilot CLI, Cursor, Codex, Antigravity | Merged across all selected providers |
|
|
152
198
|
| Plugin manifests | `~/.claude/plugins/` | `installed_plugins.json`, `blocklist.json`, `known_marketplaces.json` |
|
|
153
199
|
| Agents | `~/.claude/agents/` | All `*.md` files, recursively |
|
|
154
200
|
| Skills | `~/.claude/skills/` | All files, recursively (excluding `node_modules`) |
|
|
155
201
|
|
|
202
|
+
If you do not pass provider flags, `push` and `pull` operate on every supported provider. If you do pass flags, only those providers participate in the command.
|
|
203
|
+
|
|
156
204
|
### Never Synced
|
|
157
205
|
|
|
158
206
|
- `.credentials.json`
|
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,9 @@ const commander_1 = require("commander");
|
|
|
5
5
|
const init_js_1 = require("./commands/init.js");
|
|
6
6
|
const push_js_1 = require("./commands/push.js");
|
|
7
7
|
const pull_js_1 = require("./commands/pull.js");
|
|
8
|
+
const dedupe_js_1 = require("./commands/dedupe.js");
|
|
8
9
|
const status_js_1 = require("./commands/status.js");
|
|
10
|
+
const providers_js_1 = require("./clients/providers.js");
|
|
9
11
|
const sparkle_js_1 = require("./utils/sparkle.js");
|
|
10
12
|
const program = new commander_1.Command();
|
|
11
13
|
(0, sparkle_js_1.printBanner)();
|
|
@@ -19,12 +21,29 @@ program
|
|
|
19
21
|
.action(() => (0, init_js_1.initCommand)().catch(die));
|
|
20
22
|
program
|
|
21
23
|
.command('push')
|
|
22
|
-
.description('Tuck your AI setup into the cloud pocket')
|
|
23
|
-
|
|
24
|
+
.description('Tuck your AI setup into the cloud pocket');
|
|
25
|
+
for (const provider of providers_js_1.PROVIDER_OPTION_FLAGS) {
|
|
26
|
+
program.commands.find((command) => command.name() === 'push')?.option(provider.flag, provider.description);
|
|
27
|
+
}
|
|
28
|
+
program
|
|
29
|
+
.commands
|
|
30
|
+
.find((command) => command.name() === 'push')
|
|
31
|
+
?.action((options) => (0, push_js_1.pushCommand)(options).catch(die));
|
|
24
32
|
program
|
|
25
33
|
.command('pull')
|
|
26
|
-
.description('Unpack your AI setup from the cloud pocket')
|
|
27
|
-
|
|
34
|
+
.description('Unpack your AI setup from the cloud pocket');
|
|
35
|
+
for (const provider of providers_js_1.PROVIDER_OPTION_FLAGS) {
|
|
36
|
+
program.commands.find((command) => command.name() === 'pull')?.option(provider.flag, provider.description);
|
|
37
|
+
}
|
|
38
|
+
program
|
|
39
|
+
.commands
|
|
40
|
+
.find((command) => command.name() === 'pull')
|
|
41
|
+
?.action((options) => (0, pull_js_1.pullCommand)(options).catch(die));
|
|
42
|
+
program
|
|
43
|
+
.command('de-dupe')
|
|
44
|
+
.alias('dedupe')
|
|
45
|
+
.description('Clean stale synced files from your pocket and local folders')
|
|
46
|
+
.action(() => (0, dedupe_js_1.dedupeCommand)().catch(die));
|
|
28
47
|
program
|
|
29
48
|
.command('status')
|
|
30
49
|
.description('Peek inside: what\'s synced, what\'s local, what\'s remote')
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,gDAAiD;AACjD,gDAAiD;AACjD,gDAAiD;AACjD,oDAAqD;AACrD,mDAAuD;AAEvD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,IAAA,wBAAW,GAAE,CAAC;AAEd,OAAO;KACJ,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,4GAA4G,CAAC;KACzH,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,0DAA0D,CAAC;KACvE,MAAM,CAAC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
|
1
|
+
import type { McpServersMap } from './types.js';
|
|
2
|
+
export declare function readAntigravityMcpServers(): McpServersMap;
|
|
3
|
+
export declare function writeAntigravityMcpServers(servers: McpServersMap): void;
|
|
4
|
+
export declare function getConfigPath(): string;
|
|
5
|
+
//# sourceMappingURL=antigravity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"antigravity.d.ts","sourceRoot":"","sources":["../../src/clients/antigravity.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,YAAY,CAAC;AAOjE,wBAAgB,yBAAyB,IAAI,aAAa,CAgBzD;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAsBvE;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.readAntigravityMcpServers = readAntigravityMcpServers;
|
|
37
|
+
exports.writeAntigravityMcpServers = writeAntigravityMcpServers;
|
|
38
|
+
exports.getConfigPath = getConfigPath;
|
|
39
|
+
const fs = __importStar(require("fs"));
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
const paths_js_1 = require("../utils/paths.js");
|
|
42
|
+
function readAntigravityMcpServers() {
|
|
43
|
+
const configPath = (0, paths_js_1.getAntigravityConfigPath)();
|
|
44
|
+
if (!fs.existsSync(configPath)) {
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
49
|
+
const servers = config.mcpServers ?? {};
|
|
50
|
+
return Object.fromEntries(Object.entries(servers).map(([name, server]) => [name, fromAntigravityServer(server)]));
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
console.warn(`[mcpocket] Could not read Antigravity MCP config at ${configPath}`);
|
|
54
|
+
return {};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function writeAntigravityMcpServers(servers) {
|
|
58
|
+
const configPath = (0, paths_js_1.getAntigravityConfigPath)();
|
|
59
|
+
const dir = path.dirname(configPath);
|
|
60
|
+
let config = {};
|
|
61
|
+
if (fs.existsSync(configPath)) {
|
|
62
|
+
try {
|
|
63
|
+
config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
console.warn(`[mcpocket] Could not parse existing Antigravity config, will overwrite mcpServers only`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
71
|
+
}
|
|
72
|
+
const existing = config.mcpServers ?? {};
|
|
73
|
+
const mappedServers = Object.fromEntries(Object.entries(servers).map(([name, server]) => [name, toAntigravityServer(server)]));
|
|
74
|
+
config.mcpServers = { ...existing, ...mappedServers };
|
|
75
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf8');
|
|
76
|
+
}
|
|
77
|
+
function getConfigPath() {
|
|
78
|
+
return (0, paths_js_1.getAntigravityConfigPath)();
|
|
79
|
+
}
|
|
80
|
+
function fromAntigravityServer(server) {
|
|
81
|
+
if (!server.serverUrl) {
|
|
82
|
+
return server;
|
|
83
|
+
}
|
|
84
|
+
const { serverUrl, ...rest } = server;
|
|
85
|
+
return { ...rest, url: serverUrl };
|
|
86
|
+
}
|
|
87
|
+
function toAntigravityServer(server) {
|
|
88
|
+
if (!server.url) {
|
|
89
|
+
return server;
|
|
90
|
+
}
|
|
91
|
+
const { url, ...rest } = server;
|
|
92
|
+
return { ...rest, serverUrl: url };
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=antigravity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"antigravity.js","sourceRoot":"","sources":["../../src/clients/antigravity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,8DAgBC;AAED,gEAsBC;AAED,sCAEC;AAtDD,uCAAyB;AACzB,2CAA6B;AAC7B,gDAA6D;AAQ7D,SAAgB,yBAAyB;IACvC,MAAM,UAAU,GAAG,IAAA,mCAAwB,GAAE,CA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AAM,QAAQ,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;IACzC,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,CACtC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,CACrF,CAAC;IAEF,MAAM,CAAC,UAAU,GAAG,EAAE,GAAG,QAAQ,EAAE,GAAG,aAAa,EAAE,CAAC;IACtD,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACxE,CAAC;AAED,SAAgB,aAAa;IAC3B,OAAO,IAAA,mCAAwB,GAAE,CAAC;AACpC,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAgD;IAC7E,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QACtB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;IACtC,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC;AACrC,CAAC;AAED,SAAS,mBAAmB,CAAC,MAAuB;IAClD,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QAChB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;IAChC,OAAO,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { McpServersMap } from './types.js';
|
|
2
|
+
export declare function readCodexMcpServers(): McpServersMap;
|
|
3
|
+
export declare function writeCodexMcpServers(servers: McpServersMap): void;
|
|
4
|
+
export declare function getConfigPath(): string;
|
|
5
|
+
//# sourceMappingURL=codex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/clients/codex.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAOhD,wBAAgB,mBAAmB,IAAI,aAAa,CAanD;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAiBjE;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.readCodexMcpServers = readCodexMcpServers;
|
|
37
|
+
exports.writeCodexMcpServers = writeCodexMcpServers;
|
|
38
|
+
exports.getConfigPath = getConfigPath;
|
|
39
|
+
const fs = __importStar(require("node:fs"));
|
|
40
|
+
const path = __importStar(require("node:path"));
|
|
41
|
+
const TOML = __importStar(require("@iarna/toml"));
|
|
42
|
+
const paths_js_1 = require("../utils/paths.js");
|
|
43
|
+
function readCodexMcpServers() {
|
|
44
|
+
const configPath = (0, paths_js_1.getCodexConfigPath)();
|
|
45
|
+
if (!fs.existsSync(configPath)) {
|
|
46
|
+
return {};
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
const config = TOML.parse(fs.readFileSync(configPath, 'utf8'));
|
|
50
|
+
return config.mcp_servers ?? {};
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
console.warn(`[mcpocket] Could not read Codex config at ${configPath}`);
|
|
54
|
+
return {};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function writeCodexMcpServers(servers) {
|
|
58
|
+
const configPath = (0, paths_js_1.getCodexConfigPath)();
|
|
59
|
+
const dir = path.dirname(configPath);
|
|
60
|
+
let config = {};
|
|
61
|
+
if (fs.existsSync(configPath)) {
|
|
62
|
+
try {
|
|
63
|
+
config = TOML.parse(fs.readFileSync(configPath, 'utf8'));
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
console.warn(`[mcpocket] Could not parse existing Codex config, will overwrite mcp_servers only`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
71
|
+
}
|
|
72
|
+
config.mcp_servers = servers;
|
|
73
|
+
fs.writeFileSync(configPath, TOML.stringify(config), 'utf8');
|
|
74
|
+
}
|
|
75
|
+
function getConfigPath() {
|
|
76
|
+
return (0, paths_js_1.getCodexConfigPath)();
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=codex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../src/clients/codex.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,kDAaC;AAED,oDAiBC;AAED,sCAEC;AA/CD,4CAA8B;AAC9B,gDAAkC;AAClC,kDAAoC;AACpC,gDAAuD;AAQvD,SAAgB,mBAAmB;IACjC,MAAM,UAAU,GAAG,IAAA,6BAAkB,GAAE,CAAC;IACxC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAA2B,CAAC;QACzF,OAAO,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,IAAI,CAAC,6CAA6C,UAAU,EAAE,CAAC,CAAC;QACxE,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,SAAgB,oBAAoB,CAAC,OAAsB;IACzD,MAAM,UAAU,GAAG,IAAA,6BAAkB,GAAE,CAAC;IACxC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAErC,IAAI,MAAM,GAAgB,EAAE,CAAC;IAC7B,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9B,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAA2B,CAAC;QACrF,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,IAAI,CAAC,mFAAmF,CAAC,CAAC;QACpG,CAAC;IACH,CAAC;SAAM,CAAC;QACN,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC;IAC7B,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAsB,CAAC,EAAE,MAAM,CAAC,CAAC;AAC/E,CAAC;AAED,SAAgB,aAAa;IAC3B,OAAO,IAAA,6BAAkB,GAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { McpServersMap } from './types.js';
|
|
2
|
+
export declare function readCopilotCliMcpServers(): McpServersMap;
|
|
3
|
+
export declare function writeCopilotCliMcpServers(servers: McpServersMap): void;
|
|
4
|
+
export declare function getConfigPath(): string;
|
|
5
|
+
//# sourceMappingURL=copilot-cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-cli.d.ts","sourceRoot":"","sources":["../../src/clients/copilot-cli.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,YAAY,CAAC;AAQjE,wBAAgB,wBAAwB,IAAI,aAAa,CAaxD;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAmBtE;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.readCopilotCliMcpServers = readCopilotCliMcpServers;
|
|
37
|
+
exports.writeCopilotCliMcpServers = writeCopilotCliMcpServers;
|
|
38
|
+
exports.getConfigPath = getConfigPath;
|
|
39
|
+
const fs = __importStar(require("fs"));
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
const paths_js_1 = require("../utils/paths.js");
|
|
42
|
+
function readCopilotCliMcpServers() {
|
|
43
|
+
const configPath = (0, paths_js_1.getCopilotCliConfigPath)();
|
|
44
|
+
if (!fs.existsSync(configPath)) {
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
49
|
+
return config.servers ?? config.mcpServers ?? {};
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
console.warn(`[mcpocket] Could not read Copilot CLI MCP config at ${configPath}`);
|
|
53
|
+
return {};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function writeCopilotCliMcpServers(servers) {
|
|
57
|
+
const configPath = (0, paths_js_1.getCopilotCliConfigPath)();
|
|
58
|
+
const dir = path.dirname(configPath);
|
|
59
|
+
let config = {};
|
|
60
|
+
if (fs.existsSync(configPath)) {
|
|
61
|
+
try {
|
|
62
|
+
config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
console.warn(`[mcpocket] Could not parse existing Copilot CLI MCP config, will overwrite servers only`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
70
|
+
}
|
|
71
|
+
const key = config.mcpServers && !config.servers ? 'mcpServers' : 'servers';
|
|
72
|
+
const existing = config[key] ?? {};
|
|
73
|
+
config[key] = { ...existing, ...normalizeCopilotServers(servers) };
|
|
74
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf8');
|
|
75
|
+
}
|
|
76
|
+
function getConfigPath() {
|
|
77
|
+
return (0, paths_js_1.getCopilotCliConfigPath)();
|
|
78
|
+
}
|
|
79
|
+
function normalizeCopilotServers(servers) {
|
|
80
|
+
return Object.fromEntries(Object.entries(servers).map(([name, server]) => {
|
|
81
|
+
if (server.url) {
|
|
82
|
+
return [name, { ...server, type: server.type ?? 'http' }];
|
|
83
|
+
}
|
|
84
|
+
if (server.command) {
|
|
85
|
+
return [name, { ...server, type: server.type ?? 'stdio' }];
|
|
86
|
+
}
|
|
87
|
+
return [name, server];
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=copilot-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-cli.js","sourceRoot":"","sources":["../../src/clients/copilot-cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,4DAaC;AAED,8DAmBC;AAED,sCAEC;AAjDD,uCAAyB;AACzB,2CAA6B;AAC7B,gDAA4D;AAS5D,SAAgB,wBAAwB;IACtC,MAAM,UAAU,GAAG,IAAA,kCAAuB,GAAE,CAAC;IAC7C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAqB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;QACjF,OAAO,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;IACnD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,IAAI,CAAC,uDAAuD,UAAU,EAAE,CAAC,CAAC;QAClF,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,SAAgB,yBAAyB,CAAC,OAAsB;IAC9D,MAAM,UAAU,GAAG,IAAA,kCAAuB,GAAE,CAAC;IAC7C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAErC,IAAI,MAAM,GAAqB,EAAE,CAAC;IAClC,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,C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OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC,CAAC;QAC7D,CAAC;QAED,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACxB,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { McpServersMap } from './types.js';
|
|
2
|
+
export declare function readCursorMcpServers(): McpServersMap;
|
|
3
|
+
export declare function writeCursorMcpServers(servers: McpServersMap): void;
|
|
4
|
+
export declare function getConfigPath(): string;
|
|
5
|
+
//# sourceMappingURL=cursor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../src/clients/cursor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAuB,aAAa,EAAE,MAAM,YAAY,CAAC;AAErE,wBAAgB,oBAAoB,IAAI,aAAa,CAapD;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAiBlE;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.readCursorMcpServers = readCursorMcpServers;
|
|
37
|
+
exports.writeCursorMcpServers = writeCursorMcpServers;
|
|
38
|
+
exports.getConfigPath = getConfigPath;
|
|
39
|
+
const fs = __importStar(require("fs"));
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
const paths_js_1 = require("../utils/paths.js");
|
|
42
|
+
function readCursorMcpServers() {
|
|
43
|
+
const configPath = (0, paths_js_1.getCursorConfigPath)();
|
|
44
|
+
if (!fs.existsSync(configPath)) {
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
49
|
+
return config.mcpServers ?? {};
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
console.warn(`[mcpocket] Could not read Cursor MCP config at ${configPath}`);
|
|
53
|
+
return {};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function writeCursorMcpServers(servers) {
|
|
57
|
+
const configPath = (0, paths_js_1.getCursorConfigPath)();
|
|
58
|
+
const dir = path.dirname(configPath);
|
|
59
|
+
let config = {};
|
|
60
|
+
if (fs.existsSync(configPath)) {
|
|
61
|
+
try {
|
|
62
|
+
config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
console.warn(`[mcpocket] Could not parse existing Cursor MCP config, will overwrite mcpServers only`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
70
|
+
}
|
|
71
|
+
config.mcpServers = { ...(config.mcpServers ?? {}), ...servers };
|
|
72
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf8');
|
|
73
|
+
}
|
|
74
|
+
function getConfigPath() {
|
|
75
|
+
return (0, paths_js_1.getCursorConfigPath)();
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=cursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../src/clients/cursor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,oDAaC;AAED,sDAiBC;AAED,sCAEC;AAzCD,uCAAyB;AACzB,2CAA6B;AAC7B,gDAAwD;AAGxD,SAAgB,oBAAoB;IAClC,MAAM,UAAU,GAAG,IAAA,8BAAmB,GAAE,CAAC;IACzC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAwB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;QACpF,OAAO,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;IACjC,CAA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