Installation & Setup
This guide will walk you through installing and setting up Data MCP on your system.
Quick Start with Docker
Run public image from ECR:
# Create data directory
mkdir -p ./data
# Run container with data directory
docker run \
--name dmcp \
-p 8000:8000 \
-e SECRET_KEY="your-secret-key" \
-v $(pwd)/data:/app/data \
public.ecr.aws/p9k6o7t1/lil/datamcp:latestNote: Your default admin account is:
- Username:
admin - Password:
dochangethispassword
⚠️ Remember: Change the default password for security!
Manual Setup
This is a manual setup for those who want to run the server without Docker.
Prerequisites
Before installing Data MCP, ensure you have:
- Python 3.10 or higher
- uv package manager (recommended) or pip
- Git (for cloning the repository)
Installing uv (Recommended)
uv is a fast Python package installer and resolver, written in Rust. It's the recommended way to manage dependencies for this project.
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Or using pip
pip install uvInstallation Steps
1. Clone the Repository
git clone <repository-url>
cd dmcp2. Install Dependencies
Using uv (recommended):
uv syncOr using pip:
pip install -r requirements.txt3. Environment Configuration
Create a .env file in the project root:
cp env.example .envEdit the .env file with your configuration:
# Database Configuration
DATABASE_URL=sqlite+aiosqlite:///./dmcp.db
# Security
SECRET_KEY=your-secret-key-here-change-this-in-production
# Optional config if you want to customize
# JWT Configuration
JWT_ALGORITHM=HS256
JWT_EXPIRATION_MINUTES=60
HOST=0.0.0.0
PORT=8000
DEBUG=true
LOG_LEVEL=INFO
ALLOWED_ORIGINS=["http://localhost:3000", "http://localhost:8000"]
MCP_HOST=127.0.0.1
MCP_PORT=8000
MCP_PATH=/dmcp
MCP_LOG_LEVEL=debug4. Initialize the Database
uv run alembic upgrade head5. Default Admin Account
After initializing the database, a default admin account is automatically created with the following credentials:
- Username:
admin - Password:
dochangethispassword
⚠️ Security Warning: It's crucial to change this default password immediately after your first login for security purposes.
Changing the Default Password
You can change the admin password using the API or the web interface:
Using the API:
curl -X POST http://localhost:8000/dmcp/users/1/change-password \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"current_password": "dochangethispassword",
"new_password": "your-new-secure-password"
}'Using the Web UI:
- Navigate to http://localhost:8000/dmcp/ui
- Login with the default credentials (admin/dochangethispassword)
- Go to the Users section
- Click on the admin user
- Use the "Change Password" feature
- Start the Server
API Server
uv run main.pyThe API server will be available at:
- API Documentation: http://localhost:8000/dmcp/docs (when server is running)
- Web UI: http://localhost:8000/dmcp/ui (when server is running)
- Health Check: http://localhost:8000/dmcp/health (when server is running)
The MCP server runs on port 8000 by default.
Verification
1. Check API Health
curl http://localhost:8000/dmcp/healthExpected response:
{
"status": "healthy",
"timestamp": "2024-01-01T00:00:00Z"
}2. Test Authentication
curl -H "Authorization: Bearer YOUR_TOKEN" \
http://localhost:8000/dmcp/datasources3. Test Default Admin Login
Test the default admin account:
curl -X POST http://localhost:8000/dmcp/users/login \
-H "Content-Type: application/json" \
-d '{
"username": "admin",
"password": "dochangethispassword"
}'Expected response:
{
"data": {
"id": 1,
"username": "admin",
"first_name": "Admin",
"last_name": "Admin",
"roles": ["admin"],
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
},
"success": true,
"errors": [],
"warnings": []
}4. Access Web UI
Open http://localhost:8000/dmcp/ui in your browser and enter your authentication token when prompted.
Development Setup
Installing Development Dependencies
uv sync --group devRunning Tests
uv run pytestTroubleshooting
Common Issues
1. Port Already in Use
If you get a "port already in use" error:
# Find the process using the port
lsof -i :8000
# Kill the process
kill -9 <PID>2. Data Source Connection Issues
- Ensure your data source is running
- Check connection parameters in your datasource configuration
- Verify network connectivity
3. Authentication Problems
- Regenerate your token:
uv run scripts/apptoken.py - Ensure you're using the correct token format:
Bearer <token> - Default Admin Login: Use username
adminand passworddochangethispasswordfor initial access - Password Reset: If you've forgotten the admin password, you may need to reset the database and reinitialize
4. MCP Server Issues
- Ensure the MCP server is running on the correct port
- Check that your MCP client is configured correctly
- Verify authentication tokens are being passed correctly
Next Steps
Now that you have Data MCP installed and running, you can:
- Configure DataSources - Set up your data source connections
- Create Tools - Build MCP tools from your queries and operations
- Connect MCP Clients - Integrate with AI assistants
Ready to configure your first datasource? Let's move on to the DataSource Configuration Guide!