Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
No tool list is on record. This does not mean the server has no tools. Tools were not run.
No setup evidence yet No matching config or report on record. This does not mean the server is incompatible.
Same catalog task: Manage databases & data.
MCP server for interacting with MySQL databases with write operations support
Same catalog task: Manage databases & data.
MCP server for DBX — query databases from Claude Code, Cursor, and other AI agents
Same catalog task: Manage databases & data.
Enhanced PostgreSQL MCP server with read and write capabilities. Based on @modelcontextprotocol/server-postgres by Anthropic.
Fetched from the repository for this visit.
This is a Model Context Protocol (MCP) server that connects to one or more SQL Server databases; designed to be used by Visual Studio Code as a Copilot Agent.
Version 1.0.9.5 - Documentation Standardization & Tool Naming Consistency
Important: This version includes comprehensive documentation updates and tool naming standardization. All MCP tools now use consistent mssql_ prefixed names. Key improvements include:
mssql_ prefix (e.g., mssql_execute_query, mssql_get_table_metadata)Migration Note: While tool functionality remains unchanged, documentation and examples have been updated for consistency. See the RELEASE_NOTES.md for complete details.
Important: This project received significant security enhancements in November 2025. Please review the Security Update Documentation for:
Migration Required: Existing installations must configure authentication. See the Migration Guide for details.
This project implements an MCP server for SQL Server database connectivity, enabling VS Code and Copilot to interact with SQL databases via the Model Context Protocol.
Features include:
See How This Works for an overview of communication between Copilot, the LLM and this MSSQL Model Context Protocol Server.
This server provides three types of MCP endpoints:
POST /mcp: Handles tools/list and tools/call methodsSee the following documentation:
Set mandatory variables prior to starting MCP Server.
| Variable Name | Mandatory | Default Value | Recommended Values (Expected Format/Type) | Description |
|---|---|---|---|---|
MSSQL_MCP_KEY | Yes | The Start-MCP-Encrypted.ps1 will generate a secure random key if this variable is unset. To generate a secure encryption key you can use Generate-MCP-Key.ps1, to change the current key use Rotate-Encryption-Key.ps1 | A strong, cryptographically secure random string (e.g., 32 bytes, Base64 encoded). | The master encryption key used for AES-256 encryption of connection strings stored in the connections.db SQLite database. |
MSSQL_MCP_API_KEY | Yes | This is the master API key (Authorization Bearer token). If not set, API key authentication might be disabled or fall back to appsettings.json if configured there. The Set-Api-Key.ps1 script generates one. | A strong, cryptographically secure random string. | The master API key required for administrative access to the MCP server and for creating additional user API keys. User API keys are stored in the SQLite database and managed through the API. |
MSSQL_MCP_DATA | No | Data (A Data subdirectory in the application's root directory) | A valid file system path to a directory. | Overrides the default directory location for storing application data, most notably the connections.db SQLite database file. |
This project follows a clean architecture approach with separation of concerns:
See the full architecural documentation for diagrams and detailed process flow.
To run via a pre-built docker image download and run via hub.docker.com mcprunner/mssqlmcp
See QUICK_INSTALL
This project includes a robust connection management system that allows you to:
The MCP server includes built-in CORS support that can be configured through appsettings.json. This is particularly useful when integrating with web-based tools like Open WebUI.
CORS settings can be configured in the Cors section of appsettings.json:
{
"Cors": {
"AllowedOrigins": ["http://localhost:3000", "http://localhost:8080"],
"AllowedMethods": ["GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH"],
"AllowedHeaders": [
"Content-Type",
"Authorization",
"X-API-Key",
"X-Requested-With",
"Accept",
"Origin",
"Access-Control-Request-Method",
"Access-Control-Request-Headers"
],
"AllowCredentials": true,
"ExposedHeaders": ["Content-Disposition"]
}
}
For production environments, make sure to:
Connections are stored in a Sqlite database:
Data/connections.db file, providing persistent storageMSSQL_MCP_DATAThe project exposes connection management features through:
See QUICK_INSTALL
This script automatically generates a cryptographically secure random key using System.Security.Cryptography.RandomNumberGenerator, sets it as an environment variable, and starts the server with encryption enabled. You can also provide your own key:
$env:MSSQL_MCP_KEY = "ReplaceWithMyKeyForTheConnectionEncryption"
$env:MSSQL_MCP_API_KEY = "ReplaceWithMyApiKeyForClientAccess"
./Scripts/Start-MCP-Encrypted.ps1
For production environments, you should store the key securely and set the environment variable externally using a secrets management solution.
Use the included test script to verify connection management functionality:
./Scripts/test-connection-manager.ps1
This script demonstrates the full lifecycle of connection management including adding, testing, updating, and removing connections.
This MCP server provides comprehensive metadata retrieval functionality for SQL Server databases, allowing Copilot to understand and work with your database schemas effectively.
You can retrieve detailed information about database tables using the mssql_get_table_metadata tool:
#mssql_get_table_metadata connectionName="YourConnection" schema="dbo"
This provides complete table metadata including:
As of May 2025, the MCP server now supports retrieving metadata from SQL Server views in addition to tables. This allows Copilot to understand the structure of views and use them in queries.
You can retrieve metadata for both tables and views using the new mssql_get_database_objects_metadata tool:
#mssql_get_database_objects_metadata connectionName="YourConnection" schema="dbo" includeViews=true
The MCP server now also supports retrieving metadata from SQL Server stored procedures, including procedure definitions and parameters. This allows Copilot to understand and work with stored procedures in your database.
You can retrieve stored procedure metadata using the mssql_get_database_objects_metadata tool with the objectType parameter:
#mssql_get_database_objects_metadata connectionName="YourConnection" objectType=PROCEDURE
This provides detailed procedure metadata including:
You can filter database objects by type using the objectType parameter:
# Get only tables
#mssql_get_database_objects_metadata connectionName="YourConnection" objectType=TABLE
# Get only views
#mssql_get_database_objects_metadata connectionName="YourConnection" objectType=VIEW
# Get only stored procedures
#mssql_get_database_objects_metadata connectionName="YourConnection" objectType=PROCEDURE
# Get all database objects
#mssql_get_database_objects_metadata connectionName="YourConnection" objectType=ALL
You can also filter by schema:
# Get objects from a specific schema
#mssql_get_database_objects_metadata connectionName="YourConnection" schema="dbo" objectType=ALL
You can also filter by specific object types using the objectType parameter:
#mssql_get_database_objects_metadata connectionName="YourConnection" schema="dbo" objectType="VIEW"
Valid objectType values are:
The view metadata includes:
By setting includeViews=false, you can retrieve only table metadata, similar to the original mssql_get_table_metadata tool.
Here's an example of retrieving both tables and views from a database:
User: Show me all the database objects in my AdventureWorks2022 database, including views
Copilot: I'll retrieve the metadata for all database objects in the AdventureWorks2022 database, including both tables and views.
[Tool used: mssql_get_database_objects_metadata with connectionName="AdventureWorks2022" includeViews=true]
Results:
The AdventureWorks2022 database contains 68 tables and 20 views across multiple schemas:
Tables:
1. Person.Person - Information about customers, employees, and other individuals
2. Production.Product - Products sold by the company
// ...existing tables...
Views:
1. HumanResources.vEmployee - Employee information combining various related tables
2. Sales.vSalesPerson - Sales person information with their sales data
3. Person.vAdditionalContactInfo - Additional contact information for individuals
A testing script is available in Scripts/test-view-metadata.ps1 that demonstrates how to use the new view metadata functionality.
This MCP server is designed to work seamlessly with GitHub Copilot in VS Code, allowing you to interact with SQL Server databases using natural language.
Start the MCP server using the provided script:
# Start with encryption and API security enabled (recommended)
$env:MSSQL_MCP_KEY = "ReplaceWithMyKeyForTheConnectionEncryption"
$env:MSSQL_MCP_API_KEY = "ReplaceWithMyApiKeyForClientAccess"
./Scripts/Start-MCP-Encrypted.ps1
Configure Copilot to use this MCP server:
.vscode folderStart asking Copilot about your SQL databases!
You can ask Copilot questions like:
Behind the scenes, Copilot will use the MCP tools to:
For detailed instructions, see the Copilot Agent Guide.
The following MCP tools are available for Copilot:
See the full documentation for examples and detailed usage information.
User: Show me the relationships between tables in the Sales schema
Copilot: I'll get the foreign key relationships in the Sales schema for you.
[Tool used: mssql_get_table_metadata with connectionName="AdventureWorks2022", schema="Sales"]
Results:
I found the following relationships in the Sales schema:
1. SalesOrderDetail.SalesOrderID → SalesOrderHeader.SalesOrderID
2. SalesOrderDetail.ProductID → Production.Product.ProductID
3. SalesOrderHeader.CustomerID → Customer.CustomerID
4. SalesOrderHeader.SalesPersonID → SalesPerson.BusinessEntityID
5. SalesOrderHeader.TerritoryID → SalesTerritory.TerritoryID
6. SalesPerson.TerritoryID → SalesTerritory.TerritoryID
This shows that:
- SalesOrderDetail records are linked to SalesOrderHeader records
- SalesOrderDetail also references products from the Production schema
- SalesOrderHeader connects to Customer, SalesPerson, and SalesTerritory
- SalesPerson is associated with a specific SalesTerritory
User: Find the top 3 product categories by sales amount in the AdventureWorks2022 database
Copilot: I'll query the AdventureWorks2022 database to find the top product categories by sales.
[Tool used: mssql_execute_query with connectionName="AdventureWorks2022"]
Query:
SELECT TOP 3
PC.Name AS CategoryName,
SUM(SOD.LineTotal) AS SalesAmount
FROM Production.ProductCategory PC
JOIN Production.ProductSubcategory PSC ON PC.ProductCategoryID = PSC.ProductCategoryID
JOIN Production.Product P ON PSC.ProductSubcategoryID = P.ProductSubcategoryID
JOIN Sales.SalesOrderDetail SOD ON P.ProductID = SOD.ProductID
GROUP BY PC.Name
ORDER BY SalesAmount DESC
Results:
[
{
"CategoryName": "Bikes",
"SalesAmount": 28318144.9706
},
{
"CategoryName": "Components",
"SalesAmount": 1319863.9132
},
{
"CategoryName": "Clothing",
"SalesAmount": 340253.1788
}
]
The top 3 product categories by sales in the AdventureWorks2022 database are:
1. "Bikes" with $28,318,144.97 in sales
2. "Components" with $1,319,863.91 in sales
3. "Clothing" with $340,253.18 in sales
User: Get the sales summary for the top 3 sales territories in the most recent year
Copilot: I'll retrieve the sales summary for the top territories from the AdventureWorks2022 database.
[Tool used: mssql_execute_query with connectionName="AdventureWorks2022"]
Query:
WITH RecentYear AS (
SELECT MAX(YEAR(OrderDate)) AS MostRecentYear
FROM Sales.SalesOrderHeader
)
SELECT TOP 3
ST.Name AS Territory,
ST.CountryRegionCode AS Country,
SUM(SOH.TotalDue) AS TotalSales,
COUNT(DISTINCT SOH.CustomerID) AS CustomerCount,
COUNT(SOH.SalesOrderID) AS OrderCount,
MIN(SOH.OrderDate) AS FirstOrder,
MAX(SOH.OrderDate) AS LastOrder
FROM Sales.SalesTerritory ST
JOIN Sales.SalesOrderHeader SOH ON ST.TerritoryID = SOH.TerritoryID
JOIN RecentYear RY ON YEAR(SOH.OrderDate) = RY.MostRecentYear
GROUP BY ST.Name, ST.CountryRegionCode
ORDER BY TotalSales DESC
Results:
[
{
"Territory": "North America",
"Country": "US",
"TotalSales": 3519153.4118,
"CustomerCount": 487,
"OrderCount": 1573,
"FirstOrder": "2014-01-01T00:00:00.000Z",
"LastOrder": "2014-12-31T00:00:00.000Z"
},
{
"Territory": "Europe",
"Country": "GB",
"TotalSales": 2897231.9182,
"CustomerCount": 378,
"OrderCount": 1041,
"FirstOrder": "2014-01-01T00:00:00.000Z",
"LastOrder": "2014-12-31T00:00:00.000Z"
},
{
"Territory": "Pacific",
"Country": "AU",
"TotalSales": 1457240.8527,
"CustomerCount": 192,
"OrderCount": 531,
"FirstOrder": "2014-01-01T00:00:00.000Z",
"LastOrder": "2014-12-30T00:00:00.000Z"
}
]
These examples demonstrate how Copilot can help you explore relationships between tables, analyze data patterns, and perform complex queries across multiple tables in your SQL Server databases.
mssql_initialize_connection: Initializes the SQL Server connectionmssql_execute_query: Executes a SQL query and returns results as JSONmssql_get_table_metadata: Retrieves metadata about database tables, columns, keys, etc. You can filter by schema or get all schemas.mssql_get_database_objects_metadata: Retrieves metadata about tables, views, stored procedures and functions, including schemas, columns, and relationships.When used with GitHub Copilot in Visual Studio Code, the tools are available as functions that can be invoked in chat:
// Tool invocation pattern
f1e_mssql_initialize_connection({ connectionName: "DefaultConnection" });
f1e_mssql_execute_query({
connectionName: "AdventureWorks2022",
query: "SELECT TOP 5 * FROM Production.Product",
});
f1e_mssql_get_table_metadata({
connectionName: "AdventureWorks2022",
schema: "Sales",
});
f1e_mssql_get_database_objects_metadata({
connectionName: "AdventureWorks2022",
schema: "Person",
includeViews: true,
});
You'll typically interact with these tools by asking questions in natural language, and Copilot will handle the function calls automatically.
The mssql_get_table_metadata tool supports schema filtering, which allows you to retrieve metadata for tables in a specific schema:
// Get all database metadata (all schemas)
var metadata = await CallToolAsync("mssql_get_table_metadata", new { connectionName = "DefaultConnection" });
// Get metadata for a specific connection (all schemas)
var awMetadata = await CallToolAsync("mssql_get_table_metadata", new { connectionName = "AdventureWorks" });
// Get metadata for tables in a specific schema
var dboSchemaMetadata = await CallToolAsync("mssql_get_table_metadata", new { connectionName = "DefaultConnection", schema = "dbo" });
// Get metadata for a specific schema in a specific database
var awSalesSchema = await CallToolAsync("mssql_get_table_metadata", new { connectionName = "AdventureWorks", schema = "Sales" });
This feature is particularly useful when working with large databases that have many schemas, allowing you to focus on just the relevant parts of the database structure.
// Initialize the default connection
var result = await CallToolAsync("mssql_initialize_connection", new { connectionName = "DefaultConnection" });
// Or specify a specific connection
var adventureWorksResult = await CallToolAsync("mssql_initialize_connection", new { connectionName = "AdventureWorks" });
// Basic SELECT query
var users = await CallToolAsync("mssql_execute_query", new { query = "SELECT TOP 10 * FROM Users", connectionName = "DefaultConnection" });
// Query with parameters (handle SQL injection carefully)
var productQuery = "SELECT * FROM Products WHERE Category = 'Electronics' AND Price < 500";
var products = await CallToolAsync("mssql_execute_query", new { query = productQuery, connectionName = "DefaultConnection" });
// Query with specific connection
var salesData = await CallToolAsync("mssql_execute_query", new { query = "SELECT * FROM Sales.SalesOrderHeader", connectionName = "AdventureWorks" });
// Get all database metadata (all schemas)
var metadata = await CallToolAsync("mssql_get_table_metadata", new { connectionName = "DefaultConnection" });
// Get metadata for a specific connection (all schemas)
var awMetadata = await CallToolAsync("mssql_get_table_metadata", new { connectionName = "AdventureWorks" });
// Get metadata for tables in a specific schema
var dboSchemaMetadata = await CallToolAsync("mssql_get_table_metadata", new { connectionName = "DefaultConnection", schema = "dbo" });
// Get metadata for a specific schema in a specific database
var awSalesSchema = await CallToolAsync("mssql_get_table_metadata", new { connectionName = "AdventureWorks", schema = "Sales" });
-- Get all tables in the database
SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
ORDER BY TABLE_SCHEMA, TABLE_NAME
-- Get column information for a specific table
SELECT COLUMN_NAME, DATA_TYPE, IS_NULLABLE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'YourTableName'
ORDER BY ORDINAL_POSITION
-- Get primary key information
SELECT TC.TABLE_SCHEMA, TC.TABLE_NAME, KCU.COLUMN_NAME
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC
JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU
ON TC.CONSTRAINT_NAME = KCU.CONSTRAINT_NAME
WHERE TC.CONSTRAINT_TYPE = 'PRIMARY KEY'
ORDER BY TC.TABLE_SCHEMA, TC.TABLE_NAME
When using the MCP tools with GitHub Copilot, you might encounter some common issues:
If Copilot cannot connect to your database:
User: Show me all tables in the AdventureWorksLT database
Copilot: I'll try to retrieve the metadata from the AdventureWorksLT database.
[Tool used: mssql_get_table_metadata with connectionName="AdventureWorksLT"]
Error: Connection string 'AdventureWorksLT' was not found in the configuration.
Solution: Make sure the connection string is properly defined via mssql_list_connections.
If your SQL query has syntax errors:
User: Run this query: SELECT FROM Production.Product WHERE ListPrice < 100
Copilot: I'll execute this query for you.
[Tool used: mssql_execute_query with connectionName="AdventureWorks2022"]
Query: SELECT FROM Production.Product WHERE ListPrice < 100
Error: Incorrect syntax near the keyword 'FROM'.
Solution: Check that your SQL query follows proper syntax. In this case, you need to specify columns after SELECT.
When the connection name doesn't match exactly what's in your configuration:
User: Get tables from AdventureWorks database
Copilot: I'll get the tables from the AdventureWorks database.
[Tool used: mssql_get_table_metadata with connectionName="AdventureWorks"]
Error: Connection string 'AdventureWorks' was not found in the configuration.
Solution: Use the exact connection string name as defined in your configuration. In this case, use "AdventureWorks2022" instead of "AdventureWorks".
When querying non-existent objects:
User: Show me data from the Customers table
Copilot: I'll query the Customers table for you.
[Tool used: mssql_execute_query with connectionName="AdventureWorks2022"]
Query: SELECT TOP 10 * FROM Customers
Error: Invalid object name 'Customers'.
Solution: First use mssql_get_table_metadata to see which tables are available, then query the correct table name with the proper schema prefix if needed, e.g., "Sales.Customer".
To enhance security, connection strings are encrypted with AES-256 encryption before being stored in the SQLite database. The encryption key is derived from the environment variable MSSQL_MCP_KEY.
To enable secure connection string encryption:
MSSQL_MCP_KEY environment variable to a strong random value, orStart-MCP-Encrypted.ps1 script which will generate a cryptographically secure random key for you and start the server with encryption enabled.# Option 1: Set the encryption key manually (should be a strong random value)
$env:MSSQL_MCP_KEY = "ReplaceWithMyKeyForTheConnectionEncryption"
$env:MSSQL_MCP_API_KEY = "ReplaceWithMyApiKeyForClientAccess"
dotnet run
# Option 2: Use the automated script that handles key generation and server startup
$env:MSSQL_MCP_KEY = "ReplaceWithMyKeyForTheConnectionEncryption"
$env:MSSQL_MCP_API_KEY = "ReplaceWithMyApiKeyForClientAccess"
./Scripts/Start-MCP-Encrypted.ps1
The Scripts/Start-MCP-Encrypted.ps1 script:
If the MSSQL_MCP_KEY environment variable is not set and you don't use the script, the server will still function but will use a default insecure key. This is not recommended for production use. For production environments, consider using a secure secrets management solution to store and retrieve your encryption key.
Encrypt=True in your connection strings)MSSQL_MCP_KEY environment variable to rotate encryption keysFor more detailed testing, you can use the individual scripts:
# Start the server with encryption enabled
$env:MSSQL_MCP_KEY = "ReplaceWithMyKeyForTheConnectionEncryption"
$env:MSSQL_MCP_API_KEY = "ReplaceWithMyApiKeyForClientAccess"
./Scripts/Start-MCP-Encrypted.ps1
# Rotate the encryption key
./Scripts/Rotate-Encryption-Key.ps1
# Migrate unencrypted connections to encrypted format
$env:MSSQL_MCP_KEY = "ReplaceWithMyKeyForTheConnectionEncryption"
$env:MSSQL_MCP_API_KEY = "ReplaceWithMyApiKeyForClientAccess"
./Scripts/Migrate-To-Encrypted.ps1
Logs are stored in the Logs directory with daily rolling files. The logging configuration can be customized in the appsettings.json file under the Serilog section.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
The SQL Server MCP server includes robust security features to protect sensitive information such as connection strings.
All connection strings stored in the SQLite database are encrypted using AES-256 encryption with the following security measures:
MSSQL_MCP_KEY environment variableTo run the server with encryption enabled, use the provided script:
$env:MSSQL_MCP_KEY = "ReplaceWithMyKeyForTheConnectionEncryption"
$env:MSSQL_MCP_API_KEY = "ReplaceWithMyApiKeyForClientAccess"
./Scripts/Start-MCP-Encrypted.ps1
This script:
You can also provide your own key:
$env:MSSQL_MCP_KEY = "ReplaceWithMyKeyForTheConnectionEncryption"
$env:MSSQL_MCP_API_KEY = "ReplaceWithMyApiKeyForClientAccess"
./Scripts/Start-MCP-Encrypted.ps1
For production environments, you should store the key securely and set the environment variable externally using a secrets management solution.
The server supports rotating the encryption key to comply with security best practices. To rotate the key:
./Scripts/Rotate-Encryption-Key.ps1
This script:
After running the key rotation script, you must restart the server with the new key.
To migrate existing unencrypted connection strings to encrypted format:
./Scripts/Migrate-To-Encrypted.ps1
This script will encrypt any unencrypted connection strings in the database.
The following MCP commands are available for security operations:
# Rotate the encryption key
#security.rotateKey newKey="your-new-key"
# Migrate unencrypted connections to encrypted format
#security.migrateConnectionsToEncrypted
# Generate a secure random key for encryption
#security.generateSecureKey length=32
# Verify encryption status of connections
#security.verifyEncryptionStatus
# Assess connection security
#security.assessConnectionSecurity
Each of these commands connects to the functionality in the SecurityTool.cs class, which implements the MCP server tools for security operations. These commands follow the standard MCP command syntax with the # prefix.
The SQL Server MCP server includes enhanced security features for validating connections and assessing security status:
When rotating keys or encrypting connections, the system:
Use the included security assessment script to evaluate your connection security:
./Scripts/Assess-Connection-Security.ps1
This script:
For comprehensive security testing, use:
./Test-Security-Features.ps1
This enhanced testing script:
For detailed security information, see the Security Documentation.
The MCP server implements a robust multi-key API authentication system to secure API endpoints. This system supports both a master API key for administrative access and multiple user-specific API keys for regular access.
For detailed information about the multi-key authentication system, see MultiKeyAuthentication.md.
./Scripts/Set-Api-Key.ps1
This script will:
MSSQL_MCP_API_KEY for the current session# PowerShell example to create a new user API key
Invoke-RestMethod -Uri "http://localhost:3001/mcp" -Method Post `
-Headers @{"Authorization" = "Bearer your-master-api-key"; "Content-Type" = "application/json"} `
-Body '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "mssql_create_key",
"arguments": {
"name": "User API Key",
"userId": "user123",
"keyType": "user",
"expirationDate": "2026-06-29T00:00:00Z"
}
}
}'
The master API key can be configured in different ways:
Environment Variable: Set MSSQL_MCP_API_KEY environment variable
$env:MSSQL_MCP_API_KEY = "your-secure-master-api-key"
Application Settings: Configure in appsettings.json under the ApiSecurity section:
"ApiSecurity": {
"HeaderName": "X-API-Key",
"ApiKey": "your-secure-master-api-key"
}
User-specific API keys are managed through the API endpoints and stored securely in the SQLite database.
When API key authentication is enabled, all HTTP requests to the server must include either the master API key or a valid user API key as a Bearer token in the Authorization header:
# PowerShell example
Invoke-RestMethod -Uri "http://localhost:3001/" -Method Post `
-Headers @{"Authorization" = "Bearer your-api-key"; "Content-Type" = "application/json"} `
-Body '{"jsonrpc": "2.0", "id": 1, "method": "#TestConnection", "params": {"ConnectionName": "My_DBCONNECTION_Name"}}'
# curl example
curl -X POST http://localhost:3001/ -H "Authorization: Bearer your-api-key" -H "Content-Type: application/json" `
-d '{"jsonrpc": "2.0", "id": 1, "method": "#TestConnection", "params": {"ConnectionName": "My_DBCONNECTION_Name"}}'
The MCP server provides endpoints for managing API keys:
mssql_create_key: Create a new API key for a specific user
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "mssql_create_key",
"arguments": {
"name": "My Test API Key",
"userId": "SomeUserId",
"keyType": "user",
"expirationDate": "2026-06-29T00:00:00Z"
}
}
}
mssql_list_user_keys: List all API keys for a specific user
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "mssql_list_user_keys",
"arguments": {
"userId": "SomeUserId"
}
}
}
mssql_list_all_keys: List all API keys in the system (admin only)
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "mssql_list_all_keys",
"arguments": {}
}
}
mssql_revoke_key: Revoke an API key (mark as inactive)
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "mssql_revoke_key",
"arguments": {
"request": {
"id": "key-id-to-revoke"
}
}
}
}
mssql_delete_key: Permanently delete an API key
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "mssql_delete_key",
"arguments": {
"id": "key-id-to-delete"
}
}
}
mssql_get_key_usage_logs: Get usage logs for a specific API key
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "mssql_get_key_usage_logs",
"arguments": {
"apiKeyId": "target-key-id",
"limit": 100
}
}
}
mssql_get_user_usage_logs: Get API usage logs for a specific user
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "mssql_get_user_usage_logs",
"arguments": {
"userId": "target-user-id",
"limit": 100
}
}
}
Loading reviews...
GitHub freshness not yet checked. Recently viewed repositories target hourly refresh.
Find a documented setup for your client. No sign-in, installation, or tool execution.
If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.