SQLite Database Demo
@anhnx000
关于 SQLite Database Demo
Some examples to build server, client test in model context protocol. Một số ví dụ sử dụng MCP
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"model_context_protocol_examples": {
"command": "python",
"args": [
"server.py"
]
}
}
}工具
未检测到工具
工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。
概览
What is SQLite Database Demo?
SQLite Database Demo is an example FastMCP application that demonstrates async SQLite database operations using the aiosqlite library. It provides a ready‑to‑run server with automatic database initialization, sample data, and a query_db tool for retrieving records. This server is intended for developers learning or prototyping with FastMCP and async SQLite.
How to use SQLite Database Demo?
Clone the repository, install dependencies (pip install -r requirements.txt), then start the server with python server.py. On first run the database is automatically created and populated with sample data. Use the built‑in query_db tool to query all users.
Key features of SQLite Database Demo
- Async SQLite operations via
aiosqlite - Automatic database creation and sample data insertion
- Type‑safe database context management
- Proper connection lifecycle handling (cleanup on shutdown)
- Simple
query_dbtool for retrieving all users
Use cases of SQLite Database Demo
- Learning how to integrate async SQLite with FastMCP
- Prototyping a FastMCP server that reads from a local database
- Testing database‑related MCP tools without external infrastructure
- Demonstrating connection lifecycle and error handling patterns
FAQ from SQLite Database Demo
What is the database schema?
The demo includes a users table with columns id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, and email TEXT UNIQUE NOT NULL.
How is the database initialized?
On first run, server.py automatically creates demo.db and populates it with two sample users: John Doe ([email protected]) and Jane Smith ([email protected]).
What tools are available?
The server exposes a query_db tool that executes a query returning all rows from the users table.
What are the runtime requirements?
Python 3.7 or higher, with dependencies aiosqlite>=0.19.0, pandas>=2.0.0, and numpy>=1.24.0.
How can I customize the database schema?
Edit the _init_db() method in database.py to add tables or columns. Add new query methods to the Database class and expose them through tools in server.py.
数据库 分类下的更多 MCP 服务器
Chroma MCP Server
chroma-coreA Model Context Protocol (MCP) server implementation that provides database capabilities for Chroma
Snowflake MCP Server
isaacwassermanClickHouse MCP Server
ClickHouseConnect ClickHouse to your AI assistants.
Dbhub
bytebaseZero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.
Neon MCP Server
neondatabaseMCP server for interacting with Neon Management API and databases
评论