MCP Database Filesystem

mcp-db-filesystem
  • python

0

GitHub Stars

python

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ppengit-mcp-db-filesystem": {
      "command": "uvx",
      "args": [
        "mcp-db-filesystem@latest"
      ],
      "env": {
        "REDIS_DB": "0",
        "MSSQL_PORT": "1433",
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "REDIS_HOST": "localhost",
        "REDIS_PORT": "6379",
        "MSSQL_DRIVER": "ODBC Driver 17 for SQL Server",
        "MSSQL_SERVER": "localhost",
        "SERVER_DEBUG": "false",
        "MSSQL_ENCRYPT": "false",
        "MYSQL_CHARSET": "utf8mb4",
        "MSSQL_DATABASE": "your_database",
        "MSSQL_PASSWORD": "your_password",
        "MSSQL_USERNAME": "your_username",
        "MYSQL_DATABASE": "your_mysql_database",
        "MYSQL_PASSWORD": "your_mysql_password",
        "MYSQL_USERNAME": "your_mysql_username",
        "REDIS_PASSWORD": "your_redis_password",
        "FS_ENABLE_WRITE": "true",
        "MSSQL_POOL_SIZE": "5",
        "MYSQL_POOL_SIZE": "5",
        "FS_ALLOWED_PATHS": "*",
        "FS_ENABLE_DELETE": "true",
        "FS_MAX_FILE_SIZE": "1073741824",
        "SERVER_LOG_LEVEL": "INFO",
        "MSSQL_MAX_OVERFLOW": "10",
        "MYSQL_MAX_OVERFLOW": "10",
        "FS_IGNORE_FILE_LOCKS": "false",
        "REDIS_SOCKET_TIMEOUT": "30",
        "FS_ALLOWED_EXTENSIONS": "*.*",
        "MSSQL_COMMAND_TIMEOUT": "30",
        "REDIS_MAX_CONNECTIONS": "10",
        "MSSQL_APPLICATION_NAME": "MCP-Db-Filesystem",
        "MSSQL_USE_WINDOWS_AUTH": "true",
        "MSSQL_CONNECTION_TIMEOUT": "30",
        "MYSQL_CONNECTION_TIMEOUT": "30",
        "REDIS_CONNECTION_TIMEOUT": "30",
        "SECURITY_MAX_QUERY_LENGTH": "10000",
        "SECURITY_LOG_SENSITIVE_DATA": "false",
        "SECURITY_ENABLE_QUERY_LOGGING": "true",
        "MSSQL_TRUST_SERVER_CERTIFICATE": "true",
        "MSSQL_MULTIPLE_ACTIVE_RESULT_SETS": "true",
        "SECURITY_ENABLE_SQL_INJECTION_PROTECTION": "true"
      }
    }
  }
}

You can access multiple databases and local filesystem operations through a single MCP server. It provides focused support for SQL Server, MySQL, and Redis, along with straightforward file read/write and directory listing, all secured and resilient to failures.

How to use

You run the MCP server locally and connect your MCP client to it. Use the provided runtime command to start the server, and configure your client with the connection details and environment settings shown below. Once running, you can perform SQL queries on SQL Server and MySQL databases, manage Redis keys, and perform file system operations like reading, writing, and listing directories. The server includes safety features to protect against SQL injection and unauthorized filesystem access, and it automatically recovers from transient database connection failures.

How to install

Prerequisites vary by the databases you plan to use. The instructions below focus on the recommended installation flow that lets you run the MCP server without cloning code. Ensure you have a supported runtime available and then start the server using the provided command.

Additional sections

Configuration, security, and troubleshooting details are provided via the MCP client configuration you run. The server exposes features for SQL Server, MySQL, and Redis access, as well as filesystem operations such as reading and writing files and listing directories. You can tailor environment variables to enable or constrain access, control timeouts, and adjust security protections. If a database connection fails, the system gracefully downgrades without impacting other services and can dynamically re-establish connections.

Configuration and running the server

