Skip to content

Settings ​

This page is for the administrator. It lists every setting of an installation: its key in config.json, the environment variable that overrides it, and what it is when you set nothing.

You do not need this page to run Marketing MCP. The management page sets almost all of these, and each section below names the page. Use this page when you set up a server by script, or when you want to know what a line in config.json means.

These are the settings of the whole installation. What belongs to one person (their password, their connections to Google, Meta and LinkedIn, whether they may write, their tokens) is not a setting: it is in the database, and you manage it on Users and each person manages it on their own pages.

Where settings come from ​

A setting is looked for in three places, in this order:

  1. An environment variable. If it is set and not empty, it wins.
  2. config.json. The management page writes this file when you press a save button.
  3. The default in the tables below.

An environment variable wins over the management page

While a variable is set, saving that setting on the management page changes the file and not what the server does. Remove the variable to let the page decide.

The server reads environment variables when it starts, so a changed variable needs a restart. A file named .env in the folder the server is started from is read as well.

A change saved on the management page takes effect at once, except the bind address, the port and read-only mode, which need a restart.

Where config.json is ​

  • For the executable: in the same folder as the executable. If that folder cannot be written to, the per-user folder below is used instead.
  • When it is installed as a Python package: %APPDATA%\nama-marketing-mcp on Windows, ~/.config/nama-marketing-mcp on Linux.

The database, the media library and the kept reports are in the same folder unless you move them. Three variables change where things are, and have no key in the file:

Environment variableWhat it does
NAMA_MCP_HOMEThe folder that holds config.json, the database, the media library and the kept reports.
NAMA_MCP_CONFIGThe full path of the settings file, when it is not config.json in that folder.
NAMA_MCP_ENV_FILEThe full path of the .env file to read, when it is not in the folder the server is started from.

The file holds secrets (the app secrets, the webhook secrets, the mail password). Where the operating system allows, the server makes it readable by its own user only. Do not copy it into a place others can read.

How values are written ​

The file is JSON with one object a section: "server", "google_ads", "meta" and so on. A key in the tables below goes inside its section's object:

json
{
  "server": { "port": 8765, "public_url": "https://ads.example.com" },
  "meta_ads": { "enabled": true, "max_daily_budget": { "USD": 100, "SAR": 375 } }
}
Kind of valueIn config.jsonIn an environment variable
Switchtrue or falsetrue, 1, yes or on for on; anything else is off
Limit (a number)A number. null means no limit.A number. An empty variable counts as not set, so "no limit" can only be said in the file or on the page.
Money limit by currencyAn object: {"USD": 100, "SAR": 375}USD=100,SAR=375
ListA list: ["KW", "SA"]Separated by commas: KW,SA
List of foldersA list of pathsSeparated by ; on Windows and : on Linux

A money limit by currency has no entry for "every currency". An ad account whose currency has no entry is not unlimited: the changes that limit guards are refused for it until you add its currency.

Server ​

Section server. Set on Server, except read_only, which is on Safety limits, and the three paths, which are set only here or in the environment. See Server settings.

KeyEnvironment variableDefaultWhat it is
hostNAMA_MCP_HOST127.0.0.1The bind address. 127.0.0.1 is this machine only; 0.0.0.0 is every interface. Needs a restart. Starting the server with --host overrides it for that run.
portNAMA_MCP_PORT8765The port. Needs a restart. Starting the server with --port overrides it for that run.
public_urlNAMA_MCP_PUBLIC_URLnoneThe public address, such as https://ads.example.com, when people reach the server through a name or a reverse proxy.
read_onlyNAMA_MCP_READ_ONLYfalseRead-only mode (Refuse every change on Safety limits): no tool that changes a platform is offered, to anyone. Needs a restart.
data_dirsNAMA_MCP_DATA_DIRnoneData folders: the folders a file of customer records may be read from. A list of folders.
db_pathNAMA_MCP_DB_PATHnama-marketing.db in the installation folderThe database file: users, tokens, the activity log and everything else the server stores.
media_pathNAMA_MCP_MEDIA_PATHmedia in the installation folderThe folder that holds the media library.
reports_pathNAMA_MCP_REPORTS_PATHreports in the installation folderThe folder that holds scheduled reports kept as files.

