Skip to main content

Model Context Protocol - Overview

Genesis can expose your application through MCP (Model Context Protocol), so that an AI client such as Claude, ChatGPT or Gemini can monitor, query and operate it.

The Genesis MCP server gives an AI client two kinds of tool:

  • Platform tools, built in and available to every application with no extra configuration: process health, logs, tables, endpoint discovery, record lookups and changes, and maker-checker approvals.
  • Endpoint tools: event handlers and request servers that you choose to expose with enableMcp, in an mcp { } block of a separate <application>-mcp.kts file.

The server identifies every caller from HTTP headers, checks their rights before each platform tool runs, can hold writes for a second user to approve, and writes an audit line for every call.

What is MCP?​

MCP is a standard way for an application to describe its capabilities to an LLM. The description tells the LLM:

  • what operations are available;
  • what inputs each one needs;
  • what responses to expect.

Every Genesis event handler and request server already publishes metadata describing its request and response formats. That is why any of them can be exposed over MCP without extra schema work.

For more about MCP, see the official website.

Getting started​

Step 1: Enable the MCP server process​

The MCP server runs as the GENESIS_MCP process, which is off by default. To turn it on, add this item to your application's genesis-system-definition.kts file. It goes in genesis-system-definition.kts, not in an app-prefixed <application>-system-definition.kts:

systemDefinition {
global {
item(name = "GENESIS_MCP_PROCESS_START", value = "true")
}
}

Add the item inside the existing global { } block of the file. Don't add a second systemDefinition block.

warning

The shipped genesis-mcp-server.kts is for local development only. If you enable GENESIS_MCP and keep it:

  • The server listens on all network interfaces, over plain HTTP.
  • Anyone who can reach the port is treated as the user admin, with no authentication.
  • Platform tools are on. The tools that need authentication only, such as process_status, list_tables and discover_endpoints, answer every caller.
  • The other platform tools are refused until admin holds the matching MCP_* rights. The platform doesn't create those rights, and admin gets no special bypass.
  • requiresApproval = true holds back call_event, modify_record and your enableMcp event tools for approval. It doesn't hold back process_control, run_remap or set_log_level: those run straight away for anyone with the right. Every write and every approval come from admin, so this gives no separation of duties.

Override this file before you enable GENESIS_MCP anywhere other than your own machine.

Then sync the configuration and restart the application, so that the MCP process starts. With Genesis Start, use Sync processes followed by Bootstrap and launch.

When processes are compacted with compactProcessesStrategy=DEV, as they are in local development, the MCP server runs inside MCP_COMPACT_PROCESS rather than appearing as GENESIS_MCP.

Step 2: Configure the MCP server​

The server is configured in genesis-mcp-server.kts. The platform ships a default copy of this file; to configure the server, put your own copy at <application>-app/src/main/genesis/scripts/genesis-mcp-server.kts in your application project (on a deployed host, it ends up in site-specific/scripts/). Your copy takes precedence over the platform's. See Overriding platform-provided files.

The platform's default file looks like this:

server {
port = 3001

authenticationStrategy {
staticUser {
userName = "admin"
requiresApproval = true
}
}
}

This default is for local development only. See the warning in Step 1 before you rely on it.

Your own genesis-mcp-server.kts replaces the platform file completely. Any property you leave out takes its default from the server configuration table, not from the shipped file.

Here is a configuration for a deployed application. It uses Genesis session tokens, requires an identity on every connection, and holds every write for approval:

server {
serverName = "my-app"
port = 3001

requireAuthenticatedConnections = true
requireApprovalForWrites = true

approverRight = "MCP_APPROVER"
restrictedTables = setOf("MY_SECRET_TABLE")

authenticationStrategy {
sessionAuthToken { }
}
}

Step 3: Grant the MCP rights​

Platform tools check a Genesis right before they run (see Authorisation). Create these right codes and assign them to the users or profiles that should use MCP:

  • MCP_VIEW
  • MCP_DB_READ
  • MCP_OPERATE
  • MCP_ADMIN
  • an approver code, if you set approverRight to something other than MCP_ADMIN

See Authorization for how to create right codes and assign them. If you run your application locally with Genesis Start, put the rights CSVs in your project data, in <application>-app/src/main/genesis/data/, so that Bootstrap loads them and runs ConsolidateRights. If you have already bootstrapped, load them with Import data instead, then run Bootstrap again so that ConsolidateRights picks them up. It is safe to run Bootstrap again on a project that you have already bootstrapped. Under Genesis Start, though, Bootstrap refuses to run while Genesis processes are running (409 PROCESSES_RUNNING): stop them first, or see POST /api/bootstrap for the stopRunning option.