{
  "mcpServers": {
    "mcp-db-filesystem": {
      "command": "uvx",
      "args": ["mcp-db-filesystem@latest"],
      "env": {
        "MSSQL_SERVER": "localhost",
        "MSSQL_DATABASE": "your_database",
        "MSSQL_USERNAME": "your_username",
        "MSSQL_PASSWORD": "your_password",
        "MSSQL_USE_WINDOWS_AUTH": "true",
        "MSSQL_PORT": "1433",
        "MSSQL_DRIVER": "ODBC Driver 17 for SQL Server",
        "MSSQL_CONNECTION_TIMEOUT": "30",
        "MSSQL_COMMAND_TIMEOUT": "30",
        "MSSQL_POOL_SIZE": "5",
        "MSSQL_MAX_OVERFLOW": "10",
        "MSSQL_TRUST_SERVER_CERTIFICATE": "true",
        "MSSQL_ENCRYPT": "false",
        "MSSQL_MULTIPLE_ACTIVE_RESULT_SETS": "true",
        "MSSQL_APPLICATION_NAME": "MCP-Db-Filesystem",

        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_DATABASE": "your_mysql_database",
        "MYSQL_USERNAME": "your_mysql_username",
        "MYSQL_PASSWORD": "your_mysql_password",
        "MYSQL_CHARSET": "utf8mb4",
        "MYSQL_CONNECTION_TIMEOUT": "30",
        "MYSQL_POOL_SIZE": "5",
        "MYSQL_MAX_OVERFLOW": "10",

        "REDIS_HOST": "localhost",
        "REDIS_PORT": "6379",
        "REDIS_DB": "0",
        "REDIS_PASSWORD": "your_redis_password",
        "REDIS_SOCKET_TIMEOUT": "30",
        "REDIS_CONNECTION_TIMEOUT": "30",
        "REDIS_MAX_CONNECTIONS": "10",

        "FS_ALLOWED_PATHS": "*",
        "FS_ALLOWED_EXTENSIONS": "*.*",
        "FS_MAX_FILE_SIZE": "1073741824",
        "FS_ENABLE_WRITE": "true",
        "FS_ENABLE_DELETE": "true",
        "FS_IGNORE_FILE_LOCKS": "false",

        "SECURITY_ENABLE_SQL_INJECTION_PROTECTION": "true",
        "SECURITY_MAX_QUERY_LENGTH": "10000",
        "SECURITY_ENABLE_QUERY_LOGGING": "true",
        "SECURITY_LOG_SENSITIVE_DATA": "false",

        "SERVER_LOG_LEVEL": "INFO",
        "SERVER_DEBUG": "false"
      }
    }
  }
}

Environment and runtime guidance

The server is intended to be started with a runtime command shown in the configuration example. For local development, you may install the runtime, then run the server using the specified command and arguments. Ensure you provide all required environment variables for your databases and filesystem settings.

Security and fault tolerance

Security features include SQL injection protection, filesystem access controls, environment variable configuration, and authentication checks. The system supports graceful degradation if a database connection fails and can dynamically reconnect to databases. Real-time monitoring keeps you informed about the state of all database connections.

Available tools

sql_query

Execute SQL Server SELECT queries against the configured SQL Server connection.

sql_execute

Execute INSERT, UPDATE, or DELETE commands against the configured SQL Server connection.

list_tables

List all tables in the configured SQL Server database.

get_table_schema

Retrieve detailed schema information for a SQL Server table.

database_reconnect

Reestablish a connection to the SQL Server database.

mysql_query

Execute MySQL SELECT queries against the configured MySQL connection.

mysql_execute

Execute INSERT, UPDATE, or DELETE commands against the configured MySQL connection.

mysql_list_tables

List all tables in the configured MySQL database.

mysql_get_table_schema

Retrieve detailed schema information for a MySQL table.

mysql_reconnect

Reconnect to the MySQL database.

redis_get

Get a Redis key value.

redis_set

Set a Redis key with optional expiration.

redis_delete

Delete a Redis key.

redis_keys

List keys matching a pattern in Redis.

redis_info

Get Redis server information.

redis_reconnect

Reconnect to Redis.

read_file

Read contents of a filesystem file.

write_file

Write contents to a filesystem file.

list_directory

List contents of a directory.

delete_file

Delete a filesystem file (requires confirmation).

create_directory

Create a new directory.

database_status

Check the status of all configured database connections.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
MCP Database Filesystem MCP Server - ppengit/mcp-db-filesystem | VeilStrat