Content
---
# Dameng Database MCP Service
## Project Introduction
This project is an MCP (Microservice Communication Protocol) service based on Dameng Database, providing the following functionalities:
- **List tables in the database**: Use the `list_tables` tool to list all tables in the specified database.
- **Execute read-only SQL queries**: Use the `execute_query` tool to perform read-only SQL queries (only supports `SELECT`, `SHOW`, `DESCRIBE`, and `EXPLAIN` statements).
- **Display table structure**: Use the `describe_table` tool to show the structure of a specified table.
## Usage
On Windows, you can directly download the dm-mcp-server binary file and add it to your PATH.
### Install using go install
```bash
go install github.com/wangzhaobo168/dm-mcp-server
```
### Dameng MCP Server Configuration Example:
```
{
"mcpServers": {
"db-mcp-server": {
"command": "dm-mcp-server",
"args": [
],
"env": {
"DM_PORT": "Port number, default is 5236",
"DM_HOST": "Host address",
"DM_USERNAME": "Username",
"DM_PASSWORD": "Password",
"DM_SCHEMA": "Schema name"
}
}
}
}
```
## Check dm-mcp-server Version:
```bash
dm-mcp-server --version
```
## Quick Start
### 1. Environment Requirements
- **Go Version**: 1.16 or higher.
- **Dameng Database**: Dameng Database must be installed and configured.
- **Dependency Library**: Ensure that the `github.com/mark3labs/mcp-go` library is installed.
### 2. Install Dependencies
Run the following commands in the project root directory to initialize Go Modules and download dependencies:
```bash
go mod init dm-mcp-server
go mod tidy
```
### 3. Configure Database Connection
Before running the service, you need to configure the connection information for the Dameng Database. This can be set in the following ways:
- **Command Line Arguments**: Specify via command line arguments when starting the service.
- **Environment Variables**: Set through environment variables.
#### Command Line Arguments
```bash
go run main.go \
-username <username> \
-password <password> \
-host <host address> \
-port <port> \
-schema <schema name>
```
## Project Structure
```
dm-mcp-server/
├── main.go # Main program entry
├── tools/ # Tool implementations
│ ├── list_tables.go # List tables tool
│ ├── execute_query.go # Execute query tool
│ └── describe_table.go # Describe table structure tool
├── utils/ # Utility functions
│ ├── config.go # Configuration management
│ └── db.go # Database connection
├── go.mod # Go Modules file
└── README.md # Project documentation
```
## Contribution Guidelines
Contributions are welcome! Please submit Issues and Pull Requests to improve this project. Ensure consistent code style and pass tests.
## License
This project is licensed under the [MIT License](LICENSE).
---
### Additional Notes
- If the `github.com/mark3labs/mcp-go` library is unavailable, please replace it with another compatible MCP implementation.
- If you need to support more database operations, you can add new tools in the `tools` package.
---
You Might Also Like
MarkItDown MCP
markitdown-mcp is a lightweight MCP server for converting various URIs to Markdown.
Github
GitHub MCP Server connects AI tools to GitHub for code management and automation.

apisix
Apache APISIX is an API Gateway for managing APIs and microservices.
opik
Opik is a powerful tool for managing and optimizing machine learning experiments.

MCP Toolbox for Databases
MCP Toolbox for Databases is an open-source server simplifying database tool...

sqlglot
SQLGlot is a no-dependency SQL parser and transpiler supporting 30 dialects.