Post queue ​

Section queue. Set on Safety limits.

KeyEnvironment variableDefaultWhat it is
max_late_hoursNAMA_MCP_QUEUE_MAX_LATE_HOURS24How late a queued post may still be published by itself, in hours. A post found later than this waits for a person. No limit means it is published however late.

History ​

Section history. Set on Server.

KeyEnvironment variableDefaultWhat it is
enabledNAMA_MCP_HISTORY_ENABLEDfalseWhether the server may read accounts by itself, on a timer, for the people who ask it to watch one.
retention_daysNAMA_MCP_HISTORY_RETENTION_DAYS800How many days a stored figure and a kept report are kept. No limit means for good. LinkedIn's figures are deleted after a year whatever this says.
max_watches_per_userNAMA_MCP_HISTORY_MAX_WATCHES_PER_USER20How many accounts one person may have watched.

Notification delivery ​

Section notify. Set on Notification delivery. All of it is optional: without it, notifications are still shown on Notifications.

KeyEnvironment variableDefaultWhat it is
webhook_urlNOTIFY_WEBHOOK_URLnoneThe address every notification is sent to. It must be HTTPS and public unless webhook_allow_private is on.
webhook_secretNOTIFY_WEBHOOK_SECRETnoneThe secret each notification is signed with, so the receiver can tell it came from this server.
webhook_allow_privateNOTIFY_WEBHOOK_ALLOW_PRIVATEfalseSays the receiver is on this server's own network, so a private address is allowed.
smtp_hostNOTIFY_SMTP_HOSTnoneThe mail server.
smtp_portNOTIFY_SMTP_PORT587The mail server's port.
smtp_securityNOTIFY_SMTP_SECURITYstarttlsHow the connection is secured: starttls, ssl or none.
smtp_usernameNOTIFY_SMTP_USERNAMEnoneThe user name for the mail server, if it asks for one.
smtp_passwordNOTIFY_SMTP_PASSWORDnoneThe password for the mail server.
smtp_fromNOTIFY_SMTP_FROMnoneThe address mail is sent from. Mail needs this and the mail server.
admin_emailNOTIFY_ADMIN_EMAILnoneWhere a notice about the installation, not about one person, is mailed.

Lead delivery ​

Section leads. Set on Lead delivery.

KeyEnvironment variableDefaultWhat it is
push_enabledNAMA_MCP_LEADS_PUSH_ENABLEDfalseWhether the server may send new leads to your own system by itself. It cannot be turned on without an address and a secret.
webhook_urlNAMA_MCP_LEADS_WEBHOOK_URLnoneThe one address leads are sent to. HTTPS, and public unless webhook_allow_private is on.
webhook_secretNAMA_MCP_LEADS_WEBHOOK_SECRETnoneThe secret every delivery is signed with. At least 16 characters. Without it nothing is sent.
webhook_allow_privateNAMA_MCP_LEADS_WEBHOOK_ALLOW_PRIVATEfalseSays the receiver is on this server's own network, so a private address is allowed.
poll_minutesNAMA_MCP_LEADS_POLL_MINUTES5How often a lead feed looks for new leads, in minutes. Never less than 2.
max_feeds_per_userNAMA_MCP_LEADS_MAX_FEEDS_PER_USER10How many lead feeds one person may have.

Section utm. No page of the management page sets this: set it here or in the environment.

KeyEnvironment variableDefaultWhat it is
campaign_prefixNAMA_MCP_UTM_CAMPAIGN_PREFIXnoneA word put in front of every campaign name when a link is tagged. acme gives acme-autumn-offer.

Section google_ads. The first three are set on Google Ads API, the rest on Safety limits. Money here is in the currency of the Google Ads account, and one number holds for every account.

