mcp-server

Muhammad-Idzhans/mcp-server

3.2

If you are the rightful owner of 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 dayong@mcphub.com.

The Model Context Protocol (MCP) server is a lightweight and efficient server designed to handle model context protocols using a minimalistic approach. It is built with TypeScript and leverages various tools and libraries to provide a robust and scalable solution.

Tools
1
Resources
0
Prompts
0

API Endpoint MCP Server

Tools existed inside this MCP Server (As 10 September 2025):

  1. SQL tools for different databases (Postgres, MySQL, SQL, Oracle)

SQL tools for different databases (Postgres, MySQL, SQL, Oracle)

After you deploying the MCP Server on the website, you will get a particular link called Base URL. With that link, you be able to access some information through the endpoints that is specified. If your Base URL such as http://localhost:8787, then you can use the endpoints as http://localhost:8787/health. You can test the endpoints using Postman as well.

This MCP Server do manage multiple databases of the same type and even from different types. Each of the DB type can be confirgured by putting ',' at the specific environment names for the one that have more than one database. For example:

# SQL Environment Variables
MSSQL_HOST=hans-server.database.windows.net, hans-server.database.windows.net, hans-server.database.windows.net
MSSQL_PORT=1433, 1433, 1433
MSSQL_USER=IdzhansKhairi, IdzhansKhairi, IdzhansKhairi
MSSQL_PASSWORD=iloveEnfrasys@123, iloveEnfrasys@123, iloveEnfrasys@123
MSSQL_DB=mssql-mcp, coffee_database, pastry_database

Other that that, the MCP Server also do supports multiple sessions at the same time. This means that two users be able to access the chatbot at the same time and access the MCP Server tools at the same time.

Notes: The MCP Server currently does not have authentication yet to make sure which users be able to access certain database and certain data.

Below are the endpoints under the SQL Tools:

MethodEndpointDescription
GET/dbsLists all configured databases.
GET/healthHealth check endpoint (server status).
GET/dbsList all databases name from all database type
GET/dbs/aliasesList all databases aliases from all database type
GET/dbs/typesList all available databases types
GET/dbs/list-by-typeHealth check endpoint (server status).
POST/sql/queryExecutes an SQL query against a database.

To specify what should be sent to the /sql/query, you have to send in JSON form with 2 information:

  1. "db" : To specify what kind of database that we wanted it to be connected to.
    • "pg" : PostgreSQL
    • "mysql" : MySQL
    • "mssql" : Microsoft SQL
    • "oracle": Oracle
  2. "sql" : SQL Queries based on the database used.

Below is the exact format:

{
  "db": "mysql",                            // Database Type
  "sql": "SELECT * FROM orders LIMIT 10;"   // SQL queries based on db type
}

Database Used and Data

In this project, multiple relational database system were tested to ensure compatibility with the MCP Server. The database used are:

  • PostgreSQL
  • MySQL
  • Microsoft SQL Server (MSSQL)
  • Oracle Database

Each database contains two custom tables with a few sample rows of data.

  • The tables are designed with different themes per database (e.g., hospital system, university system, employee system, etc.) so that outputs can be easily distinguished during testing.
  • This prevents confusion when retrieving results and makes it clear which database the data originated from.

1) POSTGRESQL DATABASE (Library System)

TABLE NAME: books

book_idtitleauthorgenreyear_published
1The Silent ForestJohn RiversFiction2015
2Data Science SimplifiedAlice TanEducation2020
2Demon Slayer: Kimetsu no YaibaKoyoharu GotougeFiction2016

TABLE NAME: members

member_idnameemailjoin_dateactive
101Sarah Limsarah@example.com2021-03-10true
102Ahmad Zakiahmad.zaki@example.com2022-07-22false
103Megan Raajmegan.raaj@example.com2025-09-10false

Testing Using Postman to retrieve information:

// Get all table
{
  "db": "pg",
  "sql": "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' AND table_type = 'BASE TABLE' ORDER BY table_name"
}

// List all tables with columns + contents
{
  "db": "pg",
  "sql": "SELECT c.table_name, c.column_name, c.data_type FROM information_schema.columns c JOIN information_schema.tables t ON c.table_name = t.table_name WHERE t.table_schema = 'public' AND t.table_type = 'BASE TABLE' ORDER BY c.table_name, c.ordinal_position;"
}

// List contents of a specific table with its columns - "SELECT * FROM <table-name> LIMIT 10;"
{
  "db": "pg",
  "sql": "SELECT * FROM books LIMIT 10;"
}