When you use Import data after Bootstrap, import only the new rows. Never import a whole table that Bootstrap already loaded, because rows that already exist make the import fail with "not all data was imported". Import:

  • a RIGHT row for each right code that doesn't exist yet;
  • a PROFILE_RIGHT row for each right you grant to an existing profile.

Don't import RIGHT_SUMMARY: ConsolidateRights derives it. For example, this PROFILE_RIGHT.csv grants MCP_VIEW to one existing profile, here called SUPPORT (use the name of one of your own profiles):

PROFILE_RIGHT.csv
PROFILE_NAME,RIGHT_CODE
SUPPORT,MCP_VIEW

Add the matching RIGHT.csv row (CODE,DESCRIPTION) only if MCP_VIEW doesn't exist yet.

A user's profile membership is in PROFILE_USER.csv. Grant the rights to a profile that the user belongs to. To see which profile an existing user, such as admin, is in on a running system, query the PROFILE_USER table with DbMon, which Genesis Start lists as a utility (see Sending input to a utility).

A newly granted right takes effect as soon as ConsolidateRights finishes, allowing for a brief sync measured in milliseconds, not minutes. You don't need to restart the MCP process, which is GENESIS_MCP, or MCP_COMPACT_PROCESS when compactProcessesStrategy=DEV is set (the compact process then includes GENESIS_MCP).

You can use your own right codes instead, by setting the matching *Right properties. Or you can set enforcePlatformToolRights = false to need authentication only.

Step 4: Expose your own event handlers and request servers​

Platform tools need no configuration. To expose your own endpoints as well, create an <application>-mcp.kts file in <application>-app/src/main/genesis/scripts, where <application> is your application's name.

This works for Spring event handlers as well as GPAL event handlers: both publish the metadata that MCP needs.

This example exposes one event handler and one request server. In your <application>-mcp.kts (not genesis-mcp-server.kts, which holds only the server { } block), add an mcp { } block that lists the endpoints to expose:

mcp {
enableMcp("EVENT_INSERT_TRADE") {
context = """
Event used to enter a new trade into the system.
""".trimIndent()
}
enableMcp("TRADE") {
context = """
Query providing details of the trades available in the application.
""".trimIndent()
}
}

Pass enableMcp the endpoint's name, and it must match exactly. For an event handler, use the full event name, prefix included, such as EVENT_INSERT_TRADE. For a request server, use the bare name you gave to requestReply, without the REQ_ prefix: for requestReply("TRADE", …), pass enableMcp("TRADE"). enableMcp("REQ_TRADE") produces no tool. This differs from the REQ_TRADE name that the router uses elsewhere in Genesis. It matches the discover_endpoints and call_request platform tools, which also use a request server's bare name.

Each enableMcp block takes two properties:

PropertyDefaultDescription
context""The description of the tool that the LLM sees. It can be as long as you need. Include examples and guidance on when and how to use the tool; older or smaller models often need more of it
requiresAuthtrueWhen true, the call fails if the caller can't be identified

MCP reads each endpoint's metadata to work out its fields and types. An event handler becomes a tool named after the event in lower case; a request server becomes <name>_query. The example above creates these tools:

  • event_insert_trade
  • trade_query

The server checks for newly started endpoints every toolRefreshIntervalMillis. An endpoint is listed as a tool only while its process is running.

Changes to <application>-mcp.kts take effect after the MCP process is restarted.

Before a newly added endpoint is listed, sync and build so its script is deployed, then start or restart the process that hosts it. Then restart the MCP process, or wait for toolRefreshIntervalMillis.

How endpoint tools behave​

  • Identity. An endpoint tool runs as the caller identified from the request headers (see Authentication). The endpoint's own permissions apply to that user. Endpoint tools don't check the MCP rights.

  • Arguments. An endpoint tool takes the event's (or request's) fields as top-level arguments, with no DETAILS or REQUEST_FIELDS wrapper, unlike call_event and call_request. For example, the arguments of an event_insert_trade call look like this:

    {"QUANTITY": 100, "SIDE": "BUY"}
  • Request server inputs. A request server tool takes the endpoint's own request fields, plus three optional query options: CRITERIA_MATCH (a Groovy filter expression), MAX_ROWS and ORDER_BY. MAX_ROWS is an integer here (for example "MAX_ROWS": 5), unlike on the platform tools. For example, the arguments of a trade_query call might look like this:

    {"CRITERIA_MATCH": "QUANTITY > 100", "MAX_ROWS": 5}
  • Reserved names. The names CRITERIA_MATCH, MAX_ROWS, ORDER_BY, VIEW_NUMBER and OFFSET, in any case, are always read as query options. If your request server has a request field with one of these names, that field isn't passed to the endpoint, and the server logs a warning.

  • Writes. Event tools are subject to maker-checker approval. A held write reports PENDING_APPROVAL instead of success.

  • Audit. Every endpoint tool call is audit-logged.

