Skip to main content
Glama

MySQL MCP Server

MIT License
1
1
  • Apple
  • Linux
config.ts949 B
import dotenv from 'dotenv'; import { MySQLConfig } from './types.js'; // 加载环境变量 dotenv.config(); export function getConfig(): MySQLConfig { return { host: process.env.MYSQL_HOST || 'localhost', port: parseInt(process.env.MYSQL_PORT || '3306'), user: process.env.MYSQL_USER || 'root', password: process.env.MYSQL_PASSWORD || '', database: process.env.MYSQL_DATABASE, connectionLimit: parseInt(process.env.MYSQL_CONNECTION_LIMIT || '10'), timeout: parseInt(process.env.MYSQL_TIMEOUT || '60000') }; } export function validateConfig(config: MySQLConfig): void { if (!config.host) { throw new Error('MySQL host is required'); } if (!config.user) { throw new Error('MySQL user is required'); } if (!config.password) { throw new Error('MySQL password is required'); } if (config.port < 1 || config.port > 65535) { throw new Error('MySQL port must be between 1 and 65535'); } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pickstar-2002/mysql-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server