- Home
- MCP servers
- Bun DB
Bun DB
- typescript
1
GitHub Stars
typescript
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You run a Bun-based MCP server that safely exposes MySQL database operations to AI assistants. It supports multiple transports, including standard input/output, Server-Sent Events over HTTP, and HTTP with OAuth, while enforcing secure query execution, schema inspection, and CRUD operations. This guide shows you how to use the server, install it, and configure it for both local development and client access.
How to use
Connect to your database securely and perform common operations from your MCP client. You can establish a local STDIO session for development or use HTTP transports (SSE or OAuth-enabled HTTP) to interact over a network. Use the available tools to manage connections, run safe selects, create and update records, delete entries, and inspect the database schema. Prompts are provided to simplify natural-language interactions with the database, and the system guards against unsafe queries through parameterization and input validation.
How to install
Prerequisites: ensure Bun is installed (version 1.0 or higher), and your MySQL instance is accessible (MySQL 5.7+ or MySQL 8.0+). You also may need Node.js 18+ for compatibility in some environments.
Step-by-step commands to set up and run the MCP server locally.
Starting and running the server
Start the server using the default STDIO transport for a local client like Claude Desktop or similar MCP clients.
Alternatively, run the server over SSE or HTTP to enable browser-based clients or OAuth-secured access.
Security and access
The server supports Bearer-token authentication for HTTP transport, protects resources with access controls, and enforces parameterized queries to prevent SQL injection. Environment-based configuration stores credentials securely, and CORS policies can be customized.
Troubleshooting
If you encounter connection issues, verify that your MySQL service is running and that host/port settings match your environment. For authentication problems, double-check the credentials and database permissions. If modules fail to load, run the dependency installer again and confirm your runtime version.
Notes
You can mix transport types in development and production as needed. Remember to protect sensitive credentials and use OAuth where possible for HTTP access.
Available tools
connection
Manage Database Connection: connect, disconnect, or check status.
query
Execute SELECT queries with parameterized statements to safely retrieve data.
create
Insert new records into a table with secure handling of input data.
update
Update existing records with safe, parameterized updates.
delete
Delete records by condition using secure, parameterized queries.
readSchema
Inspect database schema and table structures to understand the data layout.