Server configuration​

All of these properties go inside the server { } block of genesis-mcp-server.kts. Changes to genesis-mcp-server.kts take effect after the MCP process is restarted.

PropertyDefaultDescription
serverName"genesis"The name of the server, as reported to AI clients
version"1.0.0"The version of the server, as reported to AI clients. Increase it when you release new functionality to AI
port3001The HTTP port. The McpPort system definition item overrides it, and must be between 1024 and 49151
toolRefreshIntervalMillis10000How often, in milliseconds, the server checks for enableMcp endpoints that have started or stopped
platformToolstrueRegister the platform tools, prompts and resources. Set to false to expose only your enableMcp endpoints
requireAuthenticatedConnectionsfalseReject any connection whose caller can't be identified, with HTTP 401, before any tool runs. See Requiring authenticated connections
requireApprovalForWritesfalseHold writes made over MCP for maker-checker approval instead of running them
approvalMessage"Submitted for approval via MCP"The approval message attached to every held write. A staticUser strategy's own approvalMessage takes precedence
enforcePlatformToolRightstrueCheck the tier right before each platform tool, prompt and resource. Set to false to need authentication only
viewRight"MCP_VIEW"Right code for the VIEW tier. It also gates the prompts and resources
dbReadRight"MCP_DB_READ"Right code for the DB_READ tier
operateRight"MCP_OPERATE"Right code for the OPERATE tier
adminRight"MCP_ADMIN"Right code for the ADMIN tier
approverRight"MCP_ADMIN"Right code for approving and rejecting held writes
restrictedTablesemptyExtra tables that the raw-database tools must refuse. See Restricted tables
oauthAuthorizationServernot setThe OAuth authorization server to advertise to clients. See OAuth discovery
routerHttpPort9064, or the RouterWebPort system definition itemThe local router's HTTP port. Used to fetch the OpenAPI specification for the genesis://api/openapi-spec resource, which fails if the router is unreachable. describe_endpoint also uses it to add detail from the spec, and falls back to the endpoint's own metadata if it cannot connect. A value set in this file wins over the system definition item
tls { }not setServe MCP over HTTPS. See TLS
authenticationStrategy { }noneRequired. Exactly one strategy; see Authentication. The server won't start without one

Authentication​

The server identifies the caller from HTTP headers on every request. Tool arguments never carry the identity.

The identified user is stamped on every event and request that MCP sends on, so each endpoint's own permissions apply to that user. Platform tools also run as that user.

Choose exactly one strategy in the authenticationStrategy block:

StrategyReadsUse it for
sessionAuthTokenSESSION_AUTH_TOKEN header, or else Authorization: Bearer <token>Genesis applications. Recommended
oidcAuthorization: Bearer <JWT>Standalone or external deployments, where MCP checks tokens from an identity provider
providedUserNameUSER_NAME headerDeployments behind a gateway that has already authenticated the caller
staticUsernothingLocal development only

Session token​

authenticationStrategy {
sessionAuthToken { }
}

The client sends a Genesis session token, which any Genesis login produces, including SSO. The server reads it from the SESSION_AUTH_TOKEN header. If that header is missing, it reads it from Authorization: Bearer <token>.

To get a session token, log in with EVENT_LOGIN_AUTH (POST /event-login-auth). Send the login to the router, not to the MCP server's own port. Locally the router listens on http://localhost:9064 by default (the RouterWebPort system definition item, which is also the default for routerHttpPort in the Server configuration table). In a deployed set-up, log in through your gateway at the address it exposes for the router. EVENT_LOGOUT ends the session. On a local development setup, the default login is documented in Running Locally; it is for local development only, not a production account.

The server checks the token the same way the router does. A token stops working once the user logs out or the session expires.

OIDC​

authenticationStrategy {
oidc {
issuer = "https://issuer.example"
jwksUri = "https://issuer.example/.well-known/jwks.json"
audience = "my-app"
usernameClaim = "preferred_username"
signatureAlgorithms = setOf("RS256", "RS384") // optional
}
}

signatureAlgorithms is a Set<String>, so write it with setOf(...). listOf(...) stops the process starting.

The client sends a JWT as Authorization: Bearer <JWT>. The server checks its signature against the key set at jwksUri, then its issuer and, if set, its audience. The value of the usernameClaim claim becomes the Genesis user name.

