Skip to content

Add Basic Authentication support for on-premises Business Central#8

Open
bimiscusi wants to merge 2 commits intoknowall-ai:mainfrom
miscusitech:claude/add-basic-auth-support-nQPYX
Open

Add Basic Authentication support for on-premises Business Central#8
bimiscusi wants to merge 2 commits intoknowall-ai:mainfrom
miscusitech:claude/add-basic-auth-support-nQPYX

Conversation

@bimiscusi
Copy link

Summary

This PR adds support for HTTP Basic authentication to enable the MCP server to connect to on-premises Business Central servers. Previously, only Azure CLI and client credentials authentication methods were supported, limiting usage to cloud-based deployments.

Key Changes

  • Authentication Method: Added basic as a new authentication type alongside existing azure_cli and client_credentials options
  • Configuration: Added two new environment variables:
    • BC_USERNAME: Business Central username
    • BC_PASSWORD: Web service access key or password
  • Client Implementation: Updated BusinessCentralClient to handle Basic auth by encoding credentials in Base64 and setting the Authorization header
  • Validation: Added environment variable validation to ensure required credentials are provided when using basic auth
  • Documentation:
    • Updated README with basic auth configuration examples
    • Added comprehensive setup instructions for on-premises servers
    • Updated authentication recommendation to guide users based on deployment type (cloud vs on-premises)
  • Smithery Config: Added UI configuration fields for username and password in smithery.yaml
  • Version Bump: Updated package version from 0.1.1 to 0.1.2

Implementation Details

  • Basic auth header is computed once during client initialization and reused for all requests, avoiding repeated encoding
  • The implementation follows the same pattern as token-based auth, with a unified request method that handles both authentication types
  • On-premises server URLs typically use port 7048 with format: https://{server}:{port}/{instance}/api/v2.0
  • Web service access keys are recommended over passwords for improved security

https://claude.ai/code/session_01KhpN4Ho9C1xWtYPJhhygZe

Adds a new `basic` authentication type alongside the existing `azure_cli`
and `client_credentials` methods. This enables connecting to on-premises
Business Central servers that use Windows or NavUserPassword authentication
via HTTP Basic auth (BC_USERNAME/BC_PASSWORD environment variables).

https://claude.ai/code/session_01KhpN4Ho9C1xWtYPJhhygZe
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