From d4b3f28f5d2b639572da5bb457158a1ba7dfb10f Mon Sep 17 00:00:00 2001 From: "smithery-ai[bot]" <194235850+smithery-ai[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 14:19:53 +0000 Subject: [PATCH 1/3] Add Dockerfile --- Dockerfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..afb68c8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile +FROM node:lts-alpine + +# Create app directory +WORKDIR /usr/src/app + +# Copy package.json and package-lock.json +COPY package*.json ./ + +# Install dependencies without running scripts +RUN npm install --ignore-scripts + +# Copy rest of source code +COPY . . + +# Build the project +RUN npm run build + +# Expose any necessary port (if needed) +# ENV PORT=3000 + +# Define default command +CMD ["node", "build/index.js"] From 7b961e623c0762fcd58fe62301258b7f3d3488f2 Mon Sep 17 00:00:00 2001 From: "smithery-ai[bot]" <194235850+smithery-ai[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 14:19:54 +0000 Subject: [PATCH 2/3] Add Smithery configuration --- smithery.yaml | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 smithery.yaml diff --git a/smithery.yaml b/smithery.yaml new file mode 100644 index 0000000..1265d24 --- /dev/null +++ b/smithery.yaml @@ -0,0 +1,54 @@ +# 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: + - mysqlHost + - mysqlPort + - mysqlUser + - mysqlPassword + - mysqlDatabase + properties: + mysqlHost: + type: string + default: localhost + description: MySQL server hostname + mysqlPort: + type: string + default: "3306" + description: MySQL server port + mysqlUser: + type: string + default: mcp101 + description: MySQL username + mysqlPassword: + type: string + default: 123qwe + description: MySQL password + mysqlDatabase: + type: string + default: mcpdb + description: MySQL database name + 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'], + env: { + MYSQL_HOST: config.mysqlHost, + MYSQL_PORT: config.mysqlPort, + MYSQL_USER: config.mysqlUser, + MYSQL_PASSWORD: config.mysqlPassword, + MYSQL_DATABASE: config.mysqlDatabase + } + }) + exampleConfig: + mysqlHost: localhost + mysqlPort: "3306" + mysqlUser: mcp101 + mysqlPassword: 123qwe + mysqlDatabase: mcpdb From 97a806f44e06229f7f8b741b36ee513da94fa8e9 Mon Sep 17 00:00:00 2001 From: "smithery-ai[bot]" <194235850+smithery-ai[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 14:19:55 +0000 Subject: [PATCH 3/3] Update README --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 8f469ac..42a618f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # MySQL MCP Server +[![smithery badge](https://smithery.ai/badge/@michael7736/mysql-mcp-server)](https://smithery.ai/server/@michael7736/mysql-mcp-server) + This is a Model Context Protocol (MCP) server that provides access to a MySQL database. It allows agent to execute SQL queries against a MySQL database. ## Features @@ -22,6 +24,15 @@ This is a Model Context Protocol (MCP) server that provides access to a MySQL da ## Installation +### Installing via Smithery + +To install mysql-mcp-server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@michael7736/mysql-mcp-server): + +```bash +npx -y @smithery/cli install @michael7736/mysql-mcp-server --client claude +``` + +### Manual Installation 1. Clone or download this repository 2. Install dependencies: