Skip to content

Add comprehensive authentication documentation and multi-auth support #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hlgr360
Copy link

@hlgr360 hlgr360 commented Jul 10, 2025

Summary

This PR adds comprehensive authentication documentation and enhances the MCP server to support multiple authentication methods for connecting to MSSQL databases.

Changes Made

Documentation (README.md)

  • Added detailed "Authentication Configuration" section with three supported methods:
    • Azure Active Directory (default) - for Azure SQL Database
    • SQL Server Authentication - for traditional SQL Server instances
    • Windows Authentication (NTLM) - for on-premises domain authentication
  • Provided complete configuration examples for each authentication method
  • Organized configuration parameters into "Common" and "Authentication-Specific" sections
  • Updated all MCP configuration examples to be consistent
  • Added environment variable documentation for all authentication methods

Code Enhancement (src/index.ts)

  • Enhanced createSqlConfig() function to support multiple authentication methods
  • Added configurable authentication via AUTH_METHOD environment variable
  • Implemented proper token management and connection reuse for Azure AD
  • Added support for SQL Server and Windows authentication methods
  • Improved connection handling for different authentication types

Environment Variables Added

  • AUTH_METHOD: Specifies authentication method (azure-ad, sql, windows)
  • SQL_USERNAME & SQL_PASSWORD: For SQL Server authentication
  • USERNAME, PASSWORD & DOMAIN: For Windows authentication

Benefits

  • Provides flexibility for different deployment scenarios
  • Maintains backward compatibility (defaults to Azure AD)
  • Improves security by supporting appropriate auth methods per environment
  • Clear documentation for easy setup and configuration

Testing

  • Tested with MS SQL Server for SQL Server Auth
  • Code structure supports SQL Server and Windows auth (requires appropriate environment for testing)

- Add detailed authentication configuration section to README
- Document Azure AD (default), SQL Server, and Windows authentication methods
- Include complete configuration examples for each authentication type
- Organize configuration parameters by common and auth-specific
- Update existing MCP configuration examples
- Enhance index.ts with multi-authentication support
- Add environment variable documentation for all auth methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants