Content
# MariaDB Reader MCP Server
This project is a Model Context Protocol (MCP) server for exploring and interacting with MariaDB databases. This server provides tools for AI assistants like Cline to access and query information from MariaDB databases.
## Features
This MCP server provides the following tools:
* **`list_databases`**: Returns a list of all accessible databases.
* **`list_tables`**: Returns a list of all tables within the specified database.
* Input: `database` (string, required) - The name of the database to query the table list from.
* **`get_table_schema`**: Returns the schema (column definitions) of the specified table.
* Input:
* `database` (string, required) - The name of the database the table belongs to.
* `table` (string, required) - The name of the table to query the schema for.
* **`query_table`**: Queries data from the specified table. By default, it returns the first 100 rows.
* Input:
* `database` (string, required) - The name of the database the table belongs to.
* `table` (string, required) - The name of the table to query data from.
* `limit` (number, optional) - The maximum number of rows to return (default: 100).
## Setup
To use this server, you need to clone the GitHub repository and register the server information in the MCP client (e.g., VS Code extension) configuration file. This repository includes a pre-built executable (`build/index.js`), so no separate build process is required.
1. **Clone the repository:** Clone this repository to your desired location.
```bash
git clone https://github.com/moosin76/mcp_server_mariadb_reader.git
```
2. **Modify the MCP configuration file:**
**Configuration Example:**
```json
{
"mcpServers": {
"mcp_server_mariadb_reader": {
"command": "node",
"args": ["<cloned_repository_path>/build/index.js"], // Path to the build/index.js file in the cloned repository
"env": {
"MARIADB_HOST": "YOUR_DB_HOST", // MariaDB host address
"MARIADB_PORT": "YOUR_DB_PORT", // MariaDB port number (e.g., "3306")
"MARIADB_USER": "YOUR_DB_USER", // MariaDB username
"MARIADB_PASSWORD": "YOUR_DB_PASSWORD", // MariaDB password
"MARIADB_DATABASE": "YOUR_DEFAULT_DB" // (optional) Default database name
},
"disabled": false,
"autoApprove": []
}
// Other MCP server configurations...
}
}
```
**Note:**
* You need to change the `<cloned_repository_path>` part to the actual local path where you cloned the repository. (e.g., `C:/Users/YourUser/Documents/GitHub/mcp_server_mariadb_reader`)
* The MariaDB connection information in the `env` object should be modified to match your actual environment.
## Development (when modifying source code)
Since this repository includes built files, you do not need to perform the steps below to use the server. If you want to modify the source code (`src` directory) and apply changes, follow these steps.
1. **Install dependencies (once or when `package.json` changes):**
```bash
npm install
```
2. **Build after modifications:**
```bash
npm run build
```
* This command compiles the TypeScript code in the `src` directory into JavaScript code in the `build` directory.
3. **(Optional) Detect changes during development and auto-build:**
```bash
npm run watch
```
## License
This project is distributed under the [insert license information] license.
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
markitdown
Python tool for converting files and office documents to Markdown.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
OmniRoute
Never stop coding. The free AI gateway — one endpoint, 160+ providers, zero...
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.