@thantos66/claude-context-mcp 0.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/LICENSE +21 -0
- package/README.md +171 -0
- package/dist/constants.d.ts +33 -0
- package/dist/constants.js +59 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/agent-frontmatter.d.ts +55 -0
- package/dist/schemas/agent-frontmatter.js +43 -0
- package/dist/schemas/agent-frontmatter.js.map +1 -0
- package/dist/schemas/mcp-config.d.ts +177 -0
- package/dist/schemas/mcp-config.js +38 -0
- package/dist/schemas/mcp-config.js.map +1 -0
- package/dist/schemas/settings.d.ts +70 -0
- package/dist/schemas/settings.js +28 -0
- package/dist/schemas/settings.js.map +1 -0
- package/dist/schemas/skill-frontmatter.d.ts +42 -0
- package/dist/schemas/skill-frontmatter.js +27 -0
- package/dist/schemas/skill-frontmatter.js.map +1 -0
- package/dist/services/agents.d.ts +56 -0
- package/dist/services/agents.js +155 -0
- package/dist/services/agents.js.map +1 -0
- package/dist/services/atomic-write.d.ts +10 -0
- package/dist/services/atomic-write.js +46 -0
- package/dist/services/atomic-write.js.map +1 -0
- package/dist/services/backup.d.ts +13 -0
- package/dist/services/backup.js +52 -0
- package/dist/services/backup.js.map +1 -0
- package/dist/services/mcp-config.d.ts +72 -0
- package/dist/services/mcp-config.js +163 -0
- package/dist/services/mcp-config.js.map +1 -0
- package/dist/services/paths.d.ts +42 -0
- package/dist/services/paths.js +91 -0
- package/dist/services/paths.js.map +1 -0
- package/dist/services/permissions.d.ts +38 -0
- package/dist/services/permissions.js +104 -0
- package/dist/services/permissions.js.map +1 -0
- package/dist/services/skills.d.ts +62 -0
- package/dist/services/skills.js +181 -0
- package/dist/services/skills.js.map +1 -0
- package/dist/tools/agents.d.ts +2 -0
- package/dist/tools/agents.js +134 -0
- package/dist/tools/agents.js.map +1 -0
- package/dist/tools/helpers.d.ts +25 -0
- package/dist/tools/helpers.js +36 -0
- package/dist/tools/helpers.js.map +1 -0
- package/dist/tools/mcp.d.ts +2 -0
- package/dist/tools/mcp.js +257 -0
- package/dist/tools/mcp.js.map +1 -0
- package/dist/tools/meta.d.ts +2 -0
- package/dist/tools/meta.js +79 -0
- package/dist/tools/meta.js.map +1 -0
- package/dist/tools/permissions.d.ts +2 -0
- package/dist/tools/permissions.js +144 -0
- package/dist/tools/permissions.js.map +1 -0
- package/dist/tools/skills.d.ts +2 -0
- package/dist/tools/skills.js +160 -0
- package/dist/tools/skills.js.map +1 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Thantos66
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# claude-context-mcp
|
|
2
|
+
|
|
3
|
+
An MCP server that exposes tools for quickly customizing Claude Code & Claude
|
|
4
|
+
Desktop project context — MCP servers, subagents, skills, and tool permissions
|
|
5
|
+
— across any project on disk.
|
|
6
|
+
|
|
7
|
+
One place to say *"for project X, install server Y, allow agent Z, deny
|
|
8
|
+
`Bash(curl *)`, scaffold a skill called W"* and have it write all the right
|
|
9
|
+
files in all the right spots.
|
|
10
|
+
|
|
11
|
+
Follows Anthropic's [`mcp-builder`](https://github.com/anthropics/skills/tree/main/skills/mcp-builder)
|
|
12
|
+
skill conventions: TypeScript, Zod input validation, modern `registerTool()`
|
|
13
|
+
API, tool annotations on every tool, structured content alongside text.
|
|
14
|
+
|
|
15
|
+
## What it manages
|
|
16
|
+
|
|
17
|
+
| Subject | Scopes | Files touched |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| **MCP servers** | `desktop`, `user`, `project` | `claude_desktop_config.json`, `~/.claude.json`, `<project>/.mcp.json` |
|
|
20
|
+
| **Permissions** | `user`, `project` | `~/.claude/settings.json`, `<project>/.claude/settings.json` |
|
|
21
|
+
| **Subagents** | `user`, `project` | `~/.claude/agents/*.md`, `<project>/.claude/agents/*.md` |
|
|
22
|
+
| **Skills** | `user`, `project` | `~/.claude/skills/<name>/SKILL.md`, `<project>/.claude/skills/<name>/SKILL.md` |
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
cd claude-context-mcp
|
|
28
|
+
npm install
|
|
29
|
+
npm run build
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This produces `dist/index.js`, which is the stdio entry point.
|
|
33
|
+
|
|
34
|
+
## Wire into Claude Desktop
|
|
35
|
+
|
|
36
|
+
Edit `claude_desktop_config.json`:
|
|
37
|
+
|
|
38
|
+
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
39
|
+
- **Linux:** `~/.config/Claude/claude_desktop_config.json`
|
|
40
|
+
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"mcpServers": {
|
|
45
|
+
"claude-context": {
|
|
46
|
+
"command": "node",
|
|
47
|
+
"args": ["/absolute/path/to/claude-context-mcp/dist/index.js"]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Fully quit and relaunch Claude Desktop for the server to register.
|
|
54
|
+
|
|
55
|
+
## Wire into Claude Code
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
claude mcp add claude-context node /absolute/path/to/claude-context-mcp/dist/index.js
|
|
59
|
+
claude mcp list
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Tool surface
|
|
63
|
+
|
|
64
|
+
### MCP servers (`mcp_*`)
|
|
65
|
+
|
|
66
|
+
| Tool | What it does |
|
|
67
|
+
|---|---|
|
|
68
|
+
| `mcp_list_servers` | List configured servers across scopes. Env secrets redacted unless `revealSecrets=true`. |
|
|
69
|
+
| `mcp_get_server` | Show one server's full config. |
|
|
70
|
+
| `mcp_add_server` | Add a stdio (`command`+`args`+`env`) or HTTP (`url`+`headers`) entry. |
|
|
71
|
+
| `mcp_update_server` | Patch individual fields on an existing entry. |
|
|
72
|
+
| `mcp_remove_server` | Delete an entry. |
|
|
73
|
+
| `mcp_set_disabled` | Toggle `disabled: true/false` without deleting. |
|
|
74
|
+
|
|
75
|
+
### Permissions (`permissions_*`)
|
|
76
|
+
|
|
77
|
+
| Tool | What it does |
|
|
78
|
+
|---|---|
|
|
79
|
+
| `permissions_list` | Dump `allow` / `deny` / `ask` + `defaultMode` for a scope. |
|
|
80
|
+
| `permissions_add_rules` | Add rules to one of the lists (idempotent — duplicates skipped). |
|
|
81
|
+
| `permissions_remove_rule` | Remove a rule by exact string match. |
|
|
82
|
+
| `permissions_set_default_mode` | Set `defaultMode` to `default` / `acceptEdits` / `plan` / `auto` / `dontAsk` / `bypassPermissions`. |
|
|
83
|
+
|
|
84
|
+
Rules use the Claude Code grammar: `Tool`, `Bash(npm run *)`, `Read(./.env)`,
|
|
85
|
+
`WebFetch(domain:example.com)`, `mcp__<server>__<tool>`, `Agent(my-agent)`.
|
|
86
|
+
Evaluation order is **deny → ask → allow**, first match wins.
|
|
87
|
+
|
|
88
|
+
### Subagents (`agent_*`)
|
|
89
|
+
|
|
90
|
+
| Tool | What it does |
|
|
91
|
+
|---|---|
|
|
92
|
+
| `agent_list` | List subagents in a scope. |
|
|
93
|
+
| `agent_get` | Show one agent's full frontmatter + body. |
|
|
94
|
+
| `agent_create` | Scaffold a new `.claude/agents/<name>.md`. Accepts `tools` as string or array. |
|
|
95
|
+
| `agent_update` | Patch frontmatter fields and/or body. |
|
|
96
|
+
| `agent_delete` | Delete (with backup). |
|
|
97
|
+
|
|
98
|
+
### Skills (`skill_*`)
|
|
99
|
+
|
|
100
|
+
| Tool | What it does |
|
|
101
|
+
|---|---|
|
|
102
|
+
| `skill_list` | List skill folders in a scope. |
|
|
103
|
+
| `skill_get` | Show one skill's SKILL.md (frontmatter + body). |
|
|
104
|
+
| `skill_create` | Scaffold `.claude/skills/<name>/SKILL.md`. |
|
|
105
|
+
| `skill_update` | Patch frontmatter fields and/or body. |
|
|
106
|
+
| `skill_set_enabled` | Toggle `disable-model-invocation` flag (preserves files). |
|
|
107
|
+
| `skill_delete` | Remove a skill folder (with full-directory backup). |
|
|
108
|
+
|
|
109
|
+
### Meta (`meta_*`)
|
|
110
|
+
|
|
111
|
+
| Tool | What it does |
|
|
112
|
+
|---|---|
|
|
113
|
+
| `meta_platform_paths` | Return the resolved config paths for the current OS + optional project. |
|
|
114
|
+
| `meta_validate` | Parse/validate a config file without writing. |
|
|
115
|
+
| `meta_backup_file` | Manually snapshot a file to `~/.claude/backups/`. |
|
|
116
|
+
|
|
117
|
+
## Safety
|
|
118
|
+
|
|
119
|
+
- **Atomic writes.** Parse → Zod validate → mutate → serialize (2-space JSON) → temp file → `fs.rename`. Never string-edited.
|
|
120
|
+
- **Pre-write backups.** Every destructive / mutating tool snapshots the target to `~/.claude/backups/<basename>.<iso-timestamp>.bak` before touching disk. Skill deletes back up the whole directory.
|
|
121
|
+
- **Dry-run.** Every write tool accepts `dryRun: true` and returns a unified diff (or a file preview) without touching disk.
|
|
122
|
+
- **Restart reminders.** Any write to the Claude Desktop config includes `restartRequired: true` in `structuredContent` and a reminder in the text response.
|
|
123
|
+
- **Secret redaction.** `mcp_list_servers` / `mcp_get_server` redact env values whose key matches `/key|token|secret|password|apikey/i` unless you pass `revealSecrets: true`.
|
|
124
|
+
- **Scope safety.** Project-scope tools require an absolute `projectPath` under `$HOME`. Override with `allowOutsideHome: true` at the service level if you need it.
|
|
125
|
+
- **Annotations.** Every destructive tool declares `destructiveHint: true`, every read-only tool declares `readOnlyHint: true`, so your Claude client's approval UI prompts appropriately.
|
|
126
|
+
|
|
127
|
+
## Development
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
npm run dev # tsc --watch
|
|
131
|
+
npm test # run unit tests
|
|
132
|
+
npm run test:watch
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Unit tests use a fresh temp directory as `$HOME` for each test (via
|
|
136
|
+
`os.homedir()` spy), so they never touch your real config.
|
|
137
|
+
|
|
138
|
+
For a manual end-to-end walk through every tool, use the official inspector:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
npx @modelcontextprotocol/inspector node dist/index.js
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Layout
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
src/
|
|
148
|
+
├── index.ts # server bootstrap + registerTool() wiring
|
|
149
|
+
├── constants.ts # per-OS config path resolution
|
|
150
|
+
├── services/
|
|
151
|
+
│ ├── paths.ts # scope → absolute path
|
|
152
|
+
│ ├── backup.ts # snapshot helpers
|
|
153
|
+
│ ├── atomic-write.ts # temp-file + rename
|
|
154
|
+
│ ├── mcp-config.ts # mcpServers CRUD across 3 scopes
|
|
155
|
+
│ ├── permissions.ts # settings.json permissions CRUD
|
|
156
|
+
│ ├── agents.ts # .claude/agents/*.md CRUD
|
|
157
|
+
│ └── skills.ts # .claude/skills/<name>/ CRUD
|
|
158
|
+
├── schemas/
|
|
159
|
+
│ ├── mcp-config.ts # Zod for stdio + HTTP entries
|
|
160
|
+
│ ├── settings.ts # Zod for permissions + defaultMode
|
|
161
|
+
│ ├── agent-frontmatter.ts # Zod for agent YAML
|
|
162
|
+
│ └── skill-frontmatter.ts # Zod for skill YAML
|
|
163
|
+
└── tools/ # one file per subject, each exports a register* fn
|
|
164
|
+
├── helpers.ts
|
|
165
|
+
├── mcp.ts
|
|
166
|
+
├── permissions.ts
|
|
167
|
+
├── agents.ts
|
|
168
|
+
├── skills.ts
|
|
169
|
+
└── meta.ts
|
|
170
|
+
tests/ # vitest; each test runs in a spoofed $HOME
|
|
171
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported scopes across the tool surface.
|
|
3
|
+
* - `desktop` — Claude Desktop app config (only meaningful for MCP servers)
|
|
4
|
+
* - `user` — ~/.claude.json and ~/.claude/… user-wide Claude Code config
|
|
5
|
+
* - `project` — <projectPath>/.claude/… project-scoped Claude Code config
|
|
6
|
+
*/
|
|
7
|
+
export type Scope = "desktop" | "user" | "project";
|
|
8
|
+
/**
|
|
9
|
+
* Resolve the Claude Desktop config file path for the current OS.
|
|
10
|
+
*
|
|
11
|
+
* - macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
|
|
12
|
+
* - Windows: %APPDATA%/Claude/claude_desktop_config.json
|
|
13
|
+
* - Linux: ~/.config/Claude/claude_desktop_config.json
|
|
14
|
+
*/
|
|
15
|
+
export declare function claudeDesktopConfigPath(): string;
|
|
16
|
+
/** ~/.claude.json — Claude Code user-scope config (holds user mcpServers). */
|
|
17
|
+
export declare function claudeCodeUserJsonPath(): string;
|
|
18
|
+
/** ~/.claude/settings.json — Claude Code user-scope settings (permissions, hooks). */
|
|
19
|
+
export declare function claudeCodeUserSettingsPath(): string;
|
|
20
|
+
/** ~/.claude/agents — user-scope subagent directory. */
|
|
21
|
+
export declare function claudeCodeUserAgentsDir(): string;
|
|
22
|
+
/** ~/.claude/skills — user-scope skills directory. */
|
|
23
|
+
export declare function claudeCodeUserSkillsDir(): string;
|
|
24
|
+
/** ~/.claude/backups — backup snapshot directory. */
|
|
25
|
+
export declare function backupsDir(): string;
|
|
26
|
+
/** <project>/.mcp.json — project-scope MCP server config. */
|
|
27
|
+
export declare function projectMcpJsonPath(projectPath: string): string;
|
|
28
|
+
/** <project>/.claude/settings.json — project-scope settings. */
|
|
29
|
+
export declare function projectSettingsPath(projectPath: string): string;
|
|
30
|
+
/** <project>/.claude/agents — project-scope subagents directory. */
|
|
31
|
+
export declare function projectAgentsDir(projectPath: string): string;
|
|
32
|
+
/** <project>/.claude/skills — project-scope skills directory. */
|
|
33
|
+
export declare function projectSkillsDir(projectPath: string): string;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import os from "node:os";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
/**
|
|
4
|
+
* Resolve the Claude Desktop config file path for the current OS.
|
|
5
|
+
*
|
|
6
|
+
* - macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
|
|
7
|
+
* - Windows: %APPDATA%/Claude/claude_desktop_config.json
|
|
8
|
+
* - Linux: ~/.config/Claude/claude_desktop_config.json
|
|
9
|
+
*/
|
|
10
|
+
export function claudeDesktopConfigPath() {
|
|
11
|
+
const home = os.homedir();
|
|
12
|
+
switch (process.platform) {
|
|
13
|
+
case "darwin":
|
|
14
|
+
return path.join(home, "Library", "Application Support", "Claude", "claude_desktop_config.json");
|
|
15
|
+
case "win32": {
|
|
16
|
+
const appData = process.env.APPDATA ?? path.join(home, "AppData", "Roaming");
|
|
17
|
+
return path.join(appData, "Claude", "claude_desktop_config.json");
|
|
18
|
+
}
|
|
19
|
+
default:
|
|
20
|
+
return path.join(home, ".config", "Claude", "claude_desktop_config.json");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** ~/.claude.json — Claude Code user-scope config (holds user mcpServers). */
|
|
24
|
+
export function claudeCodeUserJsonPath() {
|
|
25
|
+
return path.join(os.homedir(), ".claude.json");
|
|
26
|
+
}
|
|
27
|
+
/** ~/.claude/settings.json — Claude Code user-scope settings (permissions, hooks). */
|
|
28
|
+
export function claudeCodeUserSettingsPath() {
|
|
29
|
+
return path.join(os.homedir(), ".claude", "settings.json");
|
|
30
|
+
}
|
|
31
|
+
/** ~/.claude/agents — user-scope subagent directory. */
|
|
32
|
+
export function claudeCodeUserAgentsDir() {
|
|
33
|
+
return path.join(os.homedir(), ".claude", "agents");
|
|
34
|
+
}
|
|
35
|
+
/** ~/.claude/skills — user-scope skills directory. */
|
|
36
|
+
export function claudeCodeUserSkillsDir() {
|
|
37
|
+
return path.join(os.homedir(), ".claude", "skills");
|
|
38
|
+
}
|
|
39
|
+
/** ~/.claude/backups — backup snapshot directory. */
|
|
40
|
+
export function backupsDir() {
|
|
41
|
+
return path.join(os.homedir(), ".claude", "backups");
|
|
42
|
+
}
|
|
43
|
+
/** <project>/.mcp.json — project-scope MCP server config. */
|
|
44
|
+
export function projectMcpJsonPath(projectPath) {
|
|
45
|
+
return path.join(projectPath, ".mcp.json");
|
|
46
|
+
}
|
|
47
|
+
/** <project>/.claude/settings.json — project-scope settings. */
|
|
48
|
+
export function projectSettingsPath(projectPath) {
|
|
49
|
+
return path.join(projectPath, ".claude", "settings.json");
|
|
50
|
+
}
|
|
51
|
+
/** <project>/.claude/agents — project-scope subagents directory. */
|
|
52
|
+
export function projectAgentsDir(projectPath) {
|
|
53
|
+
return path.join(projectPath, ".claude", "agents");
|
|
54
|
+
}
|
|
55
|
+
/** <project>/.claude/skills — project-scope skills directory. */
|
|
56
|
+
export function projectSkillsDir(projectPath) {
|
|
57
|
+
return path.join(projectPath, ".claude", "skills");
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAU7B;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB;IACrC,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;IAC1B,QAAQ,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzB,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC,IAAI,CACd,IAAI,EACJ,SAAS,EACT,qBAAqB,EACrB,QAAQ,EACR,4BAA4B,CAC7B,CAAC;QACJ,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;YAC7E,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,4BAA4B,CAAC,CAAC;QACpE,CAAC;QACD;YACE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,4BAA4B,CAAC,CAAC;IAC9E,CAAC;AACH,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,sBAAsB;IACpC,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,CAAC;AACjD,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,0BAA0B;IACxC,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;AAC7D,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,uBAAuB;IACrC,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AACtD,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,uBAAuB;IACrC,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AACtD,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,UAAU;IACxB,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AACvD,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,mBAAmB,CAAC,WAAmB;IACrD,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;AAC5D,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,gBAAgB,CAAC,WAAmB;IAClD,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AACrD,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,gBAAgB,CAAC,WAAmB;IAClD,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AACrD,CAAC"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* claude-context-mcp — MCP server for managing Claude Code & Desktop context.
|
|
4
|
+
*
|
|
5
|
+
* Exposes tools for quickly manipulating:
|
|
6
|
+
* - MCP servers (Claude Desktop + Claude Code user + project)
|
|
7
|
+
* - Tool permissions (allow / deny / ask + defaultMode)
|
|
8
|
+
* - Subagents (.claude/agents/*.md, user + project)
|
|
9
|
+
* - Skills (.claude/skills/<name>/SKILL.md, user + project)
|
|
10
|
+
*
|
|
11
|
+
* Transport: stdio. Follows mcp-builder skill conventions:
|
|
12
|
+
* - registerTool() modern API
|
|
13
|
+
* - Zod input schemas
|
|
14
|
+
* - readOnly/destructive/idempotent/openWorld annotations on every tool
|
|
15
|
+
* - structuredContent alongside text responses
|
|
16
|
+
*/
|
|
17
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
18
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
19
|
+
import { registerMcpTools } from "./tools/mcp.js";
|
|
20
|
+
import { registerPermissionsTools } from "./tools/permissions.js";
|
|
21
|
+
import { registerAgentTools } from "./tools/agents.js";
|
|
22
|
+
import { registerSkillTools } from "./tools/skills.js";
|
|
23
|
+
import { registerMetaTools } from "./tools/meta.js";
|
|
24
|
+
async function main() {
|
|
25
|
+
const server = new McpServer({
|
|
26
|
+
name: "claude-context-mcp",
|
|
27
|
+
version: "0.1.0",
|
|
28
|
+
});
|
|
29
|
+
registerMcpTools(server);
|
|
30
|
+
registerPermissionsTools(server);
|
|
31
|
+
registerAgentTools(server);
|
|
32
|
+
registerSkillTools(server);
|
|
33
|
+
registerMetaTools(server);
|
|
34
|
+
const transport = new StdioServerTransport();
|
|
35
|
+
await server.connect(transport);
|
|
36
|
+
// NOTE: we intentionally don't log anything to stdout — it's reserved for
|
|
37
|
+
// the JSON-RPC framing. Any diagnostics go to stderr.
|
|
38
|
+
process.stderr.write("[claude-context-mcp] ready on stdio\n");
|
|
39
|
+
}
|
|
40
|
+
main().catch((err) => {
|
|
41
|
+
process.stderr.write(`[claude-context-mcp] fatal: ${err.stack ?? err}\n`);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACzB,wBAAwB,CAAC,MAAM,CAAC,CAAC;IACjC,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC3B,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC3B,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAE1B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,0EAA0E;IAC1E,sDAAsD;IACtD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;AAChE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,+BAAgC,GAAa,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC,CAAC;IACrF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Claude Code subagent frontmatter schema.
|
|
4
|
+
*
|
|
5
|
+
* NOTE: `tools` in the on-disk format is a comma-separated STRING, not a
|
|
6
|
+
* YAML array. We accept either on input (for tool ergonomics) and always
|
|
7
|
+
* serialize as a string on write.
|
|
8
|
+
*/
|
|
9
|
+
export declare const AgentModelSchema: z.ZodUnion<[z.ZodEnum<["sonnet", "opus", "haiku", "inherit"]>, z.ZodString]>;
|
|
10
|
+
export declare const AgentFrontmatterSchema: z.ZodObject<{
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
description: z.ZodString;
|
|
13
|
+
model: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["sonnet", "opus", "haiku", "inherit"]>, z.ZodString]>>;
|
|
14
|
+
tools: z.ZodOptional<z.ZodString>;
|
|
15
|
+
color: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
description: z.ZodString;
|
|
19
|
+
model: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["sonnet", "opus", "haiku", "inherit"]>, z.ZodString]>>;
|
|
20
|
+
tools: z.ZodOptional<z.ZodString>;
|
|
21
|
+
color: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
23
|
+
name: z.ZodString;
|
|
24
|
+
description: z.ZodString;
|
|
25
|
+
model: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["sonnet", "opus", "haiku", "inherit"]>, z.ZodString]>>;
|
|
26
|
+
tools: z.ZodOptional<z.ZodString>;
|
|
27
|
+
color: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
29
|
+
export type AgentFrontmatter = z.infer<typeof AgentFrontmatterSchema>;
|
|
30
|
+
/** Input shape: accept `tools` as string OR array of strings for ergonomics. */
|
|
31
|
+
export declare const AgentInputSchema: z.ZodObject<{
|
|
32
|
+
name: z.ZodString;
|
|
33
|
+
description: z.ZodString;
|
|
34
|
+
model: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["sonnet", "opus", "haiku", "inherit"]>, z.ZodString]>>;
|
|
35
|
+
tools: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
36
|
+
color: z.ZodOptional<z.ZodString>;
|
|
37
|
+
body: z.ZodDefault<z.ZodString>;
|
|
38
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
description: z.ZodString;
|
|
41
|
+
model: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["sonnet", "opus", "haiku", "inherit"]>, z.ZodString]>>;
|
|
42
|
+
tools: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
43
|
+
color: z.ZodOptional<z.ZodString>;
|
|
44
|
+
body: z.ZodDefault<z.ZodString>;
|
|
45
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
46
|
+
name: z.ZodString;
|
|
47
|
+
description: z.ZodString;
|
|
48
|
+
model: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["sonnet", "opus", "haiku", "inherit"]>, z.ZodString]>>;
|
|
49
|
+
tools: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
50
|
+
color: z.ZodOptional<z.ZodString>;
|
|
51
|
+
body: z.ZodDefault<z.ZodString>;
|
|
52
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
53
|
+
export type AgentInput = z.infer<typeof AgentInputSchema>;
|
|
54
|
+
/** Normalize tools input to the on-disk comma-separated string form. */
|
|
55
|
+
export declare function normalizeTools(tools: string | string[] | undefined): string | undefined;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Claude Code subagent frontmatter schema.
|
|
4
|
+
*
|
|
5
|
+
* NOTE: `tools` in the on-disk format is a comma-separated STRING, not a
|
|
6
|
+
* YAML array. We accept either on input (for tool ergonomics) and always
|
|
7
|
+
* serialize as a string on write.
|
|
8
|
+
*/
|
|
9
|
+
export const AgentModelSchema = z.union([
|
|
10
|
+
z.enum(["sonnet", "opus", "haiku", "inherit"]),
|
|
11
|
+
z.string().min(1), // allow full model IDs e.g. claude-opus-4-6
|
|
12
|
+
]);
|
|
13
|
+
export const AgentFrontmatterSchema = z
|
|
14
|
+
.object({
|
|
15
|
+
name: z
|
|
16
|
+
.string()
|
|
17
|
+
.regex(/^[a-z0-9][a-z0-9-]*$/, "agent name must be lowercase alphanumeric + hyphens"),
|
|
18
|
+
description: z.string().min(1),
|
|
19
|
+
model: AgentModelSchema.optional(),
|
|
20
|
+
tools: z.string().optional(), // comma-separated on disk
|
|
21
|
+
color: z.string().optional(),
|
|
22
|
+
})
|
|
23
|
+
.passthrough();
|
|
24
|
+
/** Input shape: accept `tools` as string OR array of strings for ergonomics. */
|
|
25
|
+
export const AgentInputSchema = z
|
|
26
|
+
.object({
|
|
27
|
+
name: AgentFrontmatterSchema.shape.name,
|
|
28
|
+
description: z.string().min(1),
|
|
29
|
+
model: AgentModelSchema.optional(),
|
|
30
|
+
tools: z.union([z.string(), z.array(z.string())]).optional(),
|
|
31
|
+
color: z.string().optional(),
|
|
32
|
+
body: z.string().default(""),
|
|
33
|
+
})
|
|
34
|
+
.passthrough();
|
|
35
|
+
/** Normalize tools input to the on-disk comma-separated string form. */
|
|
36
|
+
export function normalizeTools(tools) {
|
|
37
|
+
if (tools === undefined)
|
|
38
|
+
return undefined;
|
|
39
|
+
if (Array.isArray(tools))
|
|
40
|
+
return tools.join(", ");
|
|
41
|
+
return tools;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=agent-frontmatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-frontmatter.js","sourceRoot":"","sources":["../../src/schemas/agent-frontmatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC;IACtC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IAC9C,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,4CAA4C;CAChE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC;KACpC,MAAM,CAAC;IACN,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,KAAK,CAAC,sBAAsB,EAAE,qDAAqD,CAAC;IACvF,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,KAAK,EAAE,gBAAgB,CAAC,QAAQ,EAAE;IAClC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,0BAA0B;IACxD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC;KACD,WAAW,EAAE,CAAC;AAIjB,gFAAgF;AAChF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACN,IAAI,EAAE,sBAAsB,CAAC,KAAK,CAAC,IAAI;IACvC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,KAAK,EAAE,gBAAgB,CAAC,QAAQ,EAAE;IAClC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC5D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CAC7B,CAAC;KACD,WAAW,EAAE,CAAC;AAIjB,wEAAwE;AACxE,MAAM,UAAU,cAAc,CAC5B,KAAoC;IAEpC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Shape of one entry in `mcpServers`. Two forms:
|
|
4
|
+
* - stdio: `command` + optional `args`/`env`
|
|
5
|
+
* - http: `url` + optional `headers`
|
|
6
|
+
*
|
|
7
|
+
* We allow extra unknown fields to pass through (the spec is evolving),
|
|
8
|
+
* but we validate the known ones strictly.
|
|
9
|
+
*/
|
|
10
|
+
export declare const StdioServerSchema: z.ZodObject<{
|
|
11
|
+
command: z.ZodString;
|
|
12
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
13
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
14
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
15
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
17
|
+
command: z.ZodString;
|
|
18
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
19
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
20
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
21
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
23
|
+
command: z.ZodString;
|
|
24
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
25
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
26
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
27
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
29
|
+
export declare const HttpServerSchema: z.ZodObject<{
|
|
30
|
+
url: z.ZodString;
|
|
31
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
32
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
34
|
+
url: z.ZodString;
|
|
35
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
36
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
38
|
+
url: z.ZodString;
|
|
39
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
40
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
42
|
+
export declare const McpServerEntrySchema: z.ZodUnion<[z.ZodObject<{
|
|
43
|
+
command: z.ZodString;
|
|
44
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
45
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
46
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
47
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
49
|
+
command: z.ZodString;
|
|
50
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
51
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
52
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
53
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
55
|
+
command: z.ZodString;
|
|
56
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
57
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
58
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
59
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
}, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
|
|
61
|
+
url: z.ZodString;
|
|
62
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
63
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
65
|
+
url: z.ZodString;
|
|
66
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
67
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
68
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
69
|
+
url: z.ZodString;
|
|
70
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
71
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
+
}, z.ZodTypeAny, "passthrough">>]>;
|
|
73
|
+
/** The full top-level file shape — both claude_desktop_config.json and .mcp.json
|
|
74
|
+
* only use the `mcpServers` key; anything else is passed through untouched. */
|
|
75
|
+
export declare const McpConfigFileSchema: z.ZodObject<{
|
|
76
|
+
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
77
|
+
command: z.ZodString;
|
|
78
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
79
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
80
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
81
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
82
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
83
|
+
command: z.ZodString;
|
|
84
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
85
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
86
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
87
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
89
|
+
command: z.ZodString;
|
|
90
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
91
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
92
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
93
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
94
|
+
}, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
|
|
95
|
+
url: z.ZodString;
|
|
96
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
97
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
98
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
99
|
+
url: z.ZodString;
|
|
100
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
101
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
103
|
+
url: z.ZodString;
|
|
104
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
105
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
}, z.ZodTypeAny, "passthrough">>]>>>;
|
|
107
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
108
|
+
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
109
|
+
command: z.ZodString;
|
|
110
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
111
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
112
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
113
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
115
|
+
command: z.ZodString;
|
|
116
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
117
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
118
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
119
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
121
|
+
command: z.ZodString;
|
|
122
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
123
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
124
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
125
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
}, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
|
|
127
|
+
url: z.ZodString;
|
|
128
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
129
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
130
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
131
|
+
url: z.ZodString;
|
|
132
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
133
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
134
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
135
|
+
url: z.ZodString;
|
|
136
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
137
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
138
|
+
}, z.ZodTypeAny, "passthrough">>]>>>;
|
|
139
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
140
|
+
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
141
|
+
command: z.ZodString;
|
|
142
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
143
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
144
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
145
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
146
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
147
|
+
command: z.ZodString;
|
|
148
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
149
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
150
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
151
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
152
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
153
|
+
command: z.ZodString;
|
|
154
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
155
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
156
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
157
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
158
|
+
}, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
|
|
159
|
+
url: z.ZodString;
|
|
160
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
161
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
162
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
163
|
+
url: z.ZodString;
|
|
164
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
165
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
166
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
167
|
+
url: z.ZodString;
|
|
168
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
169
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
}, z.ZodTypeAny, "passthrough">>]>>>;
|
|
171
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
172
|
+
export type StdioServer = z.infer<typeof StdioServerSchema>;
|
|
173
|
+
export type HttpServer = z.infer<typeof HttpServerSchema>;
|
|
174
|
+
export type McpServerEntry = z.infer<typeof McpServerEntrySchema>;
|
|
175
|
+
export type McpConfigFile = z.infer<typeof McpConfigFileSchema>;
|
|
176
|
+
/** Type guard: stdio vs http entry. */
|
|
177
|
+
export declare function isStdioServer(entry: McpServerEntry): entry is StdioServer;
|