Included as a web framework dependency for potential future HTTP transport capabilities in the MCP server.
Used as the runtime environment for the MCP server with SDK support via @modelcontextprotocol/sdk.
Used for package management and script execution for installing dependencies and starting the server.
Provides database integration allowing for SQL query execution, user management operations (create, read, update, delete), and custom database interactions.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DB & Calculator MCP Servercalculate the average age of users in the database"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Example Server
This is a Model Context Protocol (MCP) server that provides two main categories of tools:
Database Tools - For interacting with a SQLite database
Calculator Tools - For performing mathematical calculations
Features
Database Tools
query_database- Execute custom SQL queriesget_all_users- Retrieve all users with optional limitget_user_by_id- Get a specific user by IDadd_user- Add a new user to the databaseupdate_user- Update an existing userdelete_user- Delete a user from the database
Calculator Tools
calculate- Perform basic mathematical operations (add, subtract, multiply, divide, power, sqrt, sin, cos, tan, log, abs, round, floor, ceil)calculate_expression- Evaluate mathematical expressionscalculate_stats- Calculate statistical measures (mean, median, variance, standard deviation, etc.)
Related MCP server: Database MCP Server
Installation
Install dependencies:
The database will be automatically created when you first run the server.
Usage
Starting the Server
Or for development with auto-restart:
Database Schema
The server creates a SQLite database with the following schema:
Sample data is automatically inserted when the database is first created.
Tool Examples
Database Operations
Get all users:
Get user by ID:
Add a new user:
Execute custom query:
Calculator Operations
Basic calculation:
Evaluate expression:
Statistical analysis:
Available Calculator Operations
add- Additionsubtract- Subtractionmultiply- Multiplicationdivide- Division (with zero check)power- Exponentiationsqrt- Square rootsin- Sine functioncos- Cosine functiontan- Tangent functionlog- Natural logarithmabs- Absolute valueround- Round to nearest integerfloor- Floor functionceil- Ceiling function
Project Structure
Error Handling
The server includes comprehensive error handling for:
Invalid SQL queries
Database connection issues
Mathematical operation errors (division by zero, invalid inputs)
Missing required parameters
Unknown tool names
Development
To modify or extend the server:
Add new tools in the
setupTools()method inserver.jsImplement corresponding handler methods
Update the tools list in the
tools/listhandlerAdd any necessary database operations in
database.jsAdd calculator functions in
calculator.js
Dependencies
@modelcontextprotocol/sdk- MCP SDK for Node.jssqlite3- SQLite database driverexpress- Web framework (for potential future HTTP transport)
License
MIT