@mcpjam/cli 1.0.2 → 1.0.3
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 +42 -0
- package/README.md +40 -9
- package/dist/index.js +6339 -1038
- package/dist/index.js.map +1 -1
- package/package.json +9 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
The MCPJam Enterprise Edition (EE) license (the "EE License")
|
|
2
|
+
Copyright (c) 2025-present MCPJam Inc
|
|
3
|
+
|
|
4
|
+
With regard to the MCPJam Software:
|
|
5
|
+
|
|
6
|
+
This software and associated documentation files (the "Software") may only be
|
|
7
|
+
used in production, if you (and any entity that you represent) have agreed to,
|
|
8
|
+
and are in compliance with, the MCPJam Subscription Terms available
|
|
9
|
+
at https://mcpjam.com/legal/terms (the "EE Terms"), or other agreements governing
|
|
10
|
+
the use of the Software, as mutually agreed by you and MCPJam Inc ("MCPJam"),
|
|
11
|
+
and otherwise have a valid MCPJam Enterprise Edition subscription ("EE Subscription")
|
|
12
|
+
for the correct number of MCP server evaluations as defined in the EE Terms ("Evaluations"). Subject to the foregoing sentence,
|
|
13
|
+
you are free to modify this Software and publish patches to the Software. You agree
|
|
14
|
+
that MCPJam and/or its licensors (as applicable) retain all right, title and interest in
|
|
15
|
+
and to all such modifications and/or patches, and all such modifications and/or
|
|
16
|
+
patches may only be used, copied, modified, displayed, distributed, or otherwise
|
|
17
|
+
exploited with a valid EE Subscription for the correct number of evaluations.
|
|
18
|
+
Notwithstanding the foregoing, you may copy and modify the Software for development
|
|
19
|
+
and testing purposes, without requiring a subscription. You agree that MCPJam and/or
|
|
20
|
+
its licensors (as applicable) retain all right, title and interest in and to all such
|
|
21
|
+
modifications. You are not granted any other rights beyond what is expressly stated herein.
|
|
22
|
+
Subject to the foregoing, it is forbidden to copy, merge, publish, distribute, sublicense,
|
|
23
|
+
and/or sell the Software.
|
|
24
|
+
|
|
25
|
+
This EE License applies only to the part of this Software that is not distributed under
|
|
26
|
+
the Apache license. Any part of this Software distributed under the Apache license or which
|
|
27
|
+
is served client-side as an image, font, cascading stylesheet (CSS), file which produces
|
|
28
|
+
or is compiled, arranged, augmented, or combined into client-side JavaScript, in whole or
|
|
29
|
+
in part, is copyrighted under the Apache license. The full text of this EE License shall
|
|
30
|
+
be included in all copies or substantial portions of the Software.
|
|
31
|
+
|
|
32
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
33
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
34
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
35
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
36
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
37
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
38
|
+
SOFTWARE.
|
|
39
|
+
|
|
40
|
+
For all third party components incorporated into the MCPJam Software, those
|
|
41
|
+
components are licensed under the original license provided by the owner of the
|
|
42
|
+
applicable component.
|
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ The CLI includes example configuration files in the `examples/` directory:
|
|
|
64
64
|
|
|
65
65
|
```json
|
|
66
66
|
{
|
|
67
|
-
"
|
|
67
|
+
"servers": {
|
|
68
68
|
"weather-server": {
|
|
69
69
|
"command": "python",
|
|
70
70
|
"args": ["weather_server.py"],
|
|
@@ -73,16 +73,13 @@ The CLI includes example configuration files in the `examples/` directory:
|
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
"api-server": {
|
|
76
|
-
"url": "https://api.example.com/mcp",
|
|
77
|
-
"
|
|
78
|
-
"
|
|
76
|
+
"url": "https://api.example.com/mcp/sse",
|
|
77
|
+
"requestInit": {
|
|
78
|
+
"headers": {
|
|
79
|
+
"Authorization": "Bearer ${API_TOKEN}"
|
|
80
|
+
}
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
|
-
},
|
|
82
|
-
"providerApiKeys": {
|
|
83
|
-
"anthropic": "${ANTHROPIC_API_KEY}",
|
|
84
|
-
"openai": "${OPENAI_API_KEY}",
|
|
85
|
-
"deepseek": "${DEEPSEEK_API_KEY}"
|
|
86
83
|
}
|
|
87
84
|
}
|
|
88
85
|
```
|
|
@@ -129,3 +126,37 @@ Results: 2 passed, 1 failed (2.0s total)
|
|
|
129
126
|
|
|
130
127
|
- **STDIO**: Local processes with command + args
|
|
131
128
|
- **HTTP**: Remote servers with URL + headers authentication
|
|
129
|
+
|
|
130
|
+
### Programmatic (TypeScript) configuration example for HTTP/SSE
|
|
131
|
+
|
|
132
|
+
When using SSE endpoints that require custom headers (e.g., Authorization), you must provide `eventSourceInit` so the SSE connection includes those headers. If you use a JSON environment file with `requestInit.headers`, the CLI will automatically inject an `eventSourceInit.fetch` wrapper for you.
|
|
133
|
+
|
|
134
|
+
```ts
|
|
135
|
+
import { MCPClient } from "@mastra/mcp";
|
|
136
|
+
|
|
137
|
+
const client = new MCPClient({
|
|
138
|
+
id: "example",
|
|
139
|
+
servers: {
|
|
140
|
+
exampleServer: {
|
|
141
|
+
url: new URL("https://your-mcp-server.com/sse"),
|
|
142
|
+
// Note: requestInit alone isn't enough for SSE
|
|
143
|
+
requestInit: {
|
|
144
|
+
headers: {
|
|
145
|
+
Authorization: "Bearer your-token",
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
// For programmatic usage, add eventSourceInit when using custom headers
|
|
149
|
+
eventSourceInit: {
|
|
150
|
+
fetch(input: Request | URL | string, init?: RequestInit) {
|
|
151
|
+
const headers = new Headers(init?.headers || {});
|
|
152
|
+
headers.set("Authorization", "Bearer your-token");
|
|
153
|
+
return fetch(input as any, {
|
|
154
|
+
...init,
|
|
155
|
+
headers,
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
```
|