Backend service for sample, neuron, and reconstruction management and search.
Note that these names are for the actual service environment. The names used in deployment schemes (e.g., docker-compose)
may map other names to these. For example, NMCP_CCF_30_ONTOLOGY_PATH for this service is set by NMCP_ONTOLOGY_PATH
on the host machine being mapped to NMCP_CCF_30_ONTOLOGY_PATH for the api service instance in the nmcp-deploy
docker-compose deployment repository.
NMCP_API_PORT(default5000) - port the GraphQL server listens onNMCP_API_ENDPOINT(default/graphql) - path the GraphQL server is mounted at
NMCP_DB_HOST(defaultnmcp-db) - postgres hostNMCP_DB_PORT(default5432) - postgres portNMCP_DATABASE_UN(defaultpostgres) - postgres user nameNMCP_DATABASE_PW(defaultpgsecret) - postgres password
NMCP_CCF_30_ONTOLOGY_PATH- full path and file name for the CCF Ontology NRRD fileNMCP_SEED_USER_ITEMS(defaultfalse) - convenience for development that will seed the database with a small number of samples and neuronsNMCP_EXPERIMENTAL_ENV(defaultfalse) - whentrue, enables experimental features and GraphQL introspectionNODE_ENV- whendevelopment(or unset), enables GraphQL introspection and resolves the fixture path relative to the source tree
The address a request is attributed to drives the access-request rate limit. When the service runs behind something
that terminates the connection — an HTTPS gateway, a load balancer, a CDN — the socket peer is that intermediary rather
than the caller, so the client address has to be recovered from the X-Forwarded-For header instead.
NMCP_TRUSTED_PROXY_HOPS(default1) - number of proxies between the client and this service that append toX-Forwarded-ForNMCP_RECENT_REQUEST_ADDRESS_LIMIT(default50) - how many recent request addresses to retain in memory for therecentRequestAddressesquery;0disables the tracking entirely
The hop count is an operational trust boundary and must match the real request path. The last that many entries of the
forwarding chain are treated as trustworthy, so a value higher than reality lets a caller on a shorter path supply
its own X-Forwarded-For and choose the address it is rate limited under. A value lower than reality attributes
every request to an intermediary, collapsing all callers into a single rate-limit bucket.
0- the service is reachable directly, with nothing in front; forwarding headers are ignored entirely1- the deployed shape of client → HTTPS gateway → service2- a CDN or a second load balancer in front of that gateway
Network address translation does not count as a hop. Docker's published-port mapping rewrites the source address but
appends nothing to X-Forwarded-For, so running the service in a container does not change the setting.
recentRequestAddresses is an internal GraphQL query, available to the internal server key (NMCP_SERVER_KEY) or an
admin user, and exists to confirm the hop count is right in a given deployment. Each entry records the resolved address
alongside the socket peer and the forwarding chain as received. Resolved and socket addresses that are identical across
different callers mean the header is not being trusted, and a chain carrying more entries than the configured hop count
means the count is too low. The list is held only in memory and is never persisted.
Authenticated GraphQL requests are expected to carry a Microsoft Entra ID bearer token in the Authorization header
(Authorization: Bearer <jwt>). The token signature, issuer, audience, and validity window are all verified.
Requests without a valid bearer token fall back to API-key authentication, then to the no-privilege system user.
NMCP_AUTH_REQUIRED(defaulttrue) - whenfalse, all authentication is bypassed and every request runs as the no-privilege system user; development convenience onlyNMCP_AUTHENTICATION_API_APP_ID- application id of this service's own app registration; the audience (aud) a token must be issued for. Not the application id of the calling client, which appears in the token asappid/azpand is not checked.NMCP_AUTHENTICATION_TENANT_ID- directory (tenant) id; pins the accepted issuer to a single Entra directoryNMCP_SERVER_KEY(optional, defaultnull) - private key that grants full API access for internal services; checked as a fallback when no bearer token authenticates. Unrelated to directory authentication.
The issuer and signing keys are discovered from the tenant's standard Entra OIDC metadata document, whose URL is derived
from NMCP_AUTHENTICATION_TENANT_ID and fetched at startup. Neither NMCP_AUTHENTICATION_API_APP_ID nor
NMCP_AUTHENTICATION_TENANT_ID has a default; if either is unset, bearer-token verification is disabled and only
API-key authentication remains.
Both v1.0 and v2.0 access tokens are accepted. An app registration whose accessTokenAcceptedVersion is left at the
default issues v1.0 tokens, which carry the legacy https://sts.windows.net/<tenant>/ issuer and the api://<api app id>
application ID URI as their audience; a registration set to version 2 issues the https://login.microsoftonline.com/<tenant>/v2.0
issuer and the bare application id. The tenant's v1.0 metadata document is fetched at startup alongside the v2.0 one to
discover the legacy issuer, and both audience forms are derived from NMCP_AUTHENTICATION_API_APP_ID, so either form may
be configured. This is transitional: each accepted v1.0 token is logged under the mnb:nmcp-api:token-verifier debug
namespace, and once no environment produces those entries the legacy issuer and audience can be dropped.
NMCP_INFLUX_DB_HOST(defaultnmcp-influxdb) - InfluxDB hostNMCP_INFLUX_DB_PORT(default8086) - InfluxDB portNMCP_INFLUX_DB_TOKEN(default empty) - InfluxDB API tokenNMCP_INFLUX_DB_ORG(defaultnmcp) - InfluxDB organizationNMCP_INFLUX_DB_BUCKET(defaultnmcp_metrics) - InfluxDB bucketNMCP_METRICS_CACHE_TTL_MS(default3600000) - reconstruction-metrics cache lifetime in milliseconds
NMCP_QUALITY_API_HOST(defaultquality-api) - quality control service hostNMCP_QUALITY_API_PORT(default5000) - quality control service portNMCP_QUALITY_API_ENDPOINT(default/performqc) - quality control service path
NMCP_DOI_API_URL(defaulthttps://morphology.allenneuraldynamics-test.org/) - landing-page base URL registered with the DOINMCP_DOI_API_HOST(defaultapi.test.datacite.org) - DataCite API hostNMCP_DOI_API_ENDPOINT(default/dois) - DataCite DOI endpointNMCP_DOI_API_PREFIX(default10.83594) - DataCite DOI prefixNMCP_DOI_API_USER(default empty) - DataCite API userNMCP_DOI_API_PASSWORD(default empty) - DataCite API password
NMCP_ACCESS_REQUEST_SNS_TOPIC_ARN(default empty) - SNS topic notified when a new access request is created; the region is taken from the ARN. Notifications are off when unset.NMCP_ACCESS_REQUEST_REVIEW_URL(default empty) - portal page for reviewing access requests (e.g.,https://<portal-host>/admin), linked from the notification; the link is left out when unset
Publishing uses the default AWS credential chain - on EC2, the instance role, which needs sns:Publish on the
topic. A bridge-networked container reaches the role through the instance metadata service, which requires the
instance's metadata hop limit to be 2 or more.
These are used by standalone import tools rather than the running service.
SS_API_TOKEN- Smartsheet API token, used by the Smartsheet import tool