No2SQL 1.0.0

{
  "inputs": [
    {
      "type": "promptString",
      "id": "NO2SQL_MONGO",
      "description": "MongoDB connection string used by the No2SQL MCP server."
    }
  ],
  "servers": {
    "no2sql": {
      "type": "stdio",
      "command": "dnx",
      "args": ["no2sql@1.0.0", "--yes"],
      "env": {
        "NO2SQL_MONGO": "${input:NO2SQL_MONGO}"
      }
    }
  }
}
                    
This package contains an MCP Server. The server can be used in VS Code by copying the generated JSON to your VS Code workspace's .vscode/mcp.json settings file.
dotnet tool install --global No2SQL --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local No2SQL --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=No2SQL&version=1.0.0
                    
nuke :add-package No2SQL --version 1.0.0
                    

No2SQL MCP Server

No2SQL helps you analyze MongoDB databases and generate SQL-friendly outputs:

  • inferred relationships,
  • SQL schema scripts,
  • SQL INSERT seed statements,
  • ER diagrams in Mermaid, PlantUML, and GraphViz DOT.

Install and Configure

MongoDB connection

Set MongoDB connection string using either:

  1. NO2SQL_MONGO environment variable (recommended)
  2. ConnectionStrings:MongoDb in No2SQL/appsettings.json

Example format:

mongodb+srv://<username>:<password>@<cluster-host>/<database>?retryWrites=true&w=majority

Use from NuGet in VS Code

Create .vscode/mcp.json:

{
  "servers": {
    "No2SQL": {
      "type": "stdio",
      "command": "dnx",
      "args": [
        "No2SQL",
        "--version",
        "1.0.0",
        "--yes"
      ]
    }
  }
}

Use from source during development

{
  "servers": {
    "No2SQL": {
      "type": "stdio",
      "command": "dotnet",
      "args": [
        "run",
        "--project",
        "No2SQL"
      ]
    }
  }
}

Available MCP Tools

  • TestConnectivity
  • ListDatabases
  • ListInferredRelationships
  • CompareIdFieldsToIds
  • GenerateSqlSchema
  • GenerateSqlSchemaAdvanced
  • GenerateSeedersForCollection
  • GenerateErdMermaid
  • GenerateErdPlantUml
  • GenerateErdDot

Example Copilot Prompts

  • "Use No2SQL to list my databases."
  • "Infer relationships for database mydb."
  • "Generate SQL schema for mydb."
  • "Generate Mermaid ERD for mydb with source sql."
  • "Generate SQL seeders for collection orders in mydb."

Security Guardrails

The server validates tool inputs and supports policy-based controls.

Environment variables:

  • NO2SQL_ALLOWED_DATABASES: Optional comma-separated allowlist.
  • NO2SQL_BLOCK_SYSTEM_DATABASES: Defaults to true; blocks admin, config, local.

Validation covers:

  • databaseName
  • collectionName
  • source values (sql, mongo, auto)
  • override fields (fromCollection, fromField, toCollection, toField)
  • prompt-injection marker patterns

Recommended baseline:

  1. Set a strict NO2SQL_ALLOWED_DATABASES allowlist.
  2. Keep NO2SQL_BLOCK_SYSTEM_DATABASES=true.

Build and Publish

Pack:

dotnet pack -c Release

Publish:

dotnet nuget push bin/Release/*.nupkg --api-key <your-api-key> --source https://api.nuget.org/v3/index.json

References

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.0 94 5/26/2026
0.1.0 126 5/4/2026

Initial stable release of the No2SQL MCP server package.