KeyEnvironment variableDefaultWhat it is
developer_tokenGOOGLE_ADS_DEVELOPER_TOKENnoneThe developer token Google gives for the Google Ads API.
client_idGOOGLE_ADS_CLIENT_IDnoneThe OAuth client id everyone signs in to Google through.
client_secretGOOGLE_ADS_CLIENT_SECRETnoneThe OAuth client secret.
max_daily_budgetGOOGLE_ADS_MAX_DAILY_BUDGETno limitThe highest daily budget a change may set.
max_budget_change_pctGOOGLE_ADS_MAX_BUDGET_CHANGE_PCT50The most one change may raise a budget, in percent.
max_cpc_bidGOOGLE_ADS_MAX_CPC_BIDno limitThe highest bid a change may set.
max_target_cpaGOOGLE_ADS_MAX_TARGET_CPAno limitThe highest target cost per conversion a change may set.
max_cpc_bid_ceilingGOOGLE_ADS_MAX_CPC_BID_CEILINGno limitThe highest bid ceiling a change may give a strategy that bids by itself.
max_bid_modifier_pctGOOGLE_ADS_MAX_BID_MODIFIER_PCTno limitThe most a bid adjustment may raise a bid, in percent.
max_keywords_per_callGOOGLE_ADS_MAX_KEYWORDS_PER_CALL200How many keywords one request may add.
max_negatives_per_callGOOGLE_ADS_MAX_NEGATIVES_PER_CALL200How many negative keywords one request may add.
new_keywords_pausedGOOGLE_ADS_NEW_KEYWORDS_PAUSEDtrueWhile on, a new keyword is created paused.
new_ads_pausedGOOGLE_ADS_NEW_ADS_PAUSEDtrueWhile on, a new ad is created paused.
allow_conversion_action_editsGOOGLE_ADS_ALLOW_CONVERSION_ACTION_EDITSfalseWhether conversion actions and goals may be created and changed.
allow_lead_downloadGOOGLE_ADS_ALLOW_LEAD_DOWNLOADfalseWhether the leads of Google lead forms may be read.
allow_conversion_uploadGOOGLE_ADS_ALLOW_CONVERSION_UPLOADfalseWhether offline conversions may be sent to Google. While on, the Google sign-in asks for one more permission.
allow_customer_matchGOOGLE_ADS_ALLOW_CUSTOMER_MATCHfalseWhether Customer Match lists may be made and filled. While on, the Google sign-in asks for the same extra permission.

Website analytics ​

Section website. Set on Google Ads API.

