CareDesk is an AI-powered hospital receptionist application that integrates with a MySQL database via an MCP Database Server. In this example, it is configured for a hospital use case, but you can adapt it for your own domain such as retail, education, finance, or any other database-driven chatbot — by changing the system prompt, database schema, and tools configuration.
- Main entrypoint:
agent.py - Dependencies:
requirements.txt - System prompt: files in
prompts/(e.g.,hospital_receptionist.txt) you can edit it for you - MCP DB server: Node.js project providing tools via stdio transport
- Python 3.10+
- Node.js 18+
- MySQL 8+ (or a compatible MySQL server)
Install from requirements.txt:
pip install -r requirements.txtCurrent pinned packages (see requirements.txt):
- python-dotenv
- pydantic
- langchain, langchain-openai, langchain-core
- langgraph
- langchain-mcp-adapters
- python-multipart
- rich
Create a .env file in the project root. The agent expects:
# GitHub Models (used in agent.py)
GITHUB_TOKEN=ghp_your_github_token_here
# Optional: override DB defaults
DB_HOST=localhost
DB_NAME=hospital
DB_PORT=3306
DB_USER=root
DB_PASSWORD=your_mysql_passwordNotes:
agent.pymapsGITHUB_TOKENtoOPENAI_API_KEYand setsOPENAI_API_BASE=https://models.github.ai/inferenceto use GitHub Models.- If you prefer a different OpenAI-compatible provider, adjust those envs in
agent.pyaccordingly.
Place role/system prompts under prompts/.
In this example, it is configured for a hospital use case using the hospital_receptionist.txt system prompt, but you can replace it with your own role prompt for any domain such as retail, education, finance, or other database-driven chatbots.
- Default used:
prompts/hospital_receptionist.txt - If missing,
agent.pyfalls back to a built-in system prompt.
agent.py launches a local MCP server over stdio. The code expects the built server at:
<mrepo>/mcp-database-server/dist/src/index.js
If you don’t have it yet, download and build it as follows (then place/rename the folder to mcp-database-server in the project root):
- Clone the repository:
git clone https://github.com/executeautomation/mcp-database-server.git cd database-server - Install dependencies:
npm install
- Build the project:
npm run build
After building, ensure the folder name under this project root is exactly mcp-database-server so the path in agent.py resolves:
customerSupport/
├─ agent.py
├─ mcp-database-server/
│ └─ dist/src/index.js
└─ prompts/
If your cloned folder is named differently (e.g., database-server), either rename it to mcp-database-server or update the path in agent.py where mcp_server_path is set.
Ensure your MySQL instance is reachable and the credentials in .env are valid. The default database name is hospital. Seed your schema/data as appropriate for your use case.
From the project root:
python agent.pyYou’ll see a welcome panel and a list of available MCP database tools on successful connection. Try queries like:
- "List tables"
- "Describe table patients"
- "Show doctors"
Type exit to quit.
- "Failed to get MCP tools":
- Verify Node.js is installed and the server path exists at
mcp-database-server/dist/src/index.js. - Make sure you ran
npm install && npm run buildinside the MCP server folder.
- Verify Node.js is installed and the server path exists at
- Authentication errors with model:
- Ensure
.envcontains a validGITHUB_TOKENand your network allows access tohttps://models.github.ai/inference.
- Ensure
- DB connection errors:
- Confirm
DB_HOST,DB_NAME,DB_PORT,DB_USER,DB_PASSWORDare correct and the database is reachable.
- Confirm
- Agent:
agent.py - Requirements:
requirements.txt - Prompts directory:
prompts/(e.g.,prompts/hospital_receptionist.txt)