2) MYSQL DATABASE (E-commerce Store)

TABLE NAME: products

product_idnamecategorypricestock
501Laptop X100Electronics3500.0015
502Running ShoesSports280.0050
503Office TableFurniture200.0010

TABLE NAME: orders

order_idproduct_idcustomer_namequantityorder_date
9001501Daniel Wong12024-12-15
9002502Mei Li22025-01-20
9003503Syahid Akbar22025-09-10

Testing Using Postman to retrieve information:

// Get all table
{
  "db": "mysql",
  "sql": "SELECT TABLE_NAME FROM information_schema.tables WHERE TABLE_SCHEMA = DATABASE() AND TABLE_TYPE = 'BASE TABLE' ORDER BY TABLE_NAME"
}

// List all tables with columns + contents
{
  "db": "mysql",
  "sql": "SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = DATABASE() ORDER BY TABLE_NAME, ORDINAL_POSITION;"
}

// List contents of a specific table with its columns - "SELECT * FROM <table-name> LIMIT 10;"
{
  "db": "mysql",
  "sql": "SELECT * FROM orders LIMIT 10;"
}

3) MSSQL DATABASE (Hospital Management)
  • There will be 3 database for mssql to simulate the ability to use 3 database in the same type at one time- These MSSQL Database is deployed in the Azure SQL Database and it has 3 database which is mssql-mcp, coffee_databaseand pastry_database.
  • Each of these databases will be having 2 tables with 3 rows for each tables.

DATABASE 1: mssql-mcp

TABLE NAME: patients

patient_idfull_namedobblood_typeadmitted
P001Kevin Smith1990-05-21O+2025-02-01
P002Aisha Rahman1985-11-03A-2025-02-07
P003Ariff Hafizal2001-08-06AB2025-09-01

TABLE NAME: doctors

doctor_idnamespecialtyphoneavailable
D001Dr. MichaelCardiology012-3456789Yes
D002Dr. Nur FarahPediatrics019-8765432No
D003Dr. Abd. RahmanSurgeon011-78150955Yes

DATABASE 2: coffee_database

TABLE NAME: CoffeeBeans

bean_idbean_nameoriginroast_level
1ArabicaBrazilMedium
2RobustaVietnamDark
3LibericaMalaysiaLight

TABLE NAME: CoffeeDrinks

drink_iddrink_namebean_idmilk_typeprice
1Latte1Whole4.5
2Espresso2None3.0
3Kopi Liberica3Condensed2.5

DATABASE 3: pastry_database

TABLE NAME: Pastries

pastry_idpastry_nameoriginmain_flavor
1CroissantFranceButter
2Egg TartHong KongCustard
3Kuih LapisMalaysiaCoconut

TABLE NAME: PastryOrders

order_idpastry_idcustomer_namequantityprice
11Aisha27.0
22John39.0
33Mei Ling14.5

Testing Using Postman to retrieve information:

// Get all table
{
  "db": "mssql",
  "sql": "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' ORDER BY TABLE_NAME"
}

// List all tables with columns + contents
{
  "db": "mssql",
  "sql": "SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS ORDER BY TABLE_NAME, ORDINAL_POSITION;"
}

// List contents of a specific table with its columns - "SELECT TOP 10 * FROM <table-name>;"
{
  "db": "mssql",
  "sql": "SELECT TOP 10 * FROM Doctors;"
}

4) ORACLE DATABASE (University System)

TABLE NAME: COURSES

course_idcourse_namedepartmentcreditssemester
CSE101Intro to Computer ScienceComputing4Fall
BUS201Marketing BasicsBusiness3Spring
ENG301ThermodynamicsEngineering4Fall

TABLE NAME: STUDENTS

student_idnamemajorgpaenrollment_year
S1001Raj KumarComputer Science3.82021
S1002Emily TanBusiness Administration3.52020
S1003Ahmad AliMechanical Engineering3.22019

Testing Using Postman to retrieve information:

// Get all table
{
  "db": "oracle",
  "sql": "SELECT DISTINCT table_name FROM user_tab_columns WHERE table_name NOT LIKE 'ROLLING$%' AND table_name NOT LIKE 'SCHEDULER_%' -- AND UPPER(table_name) NOT IN (<your excludedOracleTables uppercased>) ORDER BY table_name"
}

// List all tables with columns + contents
{
  "db": "oracle",
  "sql": "SELECT table_name, column_name, data_type FROM user_tab_columns ORDER BY table_name, column_id"
}

