MCP Agent
Configuration

Agent Configuration

All configuration is managed via environment variables, loaded from .env using pydantic-settings.

Required Variables

VariableDescriptionDefault
ZIADA_API_URLBase URL of the ZiadaPOS Go APIhttp://localhost:8080/api/v1
ZIADA_IDENTIFIEROwner's login email or phone-
ZIADA_PASSWORDOwner's login password-

AI Agent (ask tool)

VariableDescriptionDefault
NGAMIA_API_KEYNgamia AI gateway API key-
NGAMIA_BASE_URLAI gateway URLhttps://api.ngamia.cc/v1
NGAMIA_MODELModel to useopenai/gpt-4o-mini
AGENT_MAX_STEPSMax tool-calling rounds per ask8
AGENT_TIMEOUT_SECONDSLLM call timeout120

SMS (SendAfrica)

VariableDescriptionDefault
SENDAFRICA_API_KEYSendAfrica API key (SA-...)-
SENDAFRICA_SENDER_IDSender ID on SMSSendAfrika
SENDAFRICA_BASE_URLAPI base URLhttps://api.sendafrica.online

Email (MailAfrica)

VariableDescriptionDefault
MAILAFRICA_API_KEYMailAfrica API key (MAIL_...)-
MAILAFRICA_FROM_DOMAINVerified sending domain-
MAILAFRICA_FROM_ADDRESSSender email-
MAILAFRICA_FROM_NAMEDisplay nameZiadaPOS
MAILAFRICA_BASE_URLAPI base URLhttps://api.mailafrica.online

Transport & Server

VariableDescriptionDefault
MCP_TRANSPORThttp or stdiohttp
MCP_HOSTBind address0.0.0.0
MCP_PORTBind port8081
LOG_LEVELLogging levelINFO

Optional

VariableDescriptionDefault
ZIADA_STORE_IDForce a specific store UUID""

Example .env

# Required
ZIADA_API_URL=http://localhost:8080/api/v1
ZIADA_IDENTIFIER=+255712345678
ZIADA_PASSWORD=your_password
 
# AI Agent
NGAMIA_API_KEY=your_key_here
NGAMIA_BASE_URL=https://api.ngamia.cc/v1
NGAMIA_MODEL=openai/gpt-4o-mini
AGENT_MAX_STEPS=8
AGENT_TIMEOUT_SECONDS=120
 
# SMS
SENDAFRICA_API_KEY=SA-your_key
SENDAFRICA_SENDER_ID=ZiadaPOS
 
# Email
MAILAFRICA_API_KEY=MAIL-your_key
MAILAFRICA_FROM_DOMAIN=ziadapos.com
MAILAFRICA_FROM_ADDRESS=noreply@ziadapos.com
MAILAFRICA_FROM_NAME=ZiadaPOS
 
# Transport
MCP_TRANSPORT=http
MCP_HOST=0.0.0.0
MCP_PORT=8081
LOG_LEVEL=INFO

Configuration Singleton

The get_settings() function in config.py returns a cached Settings instance. It's an @lru_cache-decorated factory that ensures a single instance is used throughout the application.