@schemacast/mcp 0.5.0 → 0.5.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/README.md +38 -17
- package/dist/main.js +3 -0
- package/dist/startup.d.ts +11 -0
- package/dist/startup.js +15 -0
- package/dist/ui.html +28 -28
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,41 +4,39 @@ Stdio MCP server with a `visualize_json` tool and a bundled MCP Apps UI.
|
|
|
4
4
|
|
|
5
5
|
**0.x — API may change.**
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Run with npx
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Prefer pinning a version so hosts stay reproducible:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
|
|
12
|
+
npx -y @schemacast/mcp@0.5.1
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## Library usage
|
|
18
|
-
|
|
19
|
-
```ts
|
|
20
|
-
import { registerAutoVisualTool } from '@schemacast/mcp';
|
|
15
|
+
(`npx -y @schemacast/mcp` also works and tracks latest.)
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
```
|
|
17
|
+
On start the process prints one stderr line, for example `schemacast-mcp 0.5.1 ready (stdio)`, and never writes to stdout (stdout is reserved for MCP stdio).
|
|
24
18
|
|
|
25
19
|
## Host configuration
|
|
26
20
|
|
|
27
|
-
Replace the path with the absolute location of `dist/main.js` on your machine.
|
|
28
|
-
|
|
29
21
|
Claude Desktop and Cursor (`mcpServers`):
|
|
30
22
|
|
|
31
23
|
```json
|
|
32
24
|
{
|
|
33
25
|
"mcpServers": {
|
|
34
26
|
"schemacast": {
|
|
35
|
-
"command": "
|
|
36
|
-
"args": ["
|
|
27
|
+
"command": "npx",
|
|
28
|
+
"args": ["-y", "@schemacast/mcp@0.5.1"]
|
|
37
29
|
}
|
|
38
30
|
}
|
|
39
31
|
}
|
|
40
32
|
```
|
|
41
33
|
|
|
34
|
+
Claude Code:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
claude mcp add schemacast -- npx -y @schemacast/mcp@0.5.1
|
|
38
|
+
```
|
|
39
|
+
|
|
42
40
|
VS Code (`.vscode/mcp.json`):
|
|
43
41
|
|
|
44
42
|
```json
|
|
@@ -46,11 +44,34 @@ VS Code (`.vscode/mcp.json`):
|
|
|
46
44
|
"servers": {
|
|
47
45
|
"schemacast": {
|
|
48
46
|
"type": "stdio",
|
|
49
|
-
"command": "
|
|
50
|
-
"args": ["
|
|
47
|
+
"command": "npx",
|
|
48
|
+
"args": ["-y", "@schemacast/mcp@0.5.1"]
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
52
|
```
|
|
55
53
|
|
|
56
54
|
After updating, restart the host (Claude Desktop) or start a new request (Cursor/VS Code).
|
|
55
|
+
|
|
56
|
+
### From a clone
|
|
57
|
+
|
|
58
|
+
Build locally, then point the host at the built entry:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pnpm --filter @schemacast/mcp build
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"command": "node",
|
|
67
|
+
"args": ["/absolute/path/to/schemacast/packages/mcp/dist/main.js"]
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Library usage
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
import { registerAutoVisualTool } from '@schemacast/mcp';
|
|
75
|
+
|
|
76
|
+
registerAutoVisualTool(server, 'existing_report', existingToolConfig, existingHandler);
|
|
77
|
+
```
|
package/dist/main.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { PACKAGE_VERSION } from './package-version.js';
|
|
4
5
|
import { createMcpServer } from './server.js';
|
|
6
|
+
import { writeMcpReadyLine } from './startup.js';
|
|
5
7
|
async function main() {
|
|
6
8
|
const uiResourceHtml = await readFile(new URL('./ui.html', import.meta.url), 'utf8');
|
|
7
9
|
const server = createMcpServer(uiResourceHtml);
|
|
8
10
|
await server.connect(new StdioServerTransport());
|
|
11
|
+
writeMcpReadyLine(PACKAGE_VERSION);
|
|
9
12
|
}
|
|
10
13
|
main().catch((error) => {
|
|
11
14
|
console.error(error);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stderr-only startup notice so hosts can see the server is up without touching the MCP stdio stream.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* writeMcpReadyLine('0.5.1');
|
|
7
|
+
* // stderr: schemacast-mcp 0.5.1 ready (stdio)
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
export declare function writeMcpReadyLine(version: string, write?: (chunk: string) => void): void;
|
|
11
|
+
//# sourceMappingURL=startup.d.ts.map
|
package/dist/startup.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stderr-only startup notice so hosts can see the server is up without touching the MCP stdio stream.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* writeMcpReadyLine('0.5.1');
|
|
7
|
+
* // stderr: schemacast-mcp 0.5.1 ready (stdio)
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
export function writeMcpReadyLine(version, write = (chunk) => {
|
|
11
|
+
process.stderr.write(chunk);
|
|
12
|
+
}) {
|
|
13
|
+
write(`schemacast-mcp ${version} ready (stdio)\n`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=startup.js.map
|