PropertyDefaultDescription
issuernoneRequired. The expected token issuer
jwksUrinoneRequired. Where to fetch the signing keys. It must be https; only a loopback host such as localhost may use http. The server won't start otherwise, and logs an error starting MCP oidc jwksUri must be https
audiencenot setThe expected audience. If you leave it out, the server accepts any valid token from the issuer, and logs a warning at start-up starting MCP oidc has no audience configured
usernameClaim"sub"The claim that holds the Genesis user name
clockSkewSeconds60How much clock difference to allow when checking expiry
signatureAlgorithmsRS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512The signing algorithms to accept

Signing keys are cached for five minutes. A token signed with an unknown key makes the server fetch the keys again, at most once every 30 seconds. An invalid, expired or missing token identifies nobody. So does a valid token without the usernameClaim claim, or with it blank. See Requiring authenticated connections for what happens next.

warning

This strategy checks the token on its own and knows nothing about the user in Genesis. A token stays valid until it expires, even if the user is disabled or logs out. For a Genesis application, use sessionAuthToken instead.

The server doesn't check that the user named by usernameClaim exists in Genesis. An unknown user name is handled the same way as with providedUserName.

Provided user​

authenticationStrategy {
providedUserName { }
}

The server takes the user name from the USER_NAME header, exactly as sent. It doesn't check it.

The server doesn't check that the user exists, either. An unknown user name is treated as a user with no rights:

  • Anything that checks a right refuses it, with the same message as a user who lacks that right.
  • Anything that checks no right lets it through, and runs as that name. That covers the platform tools marked Authentication only, every platform tool when enforcePlatformToolRights = false, and every enableMcp endpoint whose own definition declares no permissionCodes.

So the gateway in front of the server must forward only real, authenticated users.

To give a providedUserName caller rights, the user must exist in the USER table and be assigned a profile as usual; see Example: granting a right with SendIt.

warning

Only use this strategy behind a gateway that authenticates the caller and removes any USER_NAME header the client sends. Otherwise any caller can claim to be any user.

Static user (development only)​

authenticationStrategy {
staticUser {
userName = "admin"
requiresApproval = true
}
}

Every request acts as userName, whoever sends it. The server attaches that identity to every caller, so callers are always identified, and platform tools treat them as userName. It checks no credential, though, so nothing is authenticated: use this only on a local machine.

PropertyDefaultDescription
userNamenoneRequired. The user that every request acts as
requiresApprovaltrueHold every write for maker-checker approval
approvalMessagenot setThe approval message attached to every held write, including writes held by requireApprovalForWrites. When not set, the server-level approvalMessage is used

You can't combine staticUser with requireAuthenticatedConnections = true: the server refuses to start. Because every write shares one identity, maker-checker gives no real separation of duties with this strategy.

Requiring authenticated connections​

By default, a caller with no identity can still connect. That caller can use get_current_time and any endpoint tool with requiresAuth = false. Platform tools, prompts and resources always refuse an unidentified caller.

Set requireAuthenticatedConnections = true to close that gap. The server then rejects any connection it can't identify with HTTP 401, before any tool runs. Use it with sessionAuthToken or oidc.

Security set-up at start-up​

When it starts, the server logs one line describing its security set-up:

MCP security posture: strategy=SessionAuthToken, requireAuthenticatedConnections=true, requireApprovalForWrites=true, writesHeldForApproval=true, tls=false

requireApprovalForWrites is the server-level flag. writesHeldForApproval is the effective setting, that is, whether writes are actually held. With staticUser it is also true when requiresApproval = true (its default), even if requireApprovalForWrites=false.

It also logs a warning for each of these:

  • the staticUser strategy;
  • the providedUserName strategy;
  • sessionAuthToken or oidc without requireAuthenticatedConnections;
  • oidc without an audience;
  • plain HTTP with any strategy other than staticUser.

Authorisation​

Rights tiers​

Each platform tool belongs to a tier, and each tier needs a Genesis right. The right codes are configurable; these are the defaults:

TierRight (property, default)Tools
Authentication onlynoneprocess_status, process_monitors, system_health_check, list_tables, describe_table, discover_endpoints, describe_endpoint, operations_guide
VIEWviewRight, MCP_VIEWquery_dataserver, call_request, list_logs, read_log, search_log, list_pending_approvals, describe_approval, plus all prompts and resources
DB_READdbReadRight, MCP_DB_READquery_table, investigate_record, reconcile, analyze_exceptions, read_config
OPERATEoperateRight, MCP_OPERATEprocess_control, set_log_level
ADMINadminRight, MCP_ADMINcall_event, modify_record, run_remap
APPROVEapproverRight, MCP_ADMINapprove_request, reject_request

