home / mcp / mcp llamaindex sqlite bridge mcp server

MCP LlamaIndex SQLite Bridge MCP Server

MCP (Model Context Protocol) server with SQLite integration and LlamaIndex client using Ollama

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "elisha1994-mcp-llama-sqlite-bridge": {
      "command": "python",
      "args": [
        "server.py",
        "--server_type=sse"
      ]
    }
  }
}

You can run MCP servers that expose database operations as tools and interact with them through LlamaIndex-based clients. This setup supports a simple SQLite demo and a full-feature HR management system, with async tooling and a natural language interface to query and modify data. Use the simple demo for quick experiments and the HR system for in-depth employee management, analytics, and auditing.

How to use

Connect to a running MCP server from the corresponding client to start an interactive session where you can issue natural language queries. You can explore available tools, then execute operations like adding records, querying data, updating employees, or generating dashboards. For the HR system, always include an employee email when adding new employees to ensure the operation succeeds.

How to install

Follow these steps to set up either the simple demo or the HR management system.

# Prerequisites
- Python 3.8+
- Ollama installed and running
- llama3.2 model (or another model that supports tool calling)

# 1) Clone the project
git clone https://github.com/ELISHA1994/mcp-llama-sqlite-bridge.git
cd mcp-llama-sqlite-bridge

# 2) Create a virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# 3) Install dependencies
pip install -r requirements.txt

# 4) Pull the required Ollama model
ollama pull llama3.2

Starting the Simple Demo server and client

Run the simple SQLite demo server, then connect with the client to interact with the data.

python server.py --server_type=sse
python client.py

Starting the HR Management System server and client

Launch the HR-focused MCP server and then use the HR client to issue natural language queries, manage employees, leaves, compensation, and analytics.

python hr_server.py --server_type=sse
python hr_client.py

Notes on interactions and examples

For the simple demo, you can add and list people in the database. For the HR system, remember to include emails when adding employees, e.g. Add Sarah Johnson ([email protected]) to Engineering as Senior Developer with $105,000 salary.

Troubleshooting and tips

If you encounter module or model issues, ensure dependencies are installed and you are using a model that supports function calling. Verify the MCP server is running before starting the client. If an employee addition fails due to missing email, re-run the command with the email included and check for the error message indicating the missing field.

Appendix: Tools and commands overview

The system exposes a set of tools for interacting with the databases. Use the simple demo tools to add or read data, and employ the HR tools to manage employees, leaves, salaries, dashboards, and more. When crafting natural language prompts, prefer explicit emails for employee creation and leverage the supported seniority, departments, and salary fields for accurate results.

Available tools

add_data

Add records to the simple demo database using SQL INSERT statements.

read_data

Query records from the simple demo database using SQL SELECT statements.

add_employee

Add a new employee to the HR management system; requires an email address.

check_employee_leave_balance

Check leave balance for a given employee by name.

update_employee_salary

Update the salary for a specific employee by name.

submit_leave_request

Submit a leave request for an employee by name.

list_all_employees

Retrieve all active employees from the HR system.

find_employees_by_department

Search for employees within a specific department.

combine_org_chart

Generate an organizational chart for a department.

generate_hr_dashboard

Create an HR metrics/dashboard report.

analyze_turnover

Analyze turnover analytics across periods.

calculate_compensation_metrics

Compute salary statistics and related metrics.

record_performance_review

Create or update performance reviews for employees.