mcp-server-markview 1.2.5 → 1.2.7

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 CHANGED
@@ -29,37 +29,27 @@ The binary is downloaded automatically during installation. If the download fail
29
29
 
30
30
  ## Claude Code Configuration
31
31
 
32
- Add to your Claude Code MCP config (usually `~/.claude/mcp.json` or via `claude mcp add`):
32
+ The easiest way run once in your terminal:
33
33
 
34
- ```json
35
- {
36
- "mcpServers": {
37
- "markview": {
38
- "command": "npx",
39
- "args": ["-y", "mcp-server-markview"]
40
- }
41
- }
42
- }
34
+ ```bash
35
+ claude mcp add --transport stdio --scope user markview -- npx mcp-server-markview
43
36
  ```
44
37
 
45
- Or if you have installed it globally:
38
+ This writes to `~/.claude.json` (user scope — works across all projects). Restart Claude Code after adding.
39
+
40
+ Or add manually to `~/.claude.json` (permissions go in settings.json — MCP config goes here):
46
41
 
47
42
  ```json
48
43
  {
49
44
  "mcpServers": {
50
45
  "markview": {
51
- "command": "mcp-server-markview"
46
+ "command": "npx",
47
+ "args": ["mcp-server-markview"]
52
48
  }
53
49
  }
54
50
  }
55
51
  ```
56
52
 
57
- ### Using `claude mcp add`
58
-
59
- ```bash
60
- claude mcp add markview -- npx -y mcp-server-markview
61
- ```
62
-
63
53
  ## Available Tools
64
54
 
65
55
  ### `preview_markdown`
Binary file
package/index.js ADDED
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * index.js — Smithery capability scanning entry point.
4
+ *
5
+ * Two modes:
6
+ * 1. Imported by Smithery: exports createSandboxServer() — returns a mock MCP
7
+ * server with tool definitions. No binary spawned, works on any platform.
8
+ * 2. Run directly (main): proxies to the native MarkView MCP binary via stdio.
9
+ */
10
+ "use strict";
11
+
12
+ const { Server } = require("@modelcontextprotocol/sdk/server/index.js");
13
+ const {
14
+ ListToolsRequestSchema,
15
+ } = require("@modelcontextprotocol/sdk/types.js");
16
+
17
+ const VERSION = "1.2.7";
18
+
19
+ const TOOLS = [
20
+ {
21
+ name: "preview_markdown",
22
+ description:
23
+ "Render a markdown string in MarkView's native macOS preview window. " +
24
+ "Supports GFM, Mermaid diagrams, code syntax highlighting (Prism.js), " +
25
+ "tables, task lists, and all CommonMark extensions.",
26
+ inputSchema: {
27
+ type: "object",
28
+ properties: {
29
+ content: {
30
+ type: "string",
31
+ description: "Markdown source text to preview",
32
+ },
33
+ title: { type: "string", description: "Optional window title" },
34
+ },
35
+ required: ["content"],
36
+ },
37
+ },
38
+ {
39
+ name: "open_file",
40
+ description:
41
+ "Open an existing markdown file from disk in MarkView. " +
42
+ "The file must exist and have a markdown extension (.md, .markdown).",
43
+ inputSchema: {
44
+ type: "object",
45
+ properties: {
46
+ path: { type: "string", description: "Absolute path to the .md file" },
47
+ },
48
+ required: ["path"],
49
+ },
50
+ },
51
+ ];
52
+
53
+ /**
54
+ * Sandbox server for Smithery capability scanning.
55
+ * Returns a mock MCP server that responds to tools/list without spawning the Swift binary.
56
+ */
57
+ function createSandboxServer() {
58
+ const server = new Server(
59
+ { name: "markview", version: VERSION },
60
+ { capabilities: { tools: {} } },
61
+ );
62
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({
63
+ tools: TOOLS,
64
+ }));
65
+ return server;
66
+ }
67
+
68
+ module.exports = { createSandboxServer };
69
+ module.exports.default = createSandboxServer;
70
+
71
+ // Stdio entrypoint — only spawns the native binary when run directly.
72
+ if (require.main === module) {
73
+ const { spawn } = require("child_process");
74
+ const { resolve } = require("path");
75
+ const binary = resolve(__dirname, "bin/mcp-server-markview");
76
+ const child = spawn(binary, process.argv.slice(2), {
77
+ stdio: "inherit",
78
+ env: process.env,
79
+ });
80
+ child.on("exit", (code) => process.exit(code != null ? code : 0));
81
+ child.on("error", (err) => {
82
+ process.stderr.write("MarkView MCP server error: " + err.message + "\n");
83
+ process.exit(1);
84
+ });
85
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-server-markview",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "MCP server for MarkView — preview Markdown files in a native macOS viewer",
5
5
  "license": "MIT",
6
6
  "author": "Paul Kang <contact@paulkang.dev>",
@@ -13,6 +13,7 @@
13
13
  "bugs": {
14
14
  "url": "https://github.com/paulhkang94/markview/issues"
15
15
  },
16
+ "main": "index.js",
16
17
  "bin": {
17
18
  "mcp-server-markview": "bin/mcp-server-markview"
18
19
  },
@@ -21,6 +22,7 @@
21
22
  "postinstall": "node scripts/postinstall.js"
22
23
  },
23
24
  "files": [
25
+ "index.js",
24
26
  "bin/",
25
27
  "scripts/",
26
28
  "README.md"
@@ -38,11 +40,7 @@
38
40
  "engines": {
39
41
  "node": ">=18.0.0"
40
42
  },
41
- "os": [
42
- "darwin"
43
- ],
44
- "cpu": [
45
- "arm64",
46
- "x64"
47
- ]
43
+ "dependencies": {
44
+ "@modelcontextprotocol/sdk": "^1.27.1"
45
+ }
48
46
  }
@@ -22,9 +22,12 @@ const { execFileSync } = require("child_process");
22
22
 
23
23
  const GITHUB_OWNER = "paulhkang94";
24
24
  const GITHUB_REPO = "markview";
25
- const VERSION = "1.2.5";
26
- const ARCHIVE_NAME = `MarkView-${VERSION}.tar.gz`;
27
- const DOWNLOAD_URL = `https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}/releases/download/v${VERSION}/${ARCHIVE_NAME}`;
25
+ // BINARY_VERSION pins the macOS app release to download.
26
+ // This is intentionally decoupled from the npm package version —
27
+ // npm patches (JS-only changes) don't require a new macOS binary release.
28
+ const BINARY_VERSION = "1.2.6";
29
+ const ARCHIVE_NAME = `MarkView-${BINARY_VERSION}.tar.gz`;
30
+ const DOWNLOAD_URL = `https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}/releases/download/v${BINARY_VERSION}/${ARCHIVE_NAME}`;
28
31
 
29
32
  // Path inside the tar.gz where the MCP server binary lives
30
33
  const BINARY_IN_ARCHIVE = `MarkView.app/Contents/MacOS/markview-mcp-server`;
@@ -148,7 +151,9 @@ async function main() {
148
151
  const archivePath = path.join(tmpDir, ARCHIVE_NAME);
149
152
 
150
153
  try {
151
- console.log(`[mcp-server-markview] Downloading MarkView v${VERSION}...`);
154
+ console.log(
155
+ `[mcp-server-markview] Downloading MarkView v${BINARY_VERSION}...`,
156
+ );
152
157
  console.log(` ${DOWNLOAD_URL}`);
153
158
 
154
159
  await downloadFile(DOWNLOAD_URL, archivePath);