@shah1900/mcp-db-api-tools
v1.0.2
Published
Local MCP servers for Cursor: Database Inspector (read-only MySQL) and API Runner (Bearer auth). Debug and verify your API with AI.
Maintainers
Readme
MCP Cheatsheet
Local MCP servers for Cursor: Database Inspector (read-only MySQL) and API Runner (Bearer auth). Let AI query your database and hit your API for debugging and verification.
Table of Contents
- Features
- Installation
- Complete Setup
- Where files go
- Database Inspector
- API Runner
- Configuration
- Debug Logging
- Security
- License
Features
| Server | Purpose | |--------|---------| | Database Inspector | Read-only MySQL queries. List tables, describe schemas, run SELECT queries, check if records exist. | | API Runner | Execute GET/POST requests to your API with Bearer token auth. |
Use cases:
- "Check if transaction ID 123 exists in the DB"
- "Compare DB results with API response"
- "Call the store-transactions API and verify the data"
Installation
npm install @shah1900/mcp-db-api-toolsSDK-style setup: On install, the package automatically creates:
.mcp-cheatsheet/.env(from template).cursor/mcp.json(Cursor MCP config)- Adds
.mcp-cheatsheet/to.gitignore
Manual setup (if you skipped install or need to re-run):
npx @shah1900/mcp-db-api-tools initComplete Setup
Install (runs setup automatically):
npm install @shah1900/mcp-db-api-toolsEdit
.mcp-cheatsheet/.envwith your DB and API credentials.Restart Cursor (MCP servers load at startup).
Where files go
| What | Location |
|------|----------|
| Package code | node_modules/@shah1900/mcp-db-api-tools/ (auto-installed) |
| Your credentials | .mcp-cheatsheet/.env (created by setup) |
| Cursor config | .cursor/mcp.json (created by setup) |
Database Inspector
Read-only MySQL access. Only SELECT queries are allowed.
Tools
| Tool | Description |
|------|-------------|
| db_list_tables | List all tables in the database |
| db_describe_table | Describe schema of a table |
| db_execute_query | Run a read-only SELECT query |
| db_check_record_exists | Check if a record exists by ID |
Example prompts
- "Check if a transaction with ID 123 exists in the DB"
- "List all tables in the database"
- "Describe the transactions table schema"
Environment variables
| Variable | Description |
|---------|-------------|
| DB_CONNECTION_STRING | Full URL: mysql://user:pass@host:3306/dbname |
| DB_HOST | Database host |
| DB_PORT | Port (default 3306) |
| DB_USERNAME | Username |
| DB_PASSWORD | Password |
| DB_NAME | Database name |
API Runner
Execute GET/POST requests to your API with Bearer token auth.
Tools
| Tool | Description |
|------|-------------|
| api_list_endpoints | List available API endpoints |
| api_get | Execute GET request |
| api_post | Execute POST request |
Example prompts
- "Call the store-transactions API with storeId=1"
- "Compare DB results with API response for transaction 123"
Environment variables
| Variable | Description |
|---------|-------------|
| API_BASE_URL | Base URL (e.g. http://localhost:3000) |
| API_AUTH_TOKEN | Bearer token for auth |
Endpoints config
Edit api-runner/endpoints.json to customize the list returned by api_list_endpoints.
Configuration
Use project-level config. Each project should have its own .cursor/mcp.json and .mcp-cheatsheet/.env. Do not use global Cursor config—it uses a fixed path and one set of credentials for all projects.
Debug Logging
Both servers log to stderr (tool name, args, result preview). View in Cursor: View → Output → select the MCP server channel.
To disable: set MCP_DEBUG=0 in .env.
Security
- Never commit
.mcp-cheatsheetor.env - Credentials live in
.envonly - Add
.mcp-cheatsheet/to.gitignore
License
MIT © Shah Shahbaz
