@mcpc-tech/cli 0.1.1-beta.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/LICENSE +21 -0
- package/README.md +98 -0
- package/package.json +33 -0
- package/src/bin.mjs +3096 -0
- package/types/mod.d.ts +4 -0
- package/types/mod.d.ts.map +1 -0
- package/types/src/app.d.ts +6 -0
- package/types/src/app.d.ts.map +1 -0
- package/types/src/bin.d.ts +1 -0
- package/types/src/bin.d.ts.map +1 -0
- package/types/src/server.d.ts +1 -0
- package/types/src/server.d.ts.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 mcpc.tech
|
|
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 all
|
|
13
|
+
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 THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# MCPC CLI
|
|
2
|
+
|
|
3
|
+
CLI server for MCPC with configuration support.
|
|
4
|
+
|
|
5
|
+
## Configuration
|
|
6
|
+
|
|
7
|
+
Load configuration using command-line arguments:
|
|
8
|
+
|
|
9
|
+
- `--config <json>` - Inline JSON configuration string
|
|
10
|
+
- `--config-url <url>` - Fetch from URL (e.g., GitHub raw)
|
|
11
|
+
- `--config-file <path>` - Path to configuration file
|
|
12
|
+
- No arguments - Uses `./mcpc.config.json` if available
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
**Inline JSON config:**
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
deno run --allow-all src/bin.ts --config '[{"name":"my-agent","description":"..."}]'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**From URL:**
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
deno run --allow-all src/bin.ts --config-url https://example.com/config.json
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**From file:**
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
deno run --allow-all src/bin.ts --config-file ./my-config.json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Default (uses ./mcpc.config.json):**
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
deno run --allow-all src/bin.ts
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Environment variable substitution:**
|
|
41
|
+
|
|
42
|
+
Config files support `$ENV_VAR_NAME` syntax:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"agents": [{
|
|
47
|
+
"deps": {
|
|
48
|
+
"mcpServers": {
|
|
49
|
+
"github": {
|
|
50
|
+
"headers": {
|
|
51
|
+
"Authorization": "Bearer $GITHUB_PERSONAL_ACCESS_TOKEN"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}]
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**HTTP server:**
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
deno run --allow-all src/server.ts --config-file ./my-config.json
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Examples
|
|
67
|
+
|
|
68
|
+
### Required Environment Variables
|
|
69
|
+
|
|
70
|
+
When using the Codex Fork configuration:
|
|
71
|
+
|
|
72
|
+
- `GITHUB_PERSONAL_ACCESS_TOKEN` - GitHub Personal Access Token for GitHub MCP
|
|
73
|
+
server
|
|
74
|
+
|
|
75
|
+
Run the example scripts to see different usage patterns:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# P
|
|
79
|
+
export GITHUB_PERSONAL_ACCESS_TOKEN="github_pat_your_token"
|
|
80
|
+
|
|
81
|
+
# Example 1: Inline configuration
|
|
82
|
+
./examples/01-env-var.sh
|
|
83
|
+
|
|
84
|
+
# Example 2: Environment variable substitution
|
|
85
|
+
./examples/02-env-substitution.sh
|
|
86
|
+
|
|
87
|
+
# Example 3: Configuration from file
|
|
88
|
+
./examples/03-config-file.sh
|
|
89
|
+
|
|
90
|
+
# Example 4: HTTP server
|
|
91
|
+
./examples/04-http-server.sh
|
|
92
|
+
|
|
93
|
+
# Example 5: Remote URL config
|
|
94
|
+
./examples/05-url-config.sh
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
All examples use the same [codex-fork.json](examples/configs/codex-fork.json)
|
|
98
|
+
configuration.
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mcpc-tech/cli",
|
|
3
|
+
"version": "0.1.1-beta.1",
|
|
4
|
+
"homepage": "https://jsr.io/@mcpc/cli",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./types/*": "./types/*",
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./src/bin.mjs",
|
|
10
|
+
"types": "./types/src/bin.d.ts"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@modelcontextprotocol/sdk": "^1.8.0",
|
|
15
|
+
"@hono/zod-openapi": "^0.19.2",
|
|
16
|
+
"zod": "^3.24.2",
|
|
17
|
+
"jsonrepair": "^3.13.0",
|
|
18
|
+
"ai": "^4.3.4",
|
|
19
|
+
"json-schema-traverse": "^1.0.0",
|
|
20
|
+
"cheerio": "^1.0.0",
|
|
21
|
+
"ajv": "^8.17.1",
|
|
22
|
+
"@segment/ajv-human-errors": "^2.15.0",
|
|
23
|
+
"ajv-formats": "^3.0.1"
|
|
24
|
+
},
|
|
25
|
+
"main": "./src/bin.mjs",
|
|
26
|
+
"types": "./types/src/bin.d.ts",
|
|
27
|
+
"bin": {
|
|
28
|
+
"mcpc": "./src/bin.mjs"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"start": "node src/bin.mjs"
|
|
32
|
+
}
|
|
33
|
+
}
|