// List contents of a specific table with its columns
{
  "db": "oracle",
  "sql": "SELECT * FROM COURSES"
}

Database Environments

The MCP Server uses environment variables for database connections.

  • Not all environments are required. Only put the database that is required/existed.
  • If an environment for a database type is missing, the server will still run (It can be used for all database or just use for your desired database).
  • This project do supports SQLite but it will not be focused on since SQLite is usually for the local testing.
  • If more than one of the same database type appears, the put , in between for each of the variable. For example:
MSSQL_USER=user1, user2
MSSQL_PASSWORD=pass1, pass2
MSSQL_DB=dbName1, dbName2
VariableUsage / DescriptionExample Value
MYSQL_HOSTHostname or IP address of the MySQL server127.0.0.1
MYSQL_PORTPort number for the MySQL server (default: 3306)3306
MYSQL_USERUsername to authenticate with the MySQL serverroot
MYSQL_PASSWORDPassword for the MySQL usermypassword
MYSQL_DBName of the MySQL database to connect totest_db
PG_HOSTHostname or IP address of the PostgreSQL server127.0.0.1
PG_PORTPort number for the PostgreSQL server (default: 5432)5432
PG_USERUsername to authenticate with the PostgreSQL serverpostgres
PG_PASSWORDPassword for the PostgreSQL usersecret123
PG_DBName of the PostgreSQL database to connect tosampledb
MSSQL_HOSTHostname or IP address of the Microsoft SQL Server127.0.0.1
MSSQL_PORTPort number for the Microsoft SQL Server (default: 1433)1433
MSSQL_USERUsername to authenticate with the Microsoft SQL Serversa
MSSQL_PASSWORDPassword for the Microsoft SQL Server userP@ssw0rd!
MSSQL_DBName of the Microsoft SQL Server database to connect tohospital_db
ORACLE_CONNECT_STRINGOracle EZConnect string in the format host:port/service_name127.0.0.1:1521/XEPDB1
ORACLE_USERUsername to authenticate with the Oracle databasesystem
ORACLE_PASSWORDPassword for the Oracle useroracle123

MCP Tools Available

Copilot Studio (and any LLM-based orchestration) uses tool name + description + input schema to decide which tool to call. If descriptions are vague or repetitive, the model struggles to pick the right tool or understand when to use it. So far, these are the tools together with its description that we can refer. Any changes on the description can be done back in the src/tools/sql/index.ts.

Note: <database-type-number>.sql.peek/schema/query will be keep on adding depending on how many database for each type is added.

