mirror of
https://github.com/executeautomation/mcp-database-server.git
synced 2025-12-09 21:12:57 +08:00
Enhance README with usage options and configuration details for MCP Database Server. Added sections for direct usage, local development setup, and available database tools, along with practical examples and additional documentation links.
This commit is contained in:
107
readme.md
107
readme.md
@@ -20,6 +20,30 @@ npm install
|
||||
npm run build
|
||||
```
|
||||
|
||||
## Usage Options
|
||||
|
||||
There are two ways to use this MCP server with Claude:
|
||||
|
||||
1. **Direct usage**: Install the package globally and use it directly
|
||||
2. **Local development**: Run from your local development environment
|
||||
|
||||
### Direct Usage with NPM Package
|
||||
|
||||
The easiest way to use this MCP server is by installing it globally:
|
||||
|
||||
```bash
|
||||
npm install -g @executeautomation/database-server
|
||||
```
|
||||
|
||||
This allows you to use the server directly without building it locally.
|
||||
|
||||
### Local Development Setup
|
||||
|
||||
If you want to modify the code or run from your local environment:
|
||||
|
||||
1. Clone and build the repository as shown in the Installation section
|
||||
2. Run the server using the commands in the Usage section below
|
||||
|
||||
## Usage
|
||||
|
||||
### SQLite Database
|
||||
@@ -47,24 +71,28 @@ Optional parameters:
|
||||
- `--password`: Password for SQL Server authentication
|
||||
- `--port`: Port number (default: 1433)
|
||||
|
||||
## Configuring Claude
|
||||
## Configuring Claude Desktop
|
||||
|
||||
Update your Claude configuration file to add the MCP Database Server:
|
||||
### Direct Usage Configuration
|
||||
|
||||
If you installed the package globally, configure Claude Desktop with:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"sqlite": {
|
||||
"command": "node",
|
||||
"command": "npx",
|
||||
"args": [
|
||||
"/path/to/mcp-database-server/dist/src/index.js",
|
||||
"-y",
|
||||
"@executeautomation/database-server",
|
||||
"/path/to/your/database.db"
|
||||
]
|
||||
},
|
||||
"sqlserver": {
|
||||
"command": "node",
|
||||
"command": "npx",
|
||||
"args": [
|
||||
"/path/to/mcp-database-server/dist/src/index.js",
|
||||
"-y",
|
||||
"@executeautomation/database-server",
|
||||
"--sqlserver",
|
||||
"--server", "your-server-name",
|
||||
"--database", "your-database-name",
|
||||
@@ -76,20 +104,63 @@ Update your Claude configuration file to add the MCP Database Server:
|
||||
}
|
||||
```
|
||||
|
||||
## Available Tools
|
||||
### Local Development Configuration
|
||||
|
||||
The MCP Database Server provides the following tools:
|
||||
For local development, configure Claude Desktop to use your locally built version:
|
||||
|
||||
- `read_query`: Execute SELECT queries to read data from the database
|
||||
- `write_query`: Execute INSERT, UPDATE, or DELETE queries
|
||||
- `create_table`: Create new tables in the database
|
||||
- `alter_table`: Modify existing table schema (add columns, rename tables, etc.)
|
||||
- `drop_table`: Remove a table from the database with safety confirmation
|
||||
- `export_query`: Export query results to various formats (CSV, JSON)
|
||||
- `list_tables`: Get a list of all tables in the database
|
||||
- `describe_table`: View schema information for a specific table
|
||||
- `append_insight`: Add a business insight to the memo
|
||||
- `list_insights`: List all business insights in the memo
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"sqlite": {
|
||||
"command": "node",
|
||||
"args": [
|
||||
"/absolute/path/to/mcp-database-server/dist/src/index.js",
|
||||
"/path/to/your/database.db"
|
||||
]
|
||||
},
|
||||
"sqlserver": {
|
||||
"command": "node",
|
||||
"args": [
|
||||
"/absolute/path/to/mcp-database-server/dist/src/index.js",
|
||||
"--sqlserver",
|
||||
"--server", "your-server-name",
|
||||
"--database", "your-database-name",
|
||||
"--user", "your-username",
|
||||
"--password", "your-password"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The Claude Desktop configuration file is typically located at:
|
||||
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
||||
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
||||
- Linux: `~/.config/Claude/claude_desktop_config.json`
|
||||
|
||||
## Available Database Tools
|
||||
|
||||
The MCP Database Server provides the following tools that Claude can use:
|
||||
|
||||
| Tool | Description | Required Parameters |
|
||||
|------|-------------|---------------------|
|
||||
| `read_query` | Execute SELECT queries to read data | `query`: SQL SELECT statement |
|
||||
| `write_query` | Execute INSERT, UPDATE, or DELETE queries | `query`: SQL modification statement |
|
||||
| `create_table` | Create new tables in the database | `query`: CREATE TABLE statement |
|
||||
| `alter_table` | Modify existing table schema | `query`: ALTER TABLE statement |
|
||||
| `drop_table` | Remove a table from the database | `table_name`: Name of table<br>`confirm`: Safety flag (must be true) |
|
||||
| `list_tables` | Get a list of all tables | None |
|
||||
| `describe_table` | View schema information for a table | `table_name`: Name of table |
|
||||
| `export_query` | Export query results as CSV/JSON | `query`: SQL SELECT statement<br>`format`: "csv" or "json" |
|
||||
| `append_insight` | Add a business insight to memo | `insight`: Text of insight |
|
||||
| `list_insights` | List all business insights | None |
|
||||
|
||||
For practical examples of how to use these tools with Claude, see [Usage Examples](docs/usage-examples.md).
|
||||
|
||||
## Additional Documentation
|
||||
|
||||
- [SQL Server Setup Guide](docs/sql-server-setup.md): Details on connecting to SQL Server databases
|
||||
- [Usage Examples](docs/usage-examples.md): Example queries and commands to use with Claude
|
||||
|
||||
## Development
|
||||
|
||||
|
||||
Reference in New Issue
Block a user