MCP Server SQLite

2025.4.25 · active · verified Thu Apr 16

A specialized server implementation for the Minecraft Protocol (MCP) project, providing a persistent backend using SQLite. It extends `mcp-server` to manage user data and game state within an SQLite database. Current version is 2025.4.25, following a rapid release cycle often synchronized with Minecraft client updates or changes to the underlying MCP protocol.

Common errors

Warnings

Install

Imports

Quickstart

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)

view raw JSON →