Overview
The MCP Server with LangGraph uses YAML configuration files and environment variables for flexible, declarative configuration. This reference documents all configuration files and their options..env.example
Complete environment variable template for service configuration
ldap_mappers.yaml
LDAP/AD attribute mapping configuration
oidc_providers.yaml
OpenID Connect provider definitions
role_mappings.yaml
Keycloak to OpenFGA role mapping rules
.env.example
Complete environment variable template for configuring the MCP Server with LangGraph.Location
Usage
Configuration Sections
Service Configuration
Service Configuration
LLM Provider Configuration
LLM Provider Configuration
- google: Gemini (AI Studio or Vertex AI)
- anthropic: Claude models
- openai: GPT-4, GPT-3.5
- azure: Azure OpenAI
- bedrock: AWS Bedrock
- ollama: Local models
API Keys (Provider-Specific)
API Keys (Provider-Specific)
- Google Gemini
- Anthropic
- OpenAI
- Azure OpenAI
- AWS Bedrock
- Ollama
Authentication & Authorization
Authentication & Authorization
Keycloak Configuration
Keycloak Configuration
Session Management
Session Management
Secrets Management (Infisical)
Secrets Management (Infisical)
Observability
Observability
LangGraph Configuration
LangGraph Configuration
Security Best Practices
1
Generate Strong Secrets
2
Use Secrets Management
Production deployments should use:
- Kubernetes Secrets
- External Secrets Operator
- Infisical (integrated)
- HashiCorp Vault
- AWS Secrets Manager
3
Environment-Specific Files
config/ldap_mappers.yaml
Defines how LDAP/Active Directory attributes map to Keycloak user attributes.Location
Used By
Structure
Attribute Mappers
Attribute Mappers
Maps LDAP attributes to Keycloak user attributes.Standard Mappings:
mail→emailgivenName→firstNamesn→lastNamedisplayName→displayNamedepartment→departmenttitle→titletelephoneNumber→phoneNumbermobile→mobilePhoneemployeeNumber→employeeNumbermanager→manager
Group Mapper
Group Mapper
Synchronizes LDAP groups to Keycloak groups.Parameters:
groups_dn: Base DN for group searchgroup_name_attribute: Attribute containing group name (usuallycn)membership_attribute: Attribute listing group members (AD:member)preserve_inheritance: Maintain group hierarchymode:READ_ONLY(groups managed in LDAP only)
Sync Settings
Sync Settings
Controls synchronization schedule and behavior.Sync Types:
- Full sync: Complete LDAP directory scan
- Changed sync: Only changed users (requires USN changed attribute)
Role Mappings
Role Mappings
Maps LDAP groups to Keycloak roles.Users in the LDAP group automatically get assigned the corresponding Keycloak role.
Customization
- Active Directory
- Generic LDAP
- Custom Attributes
Default configuration works with AD. Common AD attributes:
sAMAccountName: UsernameuserPrincipalName: UPN (email-like)distinguishedName: DNmemberOf: Group memberships
Related ADRs
config/oidc_providers.yaml
Defines OpenID Connect identity provider configurations for federation.Location
Used By
Structure
Provider Configuration
Provider Configuration
Each provider has:
- Basic settings (alias, display name, enabled)
- OIDC endpoints and credentials
- Attribute mappers (claims → user attributes)
Built-in Providers
Built-in Providers
Keycloak has built-in support for:Get credentials from Google Cloud Console
- Google
- Microsoft
- GitHub
Custom OIDC Providers
Custom OIDC Providers
For Okta, Auth0, OneLogin, or custom OIDC providers:
- Okta
- Auth0
- Generic Template
Attribute Mappers
Attribute Mappers
Maps OIDC claims to Keycloak user attributes:Standard OIDC Claims:
sub: Subject (unique ID)email: Email addressgiven_name: First namefamily_name: Last namepreferred_username: Usernamepicture: Profile picture URL
Global Settings
Global Settings
AUTO: Automatically link to existing Keycloak account with same emailPROMPT: Ask user to confirm account linkingDISABLED: Always create new account
IMPORT: Import on first loginFORCE: Always update from IdPLEGACY: Legacy behavior
Related ADRs
config/role_mappings.yaml
Defines how Keycloak roles, groups, and attributes map to OpenFGA tuples.Location
Purpose
Enables flexible, declarative authorization without code changes. Automatically creates OpenFGA tuples based on Keycloak user data.Structure
Simple Role Mappings
Simple Role Mappings
Direct 1:1 mapping from Keycloak roles to OpenFGA relations:Creates OpenFGA tuple:
Group-Based Mappings
Group-Based Mappings
Maps Keycloak group hierarchy to organizations/teams using regex:Example:
- User in
/acme/engineeringcreates:user:{id}, member, organization:acmeuser:{id}, member, team:engineering
Conditional Mappings
Conditional Mappings
Grants permissions based on user attributes:Supported Operators:
==: Equals!=: Not equalsin: Value in list>=: Greater than or equal<=: Less than or equal
Role Hierarchies
Role Hierarchies
Defines role inheritance:Roles inherit all permissions from their children. Applied after all other mappings.
Application Order
Rules are applied in this order:1
Simple Mappings
Process all simple role mappings first
2
Group Mappings
Apply group-based mappings with regex matching
3
Conditional Mappings
Evaluate conditions and create tuples
4
Hierarchies
Apply role inheritance
5
Deduplication
Remove duplicate tuples automatically
Examples
- User with Admin Role
- User in Engineering Group
- Finance Manager
Keycloak:
- Role:
admin(realm role)
Related ADRs
Best Practices
Version Control
- Commit
.yamlconfig files to git - NEVER commit
.envfiles - Use
.env.exampleas template - Document custom configurations
Secrets Management
- Use Infisical or Vault for production
- Rotate secrets regularly
- Use Kubernetes Secrets for deployment
- Audit secret access
Environment Separation
- Separate configs per environment
- Different secrets per environment
- Test config changes in staging
- Use CI/CD for config deployment
Validation
- Validate YAML syntax
- Test regex patterns
- Verify OIDC endpoints
- Check LDAP connectivity