Every platform tool call goes through the same steps:

  1. Identify the caller from the headers. If there's no identity, refuse the call.
  2. If enforcePlatformToolRights = true, check that the caller has the tier's right.
  3. Run the tool as the caller.
  4. Write an audit line.

A user needs each tier's right separately: holding MCP_ADMIN doesn't grant VIEW. With enforcePlatformToolRights = false, any identified caller can use every platform tool.

Raw database access​

query_table, investigate_record and reconcile read tables straight from the database. They skip the row, entity and field permissions that data servers and request servers apply. Treat the DB_READ right as read access to the whole database.

Grant it separately from VIEW. The VIEW tools query_dataserver and call_request go through the data server and request server, so your application's permissions (set on the data server and the request server) still apply.

Restricted tables​

Whatever the caller's rights, query_table, investigate_record, reconcile and modify_record refuse any table that matches one of these rules (case-insensitive):

  • the names USER, USER_SESSION, USER_ATTRIBUTES and JWT_CONFIG, and their _AUDIT tables;
  • any name that contains PASSWORD, SECRET, CREDENTIAL, PRIVATE_KEY or AUTH_TOKEN;
  • any name that contains an entry of restrictedTables.

Platform tools, prompts and resources​

These are registered when platformTools = true, the default. The server also registers get_current_time, which returns the current time, whatever the settings.

Tools​

Every platform-tool argument is passed as a string, including the numeric ones. For example, send "MAX_ROWS": "5", not "MAX_ROWS": 5.

ToolTierParametersWhat it does
process_statusAuthentication onlyPROCESS_NAME (optional)Status, CPU, memory and port of the running processes
process_monitorsAuthentication onlyPROCESS_NAME (optional)Health monitor data for each process
system_health_checkAuthentication onlynoneOverall health across all processes
list_tablesAuthentication onlynoneDatabase tables, with field counts
describe_tableAuthentication onlyTABLE_NAMEFields and indices of one table
discover_endpointsAuthentication onlyTYPE_FILTER (optional: EVENT_HANDLER or REQUEST_SERVER), NAME_FILTER (optional)Event handlers and request servers, with the process that serves each one
describe_endpointAuthentication onlyENDPOINT_NAMEAn endpoint's input fields, types, required fields and allowed values
operations_guideAuthentication onlyCHANGE_TYPE (default all)Guidance on the operational steps for each kind of change
query_dataserverVIEWQUERY_NAME, MAX_ROWS (default 25, max 200), CRITERIA (optional)A one-off snapshot of a data server query
call_requestVIEWREQUEST_NAME, CRITERIA (optional), REQUEST_FIELDS (optional, a JSON object encoded as a string), MAX_ROWS (default 100, max 5000)Calls a request server
list_logsVIEWnoneLog files, with size and last-modified time
read_logVIEWPROCESS_NAME, LINES (default 100, max 500)The last lines of a process's log
search_logVIEWPROCESS_NAME (or ALL), PATTERN, MAX_MATCHES (default 50, max 200)Case-insensitive search of one log, or all of them
list_pending_approvalsVIEWnoneWrites waiting for approval
describe_approvalVIEWAPPROVAL_IDThe full held write, with secret-looking fields hidden
query_tableDB_READTABLE_NAME, MAX_ROWS (default 25, max 500)Reads rows straight from a table
investigate_recordDB_READTABLE_NAME, KEY_FIELD, KEY_VALUETraces one record across related tables, audit tables and logs
reconcileDB_READTABLE_A, TABLE_B, KEY_FIELD, COMPARE_FIELDS (optional)Compares two tables on a key field
analyze_exceptionsDB_READSTATUS_FILTER (optional)Groups current exceptions by type
read_configDB_READFILTER (optional)System definition keys and values
process_controlOPERATEPROCESS_NAME, ACTION (start or stop)Starts or stops a process on the local instance
set_log_levelOPERATEPROCESS_NAME, LOG_LEVEL (TRACE, DEBUG, INFO, WARN or ERROR), PACKAGE_NAME (default ROOT)Changes a running process's log level without a restart
call_eventADMINEVENT_NAME (with the EVENT_ prefix), DETAILS (a JSON object encoded as a string)Sends an event to an event handler
modify_recordADMINTABLE_NAME, KEY_FIELD, KEY_VALUE, CHANGES (a JSON object encoded as a string), EVENT_NAME (optional)Changes fields on one record (see below)
run_remapADMINCOMMIT (true to commit; otherwise a dry run)Runs remap on the local instance
approve_requestAPPROVEAPPROVAL_ID, COMMENT (optional)Approves a held write
reject_requestAPPROVEAPPROVAL_ID, COMMENT (optional)Rejects a held write