Tool NameDescription
db.aliasesReturn the list of available database aliases created/available on this server (e.g., mysql, mssql, mssql_2, pg, oracle). Call this first to discover which DBs you can query.
db.typesList available database dialects (types), e.g., MySQL, PostgreSQL, MSSQL, Oracle.
db.namesList database names (not aliases) across all configured databases (unique, sorted).
db.listByTypeList database names for a given dialect (type). unique=true (default) returns unique names; set unique=false for one row per alias; includeAliases=true to add alias.
mysql.sql.peekReturn up to N rows from each base table in the chosen database. Dialect-aware and read-only. Use this to quickly inspect unknown schemas. If you provide 'db' (database name, not alias), this tool will resolve the right DB at runtime. Optionally provide 'type' (mysql pg mssql oracle sqlite) to disambiguate.
mysql.sql.schemaReturn a compact Markdown outline of tables and columns for the chosen database. If you provide 'db' (database name, not alias), this tool will resolve the right DB at runtime. Optionally provide 'type' to disambiguate.
mysql.sql.queryExecute a parameterized SQL query against the chosen database. If you provide 'db' (database name, not alias), the target DB is resolved at runtime. Optionally provide 'type' to disambiguate databases with the same name. Usage Tips: 1. Use a single SELECT statement. 2. Always use :name placeholders (e.g., :from, :limit). 3. Avoid INSERT, UPDATE, DELETE unless explicitly allowed. 4. Use exact table/column names (call sql.schema first if unsure). 5. Add LIMIT/TOP/ROWNUM to keep results small. 6. Prefer ANSI SQL over vendor-specific syntax.
pg.sql.peekReturn up to N rows from each base table in the chosen database. Dialect-aware and read-only. Use this to quickly inspect unknown schemas. If you provide 'db' (database name, not alias), this tool will resolve the right DB at runtime. Optionally provide 'type' (mysql pg mssql oracle sqlite) to disambiguate.
pg.sql.schemaReturn a compact Markdown outline of tables and columns for the chosen database. If you provide 'db' (database name, not alias), this tool will resolve the right DB at runtime. Optionally provide 'type' to disambiguate.
pg.sql.queryExecute a parameterized SQL query against the chosen database. If you provide 'db' (database name, not alias), the target DB is resolved at runtime. Optionally provide 'type' to disambiguate databases with the same name. Usage Tips: 1. Use a single SELECT statement. 2. Always use :name placeholders (e.g., :from, :limit). 3. Avoid INSERT, UPDATE, DELETE unless explicitly allowed. 4. Use exact table/column names (call sql.schema first if unsure). 5. Add LIMIT/TOP/ROWNUM to keep results small. 6. Prefer ANSI SQL over vendor-specific syntax.
mssql.sql.peekReturn up to N rows from each base table in the chosen database. Dialect-aware and read-only. Use this to quickly inspect unknown schemas. If you provide 'db' (database name, not alias), this tool will resolve the right DB at runtime. Optionally provide 'type' (mysql pg mssql oracle sqlite) to disambiguate.
mssql.sql.schemaReturn a compact Markdown outline of tables and columns for the chosen database. If you provide 'db' (database name, not alias), this tool will resolve the right DB at runtime. Optionally provide 'type' to disambiguate.
mssql.sql.queryExecute a parameterized SQL query against the chosen database. If you provide 'db' (database name, not alias), the target DB is resolved at runtime. Optionally provide 'type' to disambiguate databases with the same name. Usage Tips: 1. Use a single SELECT statement. 2. Always use :name placeholders (e.g., :from, :limit). 3. Avoid INSERT, UPDATE, DELETE unless explicitly allowed. 4. Use exact table/column names (call sql.schema first if unsure). 5. Add LIMIT/TOP/ROWNUM to keep results small. 6. Prefer ANSI SQL over vendor-specific syntax.
mssql_2.sql.peekReturn up to N rows from each base table in the chosen database. Dialect-aware and read-only. Use this to quickly inspect unknown schemas. If you provide 'db' (database name, not alias), this tool will resolve the right DB at runtime. Optionally provide 'type' (mysql pg mssql oracle sqlite) to disambiguate.
mssql_2.sql.schemaReturn a compact Markdown outline of tables and columns for the chosen database. If you provide 'db' (database name, not alias), this tool will resolve the right DB at runtime. Optionally provide 'type' to disambiguate.
mssql_2.sql.queryExecute a parameterized SQL query against the chosen database. If you provide 'db' (database name, not alias), the target DB is resolved at runtime. Optionally provide 'type' to disambiguate databases with the same name. Usage Tips: 1. Use a single SELECT statement. 2. Always use :name placeholders (e.g., :from, :limit). 3. Avoid INSERT, UPDATE, DELETE unless explicitly allowed. 4. Use exact table/column names (call sql.schema first if unsure). 5. Add LIMIT/TOP/ROWNUM to keep results small. 6. Prefer ANSI SQL over vendor-specific syntax.
mssql_3.sql.peekReturn up to N rows from each base table in the chosen database. Dialect-aware and read-only. Use this to quickly inspect unknown schemas. If you provide 'db' (database name, not alias), this tool will resolve the right DB at runtime. Optionally provide 'type' (mysql pg mssql oracle sqlite) to disambiguate.
mssql_3.sql.schemaReturn a compact Markdown outline of tables and columns for the chosen database. If you provide 'db' (database name, not alias), this tool will resolve the right DB at runtime. Optionally provide 'type' to disambiguate.
mssql_3.sql.queryExecute a parameterized SQL query against the chosen database. If you provide 'db' (database name, not alias), the target DB is resolved at runtime. Optionally provide 'type' to disambiguate databases with the same name. Usage Tips: 1. Use a single SELECT statement. 2. Always use :name placeholders (e.g., :from, :limit). 3. Avoid INSERT, UPDATE, DELETE unless explicitly allowed. 4. Use exact table/column names (call sql.schema first if unsure). 5. Add LIMIT/TOP/ROWNUM to keep results small. 6. Prefer ANSI SQL over vendor-specific syntax.
oracle.sql.peekReturn up to N rows from each base table in the chosen database. Dialect-aware and read-only. Use this to quickly inspect unknown schemas. If you provide 'db' (database name, not alias), this tool will resolve the right DB at runtime. Optionally provide 'type' (mysql pg mssql oracle sqlite) to disambiguate.
oracle.sql.schemaReturn a compact Markdown outline of tables and columns for the chosen database. If you provide 'db' (database name, not alias), this tool will resolve the right DB at runtime. Optionally provide 'type' to disambiguate.
oracle.sql.queryExecute a parameterized SQL query against the chosen database. If you provide 'db' (database name, not alias), the target DB is resolved at runtime. Optionally provide 'type' to disambiguate databases with the same name. Usage Tips: 1. Use a single SELECT statement. 2. Always use :name placeholders (e.g., :from, :limit). 3. Avoid INSERT, UPDATE, DELETE unless explicitly allowed. 4. Use exact table/column names (call sql.schema first if unsure). 5. Add LIMIT/TOP/ROWNUM to keep results small. 6. Prefer ANSI SQL over vendor-specific syntax.

