diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2764796 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM node:20-alpine AS builder + +# Create app directory +WORKDIR /app + +# Copy package.json and package-lock.json +COPY package*.json ./ + +# Install dependencies, ignoring any prepare scripts +RUN npm install --ignore-scripts + +# Copy the rest of the application code +COPY src ./src/ +COPY tsconfig.json ./ + +# Build the application +RUN npm run build + +# 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 + +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 5f5f209..f10d306 100644 --- a/README.md +++ b/README.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) [![中文文档](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) @@ -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 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 new file mode 100644 index 0000000..5f83a2e --- /dev/null +++ b/smithery.yaml @@ -0,0 +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). 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