Some notes on individual tools:

  • call_request, query_dataserver: CRITERIA is a Groovy expression, such as QUANTITY > 100 && SIDE == 'BUY', or a JSON object of field values, such as {"SIDE": "BUY"}. If the criteria names a field that doesn't exist, the error lists the endpoint's real fields.

  • call_request: REQUEST_NAME is the request server's name without the REQ_ prefix.

  • call_request, call_event, modify_record: REQUEST_FIELDS, DETAILS and CHANGES are each a JSON object encoded as a string, so the quotes inside it are escaped. For example, the arguments of a call_event call look like this:

    {
    "EVENT_NAME": "EVENT_INSERT_TRADE",
    "DETAILS": "{\"QUANTITY\": 100, \"SIDE\": \"BUY\"}"
    }
  • modify_record: this reads the current record, applies only the fields in CHANGES, and sends the whole record through the table's update event. By default it uses the first of these events that exists: EVENT_<TABLE>_UPDATE, then EVENT_<TABLE>_UPSERT, then EVENT_<TABLE>_MODIFY, then EVENT_MODIFY_<TABLE>. Set EVENT_NAME if your event has a different name. The event's validation, auditing and approval all still apply.

  • read_config: values whose key contains PASSWORD, PASSWD, PWD, PASSPHRASE, SECRET, TOKEN, CREDENTIAL, PRIVATE_KEY, API_KEY or APIKEY are shown as ***. The genesis://config/system-definition resource is hidden the same way.

  • read_log, search_log, process_control: PROCESS_NAME must be an upper-case process name (letters, digits and underscores only).

  • process_control, run_remap: these act on the instance that the MCP server runs on.

Prompts​

Prompts need the VIEW right.

PromptArgumentsWhat it gives
app_overviewnoneAn overview of the application: tables, endpoints, processes and capabilities
debug_processprocess_nameDebugging context for one process: status, monitors, recent log errors and log level
daily_summarynoneA daily operations summary: system health, recent errors, data volumes and notable events
watchdognoneA system check covering process health, log errors, monitor states and data integrity
settlement_summarynonePending, settled and failed transactions
exception_reportnoneData issues, processing failures and unresolved items
eod_checklistnoneAn end-of-day checklist: what to run and check, and in what order

Resources​

Resources need the VIEW right.

ResourceContents
genesis://config/system-definitionThe system definition, with secret-looking values hidden
genesis://config/processesThe process configuration
genesis://config/routerThe router configuration
genesis://api/openapi-specThe application's OpenAPI specification, fetched from the router on routerHttpPort

For example, to fetch a prompt and read a resource:

{"jsonrpc":"2.0","id":4,"method":"prompts/get","params":{"name":"app_overview"}}
{"jsonrpc":"2.0","id":5,"method":"resources/read","params":{"uri":"genesis://config/processes"}}

Maker-checker approval​

Maker-checker means one user (the maker) asks for a change, and a different user (the checker) approves it before it takes effect. MCP uses the platform's pending approval workflow for this.

Which writes are held​

A write made over MCP is held for approval when either of these is true:

  • requireApprovalForWrites = true;
  • the strategy is staticUser with requiresApproval = true, which is its default.

This covers call_event, modify_record and your enableMcp event tools. It doesn't cover process_control, run_remap or set_log_level, or any read.

A held write is stored in the APPROVAL table and isn't applied. Its message is the staticUser strategy's approvalMessage if you set one, otherwise the server-level approvalMessage. Instead of a normal result, the tool returns:

{
"status": "PENDING_APPROVAL",
"applied": false,
"event": "EVENT_INSERT_TRADE",
"message": "Submitted for maker-checker approval - this change is NOT yet applied. ..."
}

Three events are never held: EVENT_PENDING_APPROVAL_ACCEPT, EVENT_PENDING_APPROVAL_REJECT and EVENT_PENDING_APPROVAL_CANCEL. They are matched by exact name, so an app event that only shares the prefix, such as EVENT_PENDING_APPROVAL_LIMIT_UPDATE, is still held.

Under the staticUser strategy the server refuses these three events when an MCP client sends them as event tools. A checker approves or rejects with approve_request and reject_request instead, and cancels in the UI.

Approving or rejecting a held write​

