sdf_mcp_server

hphan9/sdf_mcp_server

3.2

If you are the rightful owner of sdf_mcp_server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A Model Context Protocol (MCP) server for working with SQL Server Compact Edition (SDF) database files.

Tools
4
Resources
0
Prompts
0

SDF MCP Server

A Model Context Protocol (MCP) server for working with SQL Server Compact Edition (SDF) database files. This server provides tools to connect to, upgrade, query, and modify SDF databases

Note: This server is Windows-only as it depends on SQL Server Compact Edition, which is a Windows-only database engine.

System Requirements

  • Windows operating system
  • .NET 9.0 or later
  • Visual Studio Code
  • SQL Server Compact Edition 4.0 runtime (included in project dependencies)

Features

  • Database Connection: Connect to SDF files with optional password protection
  • Database Upgrade: Upgrade older SQL Server Compact databases to version 4.0
  • Data Query: Execute SELECT queries on any table in the database
  • Data Modification: Execute INSERT, UPDATE, and DELETE operations

Setup

  1. Make sure you have .NET 9.0 or later installed
  2. Clone this repository
  3. Build the project:
dotnet build
  1. Configure VS Code to use the server by adding this to your .vscode/mcp.json:
{
    "servers": {
        "sdf-mcp": {
            "type": "stdio",
            "command": "dotnet",
            "args": [
                "run",
                "--project",
                "<path-to-project>/sdf_mcp_server/sdf_mcp_server.csproj"
            ]
        }
    }
}

Available Tools

InitConnection

Initializes a connection to an SDF file. "filePath": "path/to/database.sdf", "password": "optional-password"

UpgradeDatabase

Upgrades a database that was created with an earlier version of SQL Server Compact (e.g., Version 3.5).

  • Requires running InitConnection first
  • No parameters needed
  • Database will be upgrade to version 4.0

GetData

Queries data from a specified table.

ModifyData

Modifies data in a specified table using INSERT, UPDATE, or DELETE operations.

Usage Examples

  1. Connect to a database: "filePath": "C:\path\to\database.sdf", "password": "optional-password"

  2. If you get a version error, upgrade the database using the UpgradeDatabase tool.

  3. Query data:

  4. Modify data:

Error Handling

The server provides detailed error messages for common issues:

  • File not found
  • Invalid password
  • Database version mismatch
  • Invalid queries
  • Table not found
  • Connection errors

Dependencies

  • .NET 9.0
  • ModelContextProtocol SDK
  • FluentMigrator.Runner.SqlServerCe