sqlite-mcp-agent
The sqlite-mcp-agent is a Python-based agent designed to interact with SQLite databases. It provides essential functionalities such as inserting, updating, deleting, and executing queries, making it easy to integrate with SQLite databases. It is particularly useful for automated workflows and data analysis.
GitHub Stars
0
User Rating
Not Rated
Favorites
0
Views
7
Forks
3
Issues
2
Local MCP Client Demo
This project demonstrates a fully local Model Context Protocol (MCP) client using:
- SQLite via Python
sqlite3
- FastMCP (
mcp-server
) for tool management - DeepSeek-R1 LLM hosted locally via Ollama
- LlamaIndex for building an MCP-powered agent
📦 Requirements
Ensure you have the following installed:
Python 3.8+
Ollama CLI (for DeepSeek-R1)
System packages:
pip install -r requirements.txt
🛠️ Files Overview
server.py
— MCP server exposingadd_data
&read_data
tools backed by SQLiteollama_client.py
— Async agent setup using Ollama + LlamaIndexchat_interface.py
— CLI wrapper to chat with the agentrequirements.txt
— Python dependencies
🚀 Setup & Running
Start the MCP Server
# Initialize database and run in SSE mode python server.py --server_type sse
Launch Ollama & DeepSeek-R1
ollama pull deepseek-r1 ollama run deepseek-r1
Install Python Dependencies
pip install -r requirements.txt
Run the Chat Client
python chat_interface.py
Type your queries (e.g.,
add_data(...)
or natural questions) and see the agent invoke tools and respond.
🎯 Best Practices
- Tool Design: Keep tools focused (single responsibility) and clearly document inputs/outputs.
- Error Handling: Catch and log exceptions in tool implementations to avoid silent failures.
- Security: Avoid executing raw SQL when possible; use parameterized queries for production.
- Extensibility: Add new MCP tools by decorating with
@mcp.tool()
and exposing vialist_tools
.
📝 Next Steps
- Integrate additional data sources (e.g., external APIs).
- Deploy on Lightning AI for scalable hosting.
- Enhance agent prompts and caching strategy for performance.
Demo built with ❤️ for fully local, context-aware agents!
0
Followers
0
Repositories
0
Gists
0
Total Contributions
This project is a literature management system using SQLite, designed to assist in organizing and retrieving literature efficiently through robust database operations. Users can easily add, update, and delete literature information, with a comprehensive search functionality.