A checker, connected over MCP as a different user, works through these tools:

  1. list_pending_approvals lists the pending writes: who asked, which event, the message and when. Each entry also carries the approval's id in APPROVAL_ID, which describe_approval, approve_request and reject_request take as their APPROVAL_ID argument. For example:

    {
    "APPROVAL_ID": "...",
    "REQUESTED_BY": "JaneDee",
    "EVENT": "EVENT_TRADE_INSERT",
    "MESSAGE": "...",
    "REQUESTED_AT": "..."
    }

    The entries are in the pending array of the response, next to pending_count. The tool reads at most 2,000 approval records; when it reaches that limit, it sets truncated to true.

  2. describe_approval shows the full held write, with secret-looking fields hidden.

  3. approve_request or reject_request acts on it, with an optional COMMENT. These send EVENT_PENDING_APPROVAL_ACCEPT or EVENT_PENDING_APPROVAL_REJECT as the checker.

Checkers can also use any other front end built on the pending approval workflow.

To try maker-checker locally, you need a second user to act as the checker. Logged in with the local development default login, create it with EVENT_INSERT_USER, which takes the user's password in the field ONE_TIME_PASSWORD, or with Add User in the user management UI. Give the checker a profile that holds the approver right (MCP_ADMIN, or your approverRight) and also MCP_VIEW (or your configured viewRight), because the checker's first step, list_pending_approvals, is a VIEW tool (see Rights tiers). Pass that profile in USER_PROFILES when you create the user, or grant both rights to one of its profiles as in Step 3. A new user starts with an expired password. It can't log in, or get a sessionAuthToken, until the password has been changed once with EVENT_CHANGE_USER_PASSWORD. Over REST, send USER_NAME as an HTTP header, not in the JSON body; only DETAILS is read from the body.

Separation of duties​

  • The platform never lets a user approve or reject their own request.
  • approverRight is MCP_ADMIN by default, the same as adminRight. So anyone who can make a write over MCP can also approve other users' writes. Set approverRight to a different right code if makers shouldn't also be checkers.
  • With staticUser, every write comes from the same user, so there is no real separation of duties. The server logs a warning about this at start-up.

Audit logging​

The server writes one audit line, at INFO level, for each tool call, each prompt or resource read, and each rejected connection. The lines go to a logger named global.genesis.mcp.audit, so you can route them separately in the process's logging configuration. Unless you route the logger elsewhere, audit lines are written to the MCP process's own log (GENESIS_MCP, or MCP_COMPACT_PROCESS when processes are compacted).

MCP tool call - user=<user>, tool=<tool>, outcome=<outcome>, durationMs=<ms>, args=<arguments>
MCP access - user=<user>, target=<prompt or resource>, outcome=<outcome>
MCP connection - outcome=rejected, detail=<reason>
  • user is anonymous when the caller couldn't be identified.

  • outcome is one of success, error, denied: unauthenticated, denied: missing <right> right or denied: restricted table <table>.

  • args lists the tool's arguments, shortened. Any argument whose name or value looks like a secret is shown as ***. The match is on the argument's name or any part of its value: it is a substring match on secret hints such as PASSWORD, SECRET and TOKEN. For example, a query_table call on MY_SECRET_TABLE logs args=TABLE_NAME=***. A JSON-string argument such as DETAILS that contains a secret-looking key or value is masked as a whole, not field by field.

  • A call blocked by the restricted-table guard writes two lines. The first has outcome=denied: restricted table <table>, which names the table, and an empty args=. An outcome=error line with the masked args follows. So the denied line is where the table name shows.

  • Endpoint tools are logged with the endpoint's name (for example, EVENT_INSERT_TRADE) as tool, with an empty args=, and with durationMs=-1. For example:

    MCP tool call - user=admin, tool=EVENT_INSERT_TRADE, outcome=success, durationMs=-1, args=

    For a request server this is the name you passed to enableMcp (for example WIDGET), not the tool name widget_query.

Line breaks are removed from user names and arguments, so a caller can't forge an extra audit line.

OAuth discovery and TLS​

OAuth discovery​

Some MCP clients can log in by themselves: they read where to log in from the server, then run a browser login. The server supports this with OAuth Protected Resource Metadata (RFC 9728). Client support for discovery varies, so check your client's own documentation; if it doesn't support discovery, replace the token by hand as described in Connecting an AI client.

Discovery is on when oauthAuthorizationServer is set, or when the strategy is oidc. The server then advertises oauthAuthorizationServer if it's set, or else the oidc issuer. It:

  • serves the metadata at /.well-known/oauth-protected-resource/mcp;
  • adds WWW-Authenticate: Bearer resource_metadata="<metadata URL>" to every 401 response.

The server only sends a 401 when requireAuthenticatedConnections = true, so set that too.

Genesis isn't an OAuth authorization server itself. With sessionAuthToken, point oauthAuthorizationServer at an authorization server that runs the Genesis login and gives the client a Genesis session token. No reference authorization server ships with Genesis, so replacing the token by hand, as described in Connecting an AI client, is the supported path for sessionAuthToken.

