@mcpc-tech/cli 0.1.16 → 0.1.19
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 +139 -46
- package/bin/mcpc.mjs +1187 -1065
- package/package.json +1 -1
- package/types/src/app.d.ts +1 -1
- package/types/src/app.d.ts.map +1 -1
- package/types/src/config/loader.d.ts +2 -1
- package/types/src/config/loader.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -5,79 +5,108 @@
|
|
|
5
5
|
|
|
6
6
|
CLI server for MCPC with configuration support.
|
|
7
7
|
|
|
8
|
-
> **Note:**
|
|
9
|
-
> on JSR.
|
|
8
|
+
> **Note:** Published as `@mcpc-tech/cli` on npm and `@mcpc/cli` on JSR.
|
|
10
9
|
|
|
11
10
|
## Quick Start
|
|
12
11
|
|
|
13
12
|
```bash
|
|
14
|
-
#
|
|
15
|
-
|
|
13
|
+
# Install globally (or use npx -y @mcpc-tech/cli instead of mcpc)
|
|
14
|
+
npm install -g @mcpc-tech/cli
|
|
16
15
|
|
|
17
|
-
#
|
|
18
|
-
|
|
16
|
+
# Wrap an existing MCP server and run it immediately
|
|
17
|
+
mcpc --wrap --name "file-manager" \
|
|
18
|
+
--mcp-stdio "npx -y @wonderwhy-er/desktop-commander"
|
|
19
19
|
|
|
20
|
-
#
|
|
21
|
-
npx -y
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Configuration
|
|
20
|
+
# Add MCP servers to config, then run separately
|
|
21
|
+
mcpc --add --mcp-stdio "npx -y @wonderwhy-er/desktop-commander"
|
|
22
|
+
mcpc # Loads ~/.mcpc/config.json automatically
|
|
26
23
|
|
|
27
|
-
|
|
24
|
+
# Show help
|
|
25
|
+
mcpc --help
|
|
26
|
+
```
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
- `--config <json>` - Inline JSON configuration string
|
|
31
|
-
- `--config-url <url>` - Fetch from URL (e.g., GitHub raw)
|
|
32
|
-
- `--config-file <path>` - Path to configuration file
|
|
33
|
-
- `--request-headers <header>`, `-H <header>` - Add custom HTTP header for URL
|
|
34
|
-
fetching (can be used multiple times)
|
|
35
|
-
- No arguments - Uses `./mcpc.config.json` if available
|
|
28
|
+
## Wrapping MCP Servers
|
|
36
29
|
|
|
37
|
-
|
|
30
|
+
The simplest way to use MCPC is to wrap existing MCP servers with custom
|
|
31
|
+
execution modes:
|
|
38
32
|
|
|
39
|
-
|
|
33
|
+
### One-time Run (no config saved)
|
|
40
34
|
|
|
41
35
|
```bash
|
|
42
|
-
|
|
36
|
+
# Wrap and run a single MCP server
|
|
37
|
+
mcpc --wrap --name "my-file-manager-agent" \
|
|
38
|
+
--mcp-stdio "npx -y @wonderwhy-er/desktop-commander"
|
|
39
|
+
|
|
40
|
+
# Wrap multiple servers with different protocols and execution mode
|
|
41
|
+
mcpc --wrap --name "file-and-github-agent" --mode code_execution \
|
|
42
|
+
--mcp-stdio "npx -y @wonderwhy-er/desktop-commander" \
|
|
43
|
+
--mcp-http "https://api.github.com/mcp"
|
|
43
44
|
```
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
### Persistent Config (save and reuse)
|
|
46
47
|
|
|
47
48
|
```bash
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
# Step 1: Add servers to config
|
|
50
|
+
mcpc --add --mcp-stdio "npx -y @wonderwhy-er/desktop-commander"
|
|
50
51
|
|
|
51
|
-
|
|
52
|
+
# Step 2: (Optional) Edit ~/.mcpc/config.json to add headers, env vars, etc.
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
# Step 3: Run with saved config
|
|
55
|
+
mcpc # Automatically loads ~/.mcpc/config.json
|
|
55
56
|
```
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
The config file lets you add custom headers, environment variables, and other
|
|
59
|
+
settings:
|
|
58
60
|
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"agents": [{
|
|
64
|
+
"deps": {
|
|
65
|
+
"mcpServers": {
|
|
66
|
+
"github": {
|
|
67
|
+
"command": "https://api.github.com/mcp",
|
|
68
|
+
"transportType": "streamable-http",
|
|
69
|
+
"headers": {
|
|
70
|
+
"Authorization": "Bearer YOUR_TOKEN"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}]
|
|
76
|
+
}
|
|
64
77
|
```
|
|
65
78
|
|
|
66
|
-
|
|
79
|
+
## Configuration Files
|
|
80
|
+
|
|
81
|
+
Load config from different sources:
|
|
67
82
|
|
|
68
83
|
```bash
|
|
69
|
-
|
|
70
|
-
|
|
84
|
+
# From a specific file
|
|
85
|
+
mcpc --config-file ./my-config.json
|
|
71
86
|
|
|
72
|
-
|
|
87
|
+
# From a URL
|
|
88
|
+
mcpc --config-url https://example.com/config.json
|
|
73
89
|
|
|
74
|
-
|
|
75
|
-
|
|
90
|
+
# From URL with custom headers
|
|
91
|
+
mcpc --config-url https://api.example.com/config.json \
|
|
92
|
+
-H "Authorization: Bearer token123"
|
|
93
|
+
|
|
94
|
+
# Inline JSON
|
|
95
|
+
mcpc --config '[{"name":"my-agent","description":"..."}]'
|
|
76
96
|
```
|
|
77
97
|
|
|
78
|
-
|
|
98
|
+
### Config Priority Order
|
|
99
|
+
|
|
100
|
+
1. `--config` (inline JSON)
|
|
101
|
+
2. `MCPC_CONFIG` environment variable
|
|
102
|
+
3. `--config-url` or `MCPC_CONFIG_URL`
|
|
103
|
+
4. `--config-file` or `MCPC_CONFIG_FILE`
|
|
104
|
+
5. `~/.mcpc/config.json` (user config)
|
|
105
|
+
6. `./mcpc.config.json` (local config)
|
|
106
|
+
|
|
107
|
+
### Environment Variables
|
|
79
108
|
|
|
80
|
-
|
|
109
|
+
Use `$VAR_NAME` syntax in config files:
|
|
81
110
|
|
|
82
111
|
```json
|
|
83
112
|
{
|
|
@@ -86,7 +115,7 @@ Config files support `$ENV_VAR_NAME` syntax:
|
|
|
86
115
|
"mcpServers": {
|
|
87
116
|
"github": {
|
|
88
117
|
"headers": {
|
|
89
|
-
"Authorization": "Bearer $
|
|
118
|
+
"Authorization": "Bearer $GITHUB_TOKEN"
|
|
90
119
|
}
|
|
91
120
|
}
|
|
92
121
|
}
|
|
@@ -95,14 +124,78 @@ Config files support `$ENV_VAR_NAME` syntax:
|
|
|
95
124
|
}
|
|
96
125
|
```
|
|
97
126
|
|
|
98
|
-
|
|
127
|
+
## HTTP Server
|
|
128
|
+
|
|
129
|
+
Run as an HTTP server instead of stdio:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
deno run -A jsr:@mcpc/cli/server --config-file ./my-config.json
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Command Reference
|
|
136
|
+
|
|
137
|
+
### Main Options
|
|
138
|
+
|
|
139
|
+
- `--help`, `-h` - Show help message
|
|
140
|
+
- `--add` - Add MCP servers to `~/.mcpc/config.json` and exit
|
|
141
|
+
- `--wrap` - Wrap and run MCP servers immediately (no config saved)
|
|
142
|
+
- `--mcp-stdio <cmd>` - Add stdio MCP server
|
|
143
|
+
- `--mcp-http <url>` - Add HTTP MCP server
|
|
144
|
+
- `--mcp-sse <url>` - Add SSE MCP server
|
|
145
|
+
- `--name <name>` - Custom agent name (default: auto-generated from server
|
|
146
|
+
names)
|
|
147
|
+
- `--mode <mode>` - Execution mode (default: `agentic`)
|
|
148
|
+
|
|
149
|
+
### Execution Modes (`--mode`)
|
|
150
|
+
|
|
151
|
+
MCPC supports different execution modes that control how the agent processes and
|
|
152
|
+
executes tools:
|
|
153
|
+
|
|
154
|
+
#### `agentic` (default)
|
|
155
|
+
|
|
156
|
+
Interactive tool execution where the AI agent decides which tools to call and
|
|
157
|
+
when. The agent can make multiple tool calls in a conversation-like flow.
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
mcpc --wrap --mode agentic --name "smart-assistant" \
|
|
161
|
+
--mcp-stdio "npx -y @wonderwhy-er/desktop-commander"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
#### `agentic_workflow`
|
|
165
|
+
|
|
166
|
+
Structured execution with predefined or runtime-generated steps. The agent
|
|
167
|
+
follows a workflow pattern with specific actions at each step.
|
|
99
168
|
|
|
100
169
|
```bash
|
|
101
|
-
|
|
170
|
+
mcpc --wrap --mode agentic_workflow --name "workflow-processor" \
|
|
171
|
+
--mcp-stdio "npx -y @wonderwhy-er/desktop-commander"
|
|
102
172
|
```
|
|
103
173
|
|
|
174
|
+
#### `code_execution`
|
|
175
|
+
|
|
176
|
+
Enables code execution capabilities for running code snippets and scripts
|
|
177
|
+
through the agent.
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
mcpc --wrap --mode code_execution --name "code-runner" \
|
|
181
|
+
--mcp-stdio "npx -y @wonderwhy-er/desktop-commander"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
> **Note:** Different modes may require specific plugins to be available. The
|
|
185
|
+
> `agentic` mode is always available by default.
|
|
186
|
+
|
|
187
|
+
### Config Options
|
|
188
|
+
|
|
189
|
+
- `--config <json>` - Inline JSON config
|
|
190
|
+
- `--config-url <url>` - Fetch config from URL
|
|
191
|
+
- `--config-file <path>` - Load config from file
|
|
192
|
+
- `--request-headers <header>`, `-H <header>` - Add HTTP header for URL fetching
|
|
193
|
+
|
|
104
194
|
## Examples
|
|
105
195
|
|
|
196
|
+
See the [examples directory](examples/) for complete working examples using the
|
|
197
|
+
Codex Fork configuration.
|
|
198
|
+
|
|
106
199
|
### Required Environment Variables
|
|
107
200
|
|
|
108
201
|
When using the Codex Fork configuration:
|