Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:

Expand Down
54 changes: 54 additions & 0 deletions smithery.yaml
Original file line number Diff line number Diff line change
@@ -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