From c462de105ad84360c67dfc347acb55399d12fd89 Mon Sep 17 00:00:00 2001 From: "smithery-ai[bot]" <194235850+smithery-ai[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 16:21:07 +0000 Subject: [PATCH 1/4] Add Dockerfile --- Dockerfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9ec6f04 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile +FROM node:lts-alpine AS builder +WORKDIR /app +COPY package.json package-lock.json . +RUN npm install --ignore-scripts +COPY . . +RUN npm run build + +FROM node:lts-alpine AS runner +WORKDIR /app +COPY --from=builder /app/build ./build +COPY --from=builder /app/package.json ./package.json +# We need dependencies at runtime for MCP server and markmap-cli +RUN npm install --production --ignore-scripts --no-bin-links + +ENTRYPOINT ["node", "build/index.js"] From 3776f4001d1344a5263d8c8d7c29f76a17423f97 Mon Sep 17 00:00:00 2001 From: "smithery-ai[bot]" <194235850+smithery-ai[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 16:21:08 +0000 Subject: [PATCH 2/4] Add Smithery configuration --- smithery.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 smithery.yaml diff --git a/smithery.yaml b/smithery.yaml new file mode 100644 index 0000000..5b42eea --- /dev/null +++ b/smithery.yaml @@ -0,0 +1,30 @@ +# Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml + +startCommand: + type: stdio + configSchema: + # JSON Schema defining the configuration options for the MCP. + type: object + required: [] + properties: + output: + type: string + description: Output directory for mind map HTML files (optional) + open: + type: boolean + default: false + description: Whether to open the generated mind map in a browser + commandFunction: + # A JS function that produces the CLI command based on the given config to start the MCP on stdio. + |- + (config) => ({ + command: 'node', + args: [ + 'build/index.js', + ...(config.output ? ['--output', config.output] : []), + ...(config.open ? ['--open'] : []) + ] + }) + exampleConfig: + output: /tmp/markmap + open: false From 4a234daa5100f19307f04dc561d50eaa287a0689 Mon Sep 17 00:00:00 2001 From: "smithery-ai[bot]" <194235850+smithery-ai[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 16:21:09 +0000 Subject: [PATCH 3/4] Update README --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 5f5f209..f3a84f4 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![GitHub License](https://img.shields.io/github/license/jinzcdev/markmap-mcp-server.svg)](LICENSE) [![中文文档](https://img.shields.io/badge/中文文档-点击查看-blue)](README_zh-CN.md) [![Stars](https://img.shields.io/github/stars/jinzcdev/markmap-mcp-server)](https://github.com/jinzcdev/markmap-mcp-server) +[![smithery badge](https://smithery.ai/badge/@jinzcdev/markmap-mcp-server)](https://smithery.ai/server/@jinzcdev/markmap-mcp-server) Markmap MCP Server is based on the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) that allows one-click conversion of Markdown text to interactive mind maps, built on the open source project [markmap](https://github.com/markmap/markmap). The generated mind maps support rich interactive operations and can be exported in various image formats. @@ -23,6 +24,14 @@ Markmap MCP Server is based on the [Model Context Protocol (MCP)](https://modelc ## Installation +### Installing via Smithery + +To install Markmap MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@jinzcdev/markmap-mcp-server): + +```bash +npx -y @smithery/cli install @jinzcdev/markmap-mcp-server --client claude +``` + ### Manual Installation ```bash From a77213d1068d8e432e77983991f4e0395a337a64 Mon Sep 17 00:00:00 2001 From: jinzcdev Date: Tue, 6 May 2025 15:24:45 +0800 Subject: [PATCH 4/4] chore: update Dockerfile & smithery configuration --- Dockerfile | 35 +++++++++++++++++++++++++++-------- README.md | 2 +- README_zh-CN.md | 1 + smithery.yaml | 48 +++++++++++++++++++++--------------------------- 4 files changed, 50 insertions(+), 36 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9ec6f04..2764796 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,35 @@ -# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile -FROM node:lts-alpine AS builder +FROM node:20-alpine AS builder + +# Create app directory WORKDIR /app -COPY package.json package-lock.json . + +# Copy package.json and package-lock.json +COPY package*.json ./ + +# Install dependencies, ignoring any prepare scripts RUN npm install --ignore-scripts -COPY . . + +# Copy the rest of the application code +COPY src ./src/ +COPY tsconfig.json ./ + +# Build the application RUN npm run build -FROM node:lts-alpine AS runner +# Use Node.js 20 Alpine as the base image for the runtime stage +FROM node:20-alpine AS runner + +# Set the working directory for the runtime stage WORKDIR /app + +# Copy the built application and dependencies from the builder stage +COPY --from=builder /app/package*.json ./ COPY --from=builder /app/build ./build -COPY --from=builder /app/package.json ./package.json -# We need dependencies at runtime for MCP server and markmap-cli -RUN npm install --production --ignore-scripts --no-bin-links +RUN npm install --ignore-scripts --omit=dev + +# Define environment variable for markmap data directory +ENV MARKMAP_DIR=/data/markmap + +# Define the command to run when the container starts ENTRYPOINT ["node", "build/index.js"] diff --git a/README.md b/README.md index f3a84f4..f10d306 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ [![NPM Version](https://img.shields.io/npm/v/@jinzcdev/markmap-mcp-server.svg)](https://www.npmjs.com/package/@jinzcdev/markmap-mcp-server) [![GitHub License](https://img.shields.io/github/license/jinzcdev/markmap-mcp-server.svg)](LICENSE) +[![Smithery Badge](https://smithery.ai/badge/@jinzcdev/markmap-mcp-server)](https://smithery.ai/server/@jinzcdev/markmap-mcp-server) [![中文文档](https://img.shields.io/badge/中文文档-点击查看-blue)](README_zh-CN.md) [![Stars](https://img.shields.io/github/stars/jinzcdev/markmap-mcp-server)](https://github.com/jinzcdev/markmap-mcp-server) -[![smithery badge](https://smithery.ai/badge/@jinzcdev/markmap-mcp-server)](https://smithery.ai/server/@jinzcdev/markmap-mcp-server) Markmap MCP Server is based on the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) that allows one-click conversion of Markdown text to interactive mind maps, built on the open source project [markmap](https://github.com/markmap/markmap). The generated mind maps support rich interactive operations and can be exported in various image formats. diff --git a/README_zh-CN.md b/README_zh-CN.md index 9445890..bedf189 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -4,6 +4,7 @@ [![NPM Version](https://img.shields.io/npm/v/@jinzcdev/markmap-mcp-server.svg)](https://www.npmjs.com/package/@jinzcdev/markmap-mcp-server) [![GitHub License](https://img.shields.io/github/license/jinzcdev/markmap-mcp-server.svg)](LICENSE) +[![Smithery Badge](https://smithery.ai/badge/@jinzcdev/markmap-mcp-server)](https://smithery.ai/server/@jinzcdev/markmap-mcp-server) [![English Doc](https://img.shields.io/badge/English-Click-blue)](README.md) [![Stars](https://img.shields.io/github/stars/jinzcdev/markmap-mcp-server)](https://github.com/jinzcdev/markmap-mcp-server) diff --git a/smithery.yaml b/smithery.yaml index 5b42eea..5f83a2e 100644 --- a/smithery.yaml +++ b/smithery.yaml @@ -1,30 +1,24 @@ # Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml startCommand: - type: stdio - configSchema: - # JSON Schema defining the configuration options for the MCP. - type: object - required: [] - properties: - output: - type: string - description: Output directory for mind map HTML files (optional) - open: - type: boolean - default: false - description: Whether to open the generated mind map in a browser - commandFunction: - # A JS function that produces the CLI command based on the given config to start the MCP on stdio. - |- - (config) => ({ - command: 'node', - args: [ - 'build/index.js', - ...(config.output ? ['--output', config.output] : []), - ...(config.open ? ['--open'] : []) - ] - }) - exampleConfig: - output: /tmp/markmap - open: false + type: stdio + configSchema: + # JSON Schema defining the configuration options for the MCP. + type: object + required: [] + properties: + output: + type: string + description: Output directory for mind map HTML files (optional). If not specified, the default is the system's temporary directory. + commandFunction: + # A JS function that produces the CLI command based on the given config to start the MCP on stdio. + |- + (config) => ({ + command: 'node', + args: [ + 'build/index.js', + ...(config.output ? ['--output', config.output] : []) + ] + }) + exampleConfig: + output: /tmp/markmap