Deployment to Azure Web App

Delete the existing node_modules and installs dependencies exactly as listed in your package-lock.json (ci = clean install):

npm ci

Runs the build script in your package.json under "scripts":

npm run build

Remove of the directory if exist:

if exist srcpkg rmdir /s /q srcpkg

Make directory to be zipped:

mkdir srcpkg

Copy project sources and assets Oryx needs. If you read any templates at runtime, include them too. DO NOT copy node_modules (Oryx will install on Linux):

xcopy src srcpkg\src\ /E /I /Y
copy package.json srcpkg\
copy package-lock.json srcpkg\ >NUL 2>&1
copy tsconfig.json srcpkg\ >NUL 2>&1
copy dbs.yaml srcpkg\ >NUL 2>&1
copy policies.yaml srcpkg\ >NUL 2>&1
if exist src\tools\sql\templates xcopy src\tools\sql\templates srcpkg\src\tools\sql\templates\ /E /I /Y

Build a ZIP whose root is the content (not a nested folder):

if exist artifact-src.zip del /f /q artifact-src.zip
tar -a -c -f artifact-src.zip -C srcpkg .

Azure Login:

az login

Set runtime to Node 20 LTS:

az webapp config set -g <resource-group> -n <web-app-name> --linux-fx-version "NODE|20-lts"

Enable build automation (Oryx):

az webapp config appsettings set -g <resource-group> -n <web-app-name> --settings SCM_DO_BUILD_DURING_DEPLOYMENT=true NPM_CONFIG_PRODUCTION=false

Deploy to Azure:

az webapp deploy -g <resource-group> -n <web-app-name> --src-path artifact-src.zip

Enable Logs and Monitor to view (In another cmd):

az webapp log config -g <resource-group> -n <web-app-name> --application-logging filesystem --docker-container-logging filesystem --level information

az webapp log tail -g <resource-group> -n <web-app-name>

Find the outbound IP - to put in the SQL Server if your server is inside Azure

az webapp show -g <resource-group> -n <web-app-name> --query outboundIpAddresses -o tsv

Using REST API Endpoints in Azure AI Foundry Agents

If you want to use API Endpoints instead of MCP endpoints in your Azure AI Foundry, you can register them as a Custom Tool using the OpenAPI 3.0 Specified Tool.

Here’s a sample .json schema you can use. Just change the url with the right Azure Web App URL:

{
  "openapi": "3.0.1",
  "info": {
    "title": "MCP SQL Server API",
    "version": "1.0.0",
    "description": "REST API wrapper for MCP SQL server endpoints."
  },
  "servers": [
    {
      "url": "https://<web-app-link>"
    }
  ],
  "paths": {
    "/dbs": {
      "get": {
        "summary": "List all databases",
        "operationId": "listDatabases",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/dbs/aliases": {
      "get": {
        "summary": "List all database aliases",
        "operationId": "listDatabaseAliases",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/dbs/types": {
      "get": {
        "summary": "List all SQL database types/engines/dialect",
        "operationId": "listDatabaseTypes",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/dbs/list-by-type": {
      "get": {
        "summary": "List all SQL database names available by types/engines/dialect",
        "operationId": "listDatabaseByTypes",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sql/query": {
      "post": {
        "summary": "Execute SQL query against a database",
        "operationId": "executeSqlQuery",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "db": {
                    "type": "string",
                    "description": "The database name to run the query on based on user input"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "mysql",
                      "mssql",
                      "oracle",
                      "pg"
                    ],
                    "description": "The type of database engine/dialect"
                  },
                  "sql": {
                    "type": "string",
                    "description": "The SQL query to execute based on the database type"
                  }
                },
                "required": [
                  "db",
                  "type",
                  "sql"
                ]
              },
              "example": {
                "db": "pastry_database",
                "type": "mssql",
                "sql": "SELECT TOP 10 * FROM PastryOrders;"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Query executed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}