Install & Compatibility
Where this runs
tested against v2025.4.25 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.9
✕ build_error
✕ build_error
70MB installed
● package 70MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
MCPSQLiteServer
✓ from mcp_server_sqlite.server import MCPSQLiteServer
✗ from mcp_server_sqlite.server import MCPSQLiteServer
main
✓ from mcp_server_sqlite import main
✗ from mcp_server_sqlite import main
server
✓ from mcp_server_sqlite import server
✗ from mcp_server_sqlite import server
Initializes and runs a basic MCP server with SQLite persistence. By default, it creates `mcp_server.db` in the current working directory. For robust applications, always specify an absolute database file path and include error handling for graceful shutdown.
import logging
from mcp_server_sqlite.server import MCPSQLiteServer
# Configure basic logging for better visibility
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
# Initialize the SQLite MCP server.
# By default, it creates 'mcp_server.db' in the current working directory.
# For production, it's recommended to specify an explicit path:
# server = MCPSQLiteServer(database_file='/var/lib/mcp/my_server.db')
server = MCPSQLiteServer()
print("Starting MCP SQLite server on 0.0.0.0:25565...")
try:
server.run()
except KeyboardInterrupt:
logging.info("Server stopped by user (KeyboardInterrupt).")
except Exception as e:
logging.error(f"An unexpected error occurred: {e}", exc_info=True)
Debug
Known issues
gotchaThe server defaults to creating `mcp_server.db` in the current working directory if no `database_file` is specified during initialization. Running the server from different directories will create separate, distinct database files, leading to data inconsistencies or loss if not explicitly managed.fixAlways specify an absolute or relative path for `database_file` in the `MCPSQLiteServer` constructor, e.g., `MCPSQLiteServer(database_file='path/to/my_server.db')`.
affects: All versions
breakingAs `mcp-server-sqlite` heavily relies on the `mcp-server` base library, breaking changes or API shifts in `mcp-server` may indirectly break `mcp-server-sqlite`. The `YYYY.MM.DD` versioning of both projects suggests frequent updates that might not always be backward compatible with older `mcp-server` versions.fixAlways pin both `mcp-server-sqlite` and `mcp-server` to specific versions in your `requirements.txt` to ensure compatibility. Consult the `mcp-server` documentation for its own breaking changes and update both libraries in sync.
affects: Potentially all major `YYYY` versions if `mcp-server` updates significantly.
gotchaIf the server's `run()` method is not wrapped in a `try...except` block (e.g., `KeyboardInterrupt` or other exceptions), the server will abruptly terminate without graceful shutdown, potentially leaving database connections open or causing data corruption.fixWrap the `server.run()` call in a `try...except KeyboardInterrupt` and a general `except Exception` block to handle unexpected shutdowns gracefully, as shown in the quickstart example.
affects: All versions
Upgrade
Version history
2025.4.25latest on PyPI · released Apr 25, 2025
Audit
Dependencies
mcp-serverrequiredProvides the core Minecraft Protocol server logic; mcp-server-sqlite builds upon and extends its functionality.