LabscoMCP early access ↗
hanwegMCP SERVER

SQL Server Express

Query and change a SQL Server Express database, with the reachable databases fixed at launch.

by hanweg ↗Relational SQL DatabasesCommunity

LABSCO SUMMARY

Reads and writes are different tools, and the database list is set before start-up.

--allowed-databases fixes what the server can reach when it launches, so touching the wrong database takes a config change rather than a bad guess. Splitting read_query from write_query means a client that approves tools individually can allow the first and hold the second.

What it is

A Python server for Microsoft SQL Server Express. Reads and writes are separate tools, and the databases it may touch are named on the launch command rather than chosen per call.

What you get

  • read_query for SELECT
  • write_query for INSERT, UPDATE and DELETE
  • create_table to add a table
  • list_tables for what exists, describe_table for a table's schema
  • get_allowed_databases for the databases this instance was launched with
  • Windows authentication or SQL Server authentication, chosen at launch

Requirements

Python 3.10 or newer, Microsoft's ODBC driver for SQL Server, and an instance you have rights on. Launch arguments carry the configuration: --server, --auth, and --allowed-databases as a comma-separated list. SQL authentication adds a user name and a password on the same line; Windows authentication uses --trusted-connection yes.

Setup effort

Build from source — get the source, then follow the steps on this page and add the configuration for your client