@rolandohuber/mysql-mcp-server
Version:
A comprehensive MCP server for MySQL database operations with 16 tools, multi-transport support, and intelligent test data generation
22 lines (19 loc) • 618 B
text/typescript
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { MysqlService } from '../services/MysqlService.js';
export const listDatabasesSchema: Tool = {
name: 'mysql_listDatabases',
description: 'Lists all databases accessible to the current MySQL user',
inputSchema: {
type: 'object',
properties: {},
required: [],
},
};
export async function listDatabasesHandler(mysqlService: MysqlService): Promise<string[]> {
try {
const databases = await mysqlService.listDatabases();
return databases;
} catch (error) {
throw new Error(`Failed to list databases: ${error}`);
}
}