When the server sits behind a proxy, it builds the URLs it advertises from the X-Forwarded-Proto and X-Forwarded-Host headers, if present.

TLS​

By default the server uses plain HTTP. For production, either end TLS at the router or gateway in front of the MCP server, or have the server use HTTPS itself:

server {
tls {
keyStorePath = "/path/to/keystore.p12"
keyStorePassword = "..."
keyStoreType = "PKCS12"
}
// ...
}

keyStorePath and keyStorePassword are required. keyStoreType defaults to "PKCS12". To create a keystore for local testing, see Service encryption, which gives keytool commands. Those commands create a JKS keystore, so either set keyStoreType = "JKS" or pass -storetype PKCS12 to keytool.

Connecting an AI client​

The server uses the MCP Streamable HTTP transport, at a single endpoint:

http://<host>:<port>/mcp

If you have set up TLS, only the URL changes, to https://<host>:<port>/mcp. The transport is still Streamable HTTP, so a client setting such as Claude Code's --transport http stays the same. Any client that supports Streamable HTTP can connect to it directly.

Unless you use staticUser, the client must send the caller's credentials as an HTTP header on every request. With sessionAuthToken, that is SESSION_AUTH_TOKEN: <token> or Authorization: Bearer <token>.

Some clients can log in by themselves instead; see OAuth discovery for what the server advertises to them.

A token you paste into a client's configuration lasts only as long as its session: it stops working when the session ends or the user logs out. To get a fresh one, log in again with EVENT_LOGIN_AUTH (POST /event-login-auth), then replace <token> in the client's configuration.

You need access to an AI model as well. Some clients, such as Claude Desktop and Claude Code, use a model in the cloud. You can also run the whole stack locally.

Using Claude Code​

claude mcp add --transport http genesis http://localhost:3001/mcp \
--header "SESSION_AUTH_TOKEN: <token>"

When the token expires, run claude mcp remove genesis and then the claude mcp add command again with the new token.

If the server uses https with a certificate signed by a custom or self-signed CA, set NODE_EXTRA_CA_CERTS=/path/to/ca.pem before launching claude (or in the env block of Claude Code's settings.json), or install the CA in the operating system's trust store, which Claude Code reads by default.

Using Claude Desktop​

See the MCP quickstart for users for how to add a server to Claude Desktop.

The Genesis MCP server supports only the Streamable HTTP transport, not stdio. Claude Desktop's claude_desktop_config.json file only launches stdio servers, so Claude Desktop can't connect to the Genesis server directly. Use a bridge, such as mcp-remote, which runs as a stdio server and forwards to the HTTP endpoint:

{
"mcpServers": {
"genesis": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:3001/mcp", "--header", "SESSION_AUTH_TOKEN:${GENESIS_TOKEN}"],
"env": { "GENESIS_TOKEN": "<token>" }
}
}
}

mcp-remote is a third-party package, and npx needs Node.js. Write the header with no space after the colon and keep the token in env: on Windows, Claude Desktop doesn't quote spaces inside args.

If the server uses https with a certificate that the machine running mcp-remote doesn't already trust (for example, a self-signed one), add "NODE_EXTRA_CA_CERTS": "/path/to/ca.pem" to the env block, pointing at the CA certificate that signed the server's certificate, as mcp-remote documents.

The file is at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Fully restart Claude Desktop after editing the file.

Claude Desktop's custom connectors, under Settings → Connectors, connect from Anthropic's cloud, so they can't reach a server on your local machine.

Using mcphost​

mcphost is a small command-line application that connects MCP servers to an AI model. It supports OpenAI and Anthropic models in the cloud, and local models through Ollama. See the mcphost repository for installation instructions.

By default, mcphost reads its configuration from $HOME/.mcp.json, and creates the file if it doesn't exist. Add the Genesis server as a remote server:

{
"mcpServers": {
"genesis": {
"type": "remote",
"url": "http://localhost:3001/mcp",
"headers": ["SESSION_AUTH_TOKEN: <token>"]
}
}
}

Then start mcphost with the model you want. For example, with a local Ollama model, which needs no API key:

mcphost -m ollama:<your model>

Cloud models, such as anthropic:<model> or openai:<model>, need an API key. Run mcphost -h for the options.

mcphost has no option to trust a custom CA for MCP servers, so if the server uses https with a custom or self-signed CA, install the CA in the system trust store (on Linux, SSL_CERT_FILE and SSL_CERT_DIR also work). The --tls-skip-verify flag applies only to the model provider, not to MCP server connections.