KeyEnvironment variableDefaultWhat it is
enabledWEBSITE_ENABLEDfalseWhether the Google Analytics 4 and Search Console reports work. While on, the Google sign-in asks for two more permissions.
allowed_propertiesWEBSITE_ALLOWED_PROPERTIESallThe Google Analytics 4 properties that may be read, by id. A list. Empty means every property a person's login can list.
allowed_sitesWEBSITE_ALLOWED_SITESallThe Search Console sites that may be read, as Search Console spells them (https://www.example.com/ or sc-domain:example.com). A list. Empty means all.

Meta ​

Section meta. The app, the switches and the media folders are set on Meta app, the limits on Safety limits.

KeyEnvironment variableDefaultWhat it is
app_idMETA_APP_IDnoneThe Meta app's id.
app_secretMETA_APP_SECRETnoneThe Meta app's secret.
api_versionMETA_API_VERSIONv25.0The Graph API version the server talks. Meta retires a version about two years after it is released.
comments_enabledMETA_COMMENTS_ENABLEDfalseWhether the sign-in asks for the comment permissions.
allow_comment_deleteMETA_ALLOW_COMMENT_DELETEfalseWhether a comment may be deleted. Hiding a comment needs no switch.
instagram_delete_enabledMETA_INSTAGRAM_DELETE_ENABLEDfalseWhether the sign-in asks for the permission that deleting an Instagram post needs.
messaging_enabledMETA_MESSAGING_ENABLEDfalseWhether the inbox works and the sign-in asks for the messaging permissions.
hashtag_search_enabledMETA_HASHTAG_SEARCH_ENABLEDfalseWhether Instagram hashtag search works. It asks for no new permission.
media_dirsMETA_MEDIA_DIRnoneMedia folders: the folders on the server a picture or a video may be taken from by its path. A list of folders.
max_posts_per_dayMETA_MAX_POSTS_PER_DAY20Posts one person may publish in 24 hours.
max_caption_lengthMETA_MAX_CAPTION_LENGTH2200The longest post text, in characters.
max_replies_per_dayMETA_MAX_REPLIES_PER_DAY50Replies to comments one person may post in 24 hours.
max_reply_lengthMETA_MAX_REPLY_LENGTH1000The longest reply to a comment, in characters.
max_messages_per_dayMETA_MAX_MESSAGES_PER_DAY100Private messages one person may send in reply in 24 hours.
max_message_lengthMETA_MAX_MESSAGE_LENGTH1000The longest private message, in characters.
max_upload_mbMETA_MAX_UPLOAD_MB100The largest file the media library takes, in megabytes.
media_retention_daysMETA_MEDIA_RETENTION_DAYS30How many days a file stays in the media library after it was last uploaded or used.

Meta Ads ​

Section meta_ads. The first five are set on Meta app, the rest on Safety limits.

KeyEnvironment variableDefaultWhat it is
enabledMETA_ADS_ENABLEDfalseWhether Meta advertising works and the sign-in asks for the advertising permissions.
read_onlyMETA_ADS_READ_ONLYfalseReporting only: nothing in Meta Ads can be changed, by anyone.
allow_lead_downloadMETA_ADS_ALLOW_LEAD_DOWNLOADfalseWhether leads may be read. While on, the sign-in asks for one more permission.
allow_conversion_uploadMETA_ADS_ALLOW_CONVERSION_UPLOADfalseWhether conversions may be sent to a pixel.
allow_customer_listsMETA_ADS_ALLOW_CUSTOMER_LISTSfalseWhether a customer list may be made and filled as an audience.
max_daily_budgetMETA_ADS_MAX_DAILY_BUDGETnone setThe highest daily budget, by currency.
max_lifetime_budgetMETA_ADS_MAX_LIFETIME_BUDGETnone setThe highest lifetime budget, by currency.
max_total_daily_spendMETA_ADS_MAX_TOTAL_DAILY_SPENDnone setThe most the running daily budgets of one ad account may add up to, by currency.
max_budget_change_pctMETA_ADS_MAX_BUDGET_CHANGE_PCT50The most one change may raise a budget, in percent.
max_campaign_duration_daysMETA_ADS_MAX_CAMPAIGN_DURATION_DAYS90The longest an ad set made here may run, in days.
allowed_ad_accountsMETA_ADS_ALLOWED_AD_ACCOUNTSallThe ad accounts that may be used, by id. A list. Empty means every account a person's login reaches.
allowed_geo_countriesMETA_ADS_ALLOWED_GEO_COUNTRIESallThe countries ads may target, by two-letter code. A list. Empty means any.
allow_creative_enhancementsMETA_ADS_ALLOW_CREATIVE_ENHANCEMENTSfalseWhether a request may let Meta alter a creative by itself.
require_preview_before_activateMETA_ADS_REQUIRE_PREVIEW_BEFORE_ACTIVATEtrueWhile on, an ad can be switched on only by a person who had it previewed in the last 24 hours.

LinkedIn ​

Section linkedin. The app and the switches are set on LinkedIn app, the limits on Safety limits.

KeyEnvironment variableDefaultWhat it is
client_idLINKEDIN_CLIENT_IDnoneThe LinkedIn app's client id.
client_secretLINKEDIN_CLIENT_SECRETnoneThe LinkedIn app's client secret.
api_versionLINKEDIN_API_VERSION202609The LinkedIn API version, as year and month. LinkedIn retires a version about a year after it is released.
ads_enabledLINKEDIN_ADS_ENABLEDfalseWhether LinkedIn advertising works and the sign-in asks for the advertising permissions.
comments_enabledLINKEDIN_COMMENTS_ENABLEDfalseWhether the sign-in asks for the comment permissions.
max_posts_per_dayLINKEDIN_MAX_POSTS_PER_DAY20Posts one person may publish in 24 hours.
max_post_lengthLINKEDIN_MAX_POST_LENGTH3000The longest post text, in characters.
max_replies_per_dayLINKEDIN_MAX_REPLIES_PER_DAY50Replies to comments one person may post in 24 hours.
max_reply_lengthLINKEDIN_MAX_REPLY_LENGTH1250The longest reply to a comment, in characters.

LinkedIn refuses the whole sign-in for a permission it has not approved

Turn on ads_enabled, comments_enabled or one of the three product switches below only after LinkedIn has approved the app for that product. Until then, nobody can sign in to LinkedIn through this installation.

LinkedIn Ads ​

Section linkedin_ads. The first five are set on LinkedIn app, the rest on Safety limits. LinkedIn advertising itself is switched on by ads_enabled in the section above.

KeyEnvironment variableDefaultWhat it is
read_onlyLINKEDIN_ADS_READ_ONLYfalseReporting only: nothing in LinkedIn Ads can be changed, by anyone.
allow_audience_networkLINKEDIN_ADS_ALLOW_AUDIENCE_NETWORKfalseWhether a request may show ads on other companies' apps and sites.
allow_lead_downloadLINKEDIN_ADS_ALLOW_LEAD_DOWNLOADfalseWhether leads may be read. While on, the sign-in asks for one more permission.
allow_conversion_uploadLINKEDIN_ADS_ALLOW_CONVERSION_UPLOADfalseWhether conversions may be sent to LinkedIn. While on, the sign-in asks for one more permission.
allow_matched_audiencesLINKEDIN_ADS_ALLOW_MATCHED_AUDIENCESfalseWhether audiences may be made, filled and deleted. While on, the sign-in asks for one more permission.
max_daily_budgetLINKEDIN_ADS_MAX_DAILY_BUDGETnone setThe highest daily budget, by currency.
max_total_budgetLINKEDIN_ADS_MAX_TOTAL_BUDGETnone setThe highest total budget, by currency.
max_total_daily_spendLINKEDIN_ADS_MAX_TOTAL_DAILY_SPENDnone setThe most the running daily budgets of one ad account may add up to, by currency.
max_bidLINKEDIN_ADS_MAX_BIDnone setThe highest bid, by currency.
max_budget_change_pctLINKEDIN_ADS_MAX_BUDGET_CHANGE_PCT50The most one change may raise a budget, in percent.
max_campaign_duration_daysLINKEDIN_ADS_MAX_CAMPAIGN_DURATION_DAYS90The longest a campaign made here may run, in days.
allowed_ad_accountsLINKEDIN_ADS_ALLOWED_AD_ACCOUNTSallThe ad accounts that may be used, by id. A list. Empty means every account a person's login reaches.
allowed_locationsLINKEDIN_ADS_ALLOWED_LOCATIONSallThe locations ads may target, each by the number LinkedIn gives it. A list. Empty means any.
require_preview_before_activateLINKEDIN_ADS_REQUIRE_PREVIEW_BEFORE_ACTIVATEtrueWhile on, an ad can be switched on only by a person who had it previewed in the last 24 hours.

What else is in the file ​

  • version, at the top, is the format of the file. The server writes it.
  • limits_reviewed, under google_ads, is written when Safety limits is saved. You do not set it.

Left from the single-user version ​

The first version of Marketing MCP served one person, and kept that person's Google connection in these three variables. They are read once, when the first administrator is created, and handed to that user. After that they do nothing.

Environment variableWhat it was
GOOGLE_ADS_REFRESH_TOKENThat person's Google connection.
GOOGLE_ADS_LOGIN_CUSTOMER_IDThe manager account they worked under.
GOOGLE_ADS_WRITE_ENABLEDWhether they could make changes.