census-economic-census-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
census-economic-census-mcp
Secure, multi-user MCP access to the official U.S. Census Bureau Economic Census API for the 2002, 2007, 2012, 2017, and 2022 vintages. The repository is a standalone adaptation of the public LesterAJohn/skeleton-mcp reference application.
Source and provenance
Copied skeleton source commit:
a2dbf2f7aa444365effd44dd5b3df9e92a6fe399Requested hint checked:
8925ef58444984a43d937535e64aa5a5769de6a8; it resolves in the source repository and is an ancestor of the copied commit.Adaptation:
census-economic-census-mcp/LesterAJohn/census-economic-census-mcpThis standalone repository has a fresh Git history; it is not a fork.
The preserved source documents are in API-DOCS.md and docs/. They are retained unchanged. Official live metadata snapshots were added separately under inventory/sources.
Related MCP server: census-mcp-server
Capabilities
MCP stdio, HTTP, or both through the existing skeleton transport processes.
Modern and legacy MCP protocol compatibility.
HTTP bearer-token, OAuth2 introspection, or combined authentication.
Vault-backed multi-user token index, default-principal fallback, bearer/OAuth seeding, and Vault token lifecycle tools.
Vault Agent file, listener, or both runtime modes, including Postgres-backed non-secret pointers.
Multi-tenant user/account identity with default scope fallback and cross-scope checks.
Postgres configuration, agent config, tasks, memory, schedules, grants, audit data, and checkpoints.
Mandatory agent/A2A and dedicated pg-boss worker infrastructure in supported Compose flows.
Vault Raft persistence, managed unseal-key init ordering, and external Vault/Postgres deployment support.
Plaintext HTTP by default for loopback or trusted internal reverse-proxy use; optional native HTTPS remains supported.
MCP_SERVER_NAME=census-economic-census-mcp is the single naming source. Current Postgres objects use the census_economic_census_mcp_ prefix, LangGraph uses census_economic_census_mcp_langgraph, pg-boss uses census_economic_census_mcp_pgboss, and Vault paths begin with census-economic-census-mcp/. APP_NAME is only a legacy migration source. Changing MCP_SERVER_NAME changes these namespaces and requires an explicit migration plan.
Honest API coverage
The Census API does not expose an OpenAPI document for this catalog, so the inventory is generated from official year-specific Census metadata:
npm run inventory:generate
npm run inventory:checkOutputs:
committed official catalog snapshots:
inventory/sources/census-{2002,2007,2012,2017,2022}.json
Selection rule: available official catalog records whose c_dataset path begins with ecn or ewks. The committed inventory contains 174 callable datasets:
Vintage | Datasets |
2002 | 1 |
2007 | 1 |
2012 | 65 |
2017 | 62 |
2022 | 45 |
Every selected dataset has a dedicated generated MCP query tool. Dataset field names, predicates, geographies, and responses are not invented; callers first use the official metadata tools and then submit validated query strings. Records that are unavailable or outside the Economic Census dataset-prefix rule are not mislabeled as Economic Census operations. All data calls are public read-only GET operations; credential administration is the only service-specific mutating surface.
Census MCP tools
Every inventory row maps to:
census_<year>_<normalized_dataset_path>_queryFor example, census_2022_ecnbasic_query queries GET /2022/ecnbasic.
Shared discovery and query tools:
Tool | Classification | Purpose |
| read-only | List/filter the committed dataset inventory and generated names |
| read-only | Query any inventoried dataset by year and dataset path |
| read-only | Fetch the official |
| read-only | Fetch official geography metadata |
| read-only | Fetch official group metadata |
| read-only | Fetch official example metadata |
| read-only | Allowlisted GET compatibility for inventoried paths |
| read-only | List all generated endpoint mappings |
| read-only | Check the official Census catalog endpoint |
| read-only | Suggest metadata/query tool sequences and expose schemas |
Credential tools:
Tool | Classification | Protection |
| read-only | Returns path, scope, fingerprint, and rotation time only |
| high-risk mutation |
|
| high-risk mutation |
|
| high-risk mutation |
|
A Census API key is stored at:
census-economic-census-mcp/tenants/<tenant>/<users|accounts>/<principal>/credentials/census/api-keyThe key is never placed in Postgres, task state, schedules, logs, query output, URL output, or agent memory. The adapter adds it only to the outbound query sent to https://api.census.gov, then removes the URL from returned data. Set/rotate requires a configured MCP_ADMIN_AUTH_KEY in key mode or mcp:admin in scope mode.
Preserved infrastructure tools
The skeleton's tool surface remains available:
Config:
config_list,config_get,config_set,config_delete,token_rotation_configVault access:
vault_seed_http_token,vault_seed_oauth_token,vault_agent_token_readVault lifecycle:
token_lookup_self,token_renew_self,token_create,token_revoke,token_revoke_selfTenancy:
tenancy_tenant_*,tenancy_user_*,tenancy_account_*Agent:
agent_config_*,agent_goal,agent_task_*,agent_composition_run, composition/memory toolsSchedules/grants/runs: the complete
agent_schedule_*catalogpg-boss: complete read and guarded administrative/job-management catalog
All mutating infrastructure tools retain the skeleton's admin checks. Query and config paths derive identity from authenticated context; caller identity cannot silently switch tenant/user/account.
Quick start
Node.js 22 or newer is required.
cp .env.example .env
npm ci
npm run inventory:check
npm testFor stdio:
MCP_TRANSPORT_MODE=stdio npm run start:stdioFor HTTP/A2A:
Start
npm run start:httpwith the defaultMCP_HTTP_TLS_ENABLED=false.Keep the listener on loopback (
MCP_HTTP_HOST=127.0.0.1) or behind a trusted internal TLS-terminating reverse proxy. Do not expose plaintext HTTP directly to the public internet.
The default MCP endpoint is http://127.0.0.1:3000/mcp; health is /healthz; A2A is /a2a; the public Agent Card is /.well-known/agent-card.json.
To use native TLS instead, set MCP_HTTP_TLS_ENABLED=true, MCP_HTTP_TLS_CERT_PATH, and MCP_HTTP_TLS_KEY_PATH to externally provisioned files. Optional passphrase and minimum-version settings remain supported. No production certificate or private key is generated, committed, or required for the default HTTP path.
Start both transports with npm run start:both. The supported worker is a separate process:
MCP_AGENT_WORKER_ENABLED=true PGBOSS_ENABLED=true npm run start:agent-workerInference is intentionally not preconfigured. A fresh installation can start MCP/A2A and report readiness, but inference-dependent execution returns an actionable prerequisite error until an operator uses the preserved agent_config_* and credential tools.
MCP client example
{
"mcpServers": {
"census-economic-census-mcp": {
"command": "npm",
"args": ["run", "start:stdio"],
"cwd": "/absolute/path/to/census-economic-census-mcp"
}
}
}For default loopback HTTP use http://127.0.0.1:3000/mcp. For a trusted internal deployment, clients may use the proxy's internal HTTP endpoint; a public or remote client should use an HTTPS reverse-proxy URL or a native-TLS endpoint. Always use a Vault-index or OAuth bearer token, and do not put bearer tokens in committed client configuration.
Environment variables
Core:
MCP_SERVER_NAME(defaultcensus-economic-census-mcp)MCP_SERVER_VERSIONMCP_TRANSPORT_MODE=stdio|http|bothMCP_ADMIN_AUTH_KEY,MCP_AUTHZ_MODE=auto|admin-key|oauth-scopesMCP_ALLOW_SENSITIVE_OUTPUT(keepfalse)CENSUS_API_BASE_URL=https://api.census.gov/data(official origin enforced)CENSUS_API_TIMEOUT_MS
Postgres/pg-boss:
POSTGRES_HOST,POSTGRES_PORT,POSTGRES_DB,POSTGRES_USER,POSTGRES_PASSWORDoptional
POSTGRES_CONNECTION_STRINGPGBOSS_ENABLED,PGBOSS_SUPERVISE,PGBOSS_MIGRATE,PGBOSS_CREATE_SCHEMA,PGBOSS_CONNECTION_STRINGMCP_CONFIG_DEFAULT_TENANT_ID,MCP_CONFIG_DEFAULT_PRINCIPAL_TYPE,MCP_CONFIG_DEFAULT_USER_ID,MCP_CONFIG_DEFAULT_ACCOUNT_ID
Vault:
VAULT_ADDR,VAULT_TOKEN,VAULT_KV_MOUNTVAULT_AGENT_ENABLED,VAULT_AGENT_AUTH_MODE=none|file|listener|bothVAULT_AGENT_TOKEN_FILE_PATH,VAULT_AGENT_LISTENER_ENABLED,VAULT_AGENT_LISTENER_ADDRVAULT_UNSEAL_KEYor managedsrc/config/vault.unseal.key.jsonVault retry variables from .env.example
HTTP/auth:
MCP_HTTP_HOST,MCP_HTTP_PORT,MCP_HTTP_PATH,MCP_HTTP_HEALTH_PATHMCP_HTTP_AUTH_MODE=token|oauth2|both,MCP_HTTP_TOKEN_SOURCEstatic/Vault token, scope, audience, OAuth provider/introspection settings
body/rate/IP/origin limits
MCP_HTTP_PUBLISH_HOST(Compose host publication default127.0.0.1)MCP_HTTP_TLS_ENABLED(defaultfalse)MCP_HTTP_TLS_CERT_PATH,MCP_HTTP_TLS_KEY_PATH(required only when native TLS is enabled)optional
MCP_HTTP_TLS_KEY_PASSPHRASE,MCP_HTTP_TLS_MIN_VERSION
Agent/A2A/schedules:
MCP_AGENT_WORKER_ENABLED,MCP_AGENT_MAX_GOAL_BYTES,MCP_AGENT_MAX_TASK_RUN_TIME_MSMCP_AGENT_SCHEDULE_RECONCILE_MS,MCP_AGENT_SCHEDULE_RETENTION_DAYSMCP_A2A_PATH,MCP_A2A_CARD_PATH,MCP_A2A_PUBLIC_URL
See .env.example for complete values.
Deployment and TLS
docker-compose.yml starts Raft-backed Vault (after vault-unseal-key-init), Postgres, MCP HTTP, and the dedicated agent worker. The default Compose publication is 127.0.0.1:3000 and the MCP process serves plaintext HTTP. This is suitable for loopback or an internal trusted-proxy topology only, never direct public exposure.
Native TLS remains available by setting MCP_HTTP_TLS_ENABLED=true and supplying external certificate/key paths (with the certs/ mount available read-only for Compose). There is no generated, committed, or fallback production certificate/key. TLS startup fails if the requested externally provisioned files are absent or unreadable; it does not silently downgrade to HTTP.
External Services Mode
Use docker-compose.external.yml for an app-only deployment against existing Vault/Postgres. Set VAULT_* and POSTGRES_*, the same MCP_SERVER_NAME, and use one Postgres database for application and pg-boss state. Production Vault should use TLS and least-privilege AppRole/token policy rather than the development root token.
A trusted reverse proxy uses the default MCP_HTTP_TLS_ENABLED=false together with an explicitly configured MCP_HTTP_TRUST_PROXY=true; keep the app-to-proxy HTTP path internal. For native TLS, enable it explicitly and configure cert/key/passphrase/min-version settings. Rotation of native TLS material requires a process restart. Certificate provisioning, renewal, Vault Raft backup/restore, and Vault hardening are operator responsibilities documented in vault-production/README.md.
Agent and A2A
Agent configuration remains deployment-time MCP configuration:
Discover configuration/capability schema.
Provision inference credentials in scoped Vault storage.
Validate and save non-secret Postgres configuration.
Explicitly test the inference endpoint.
Submit a read-only verification goal and inspect task status.
Rotate credentials or delete config as needed.
The agent worker restores authenticated tenant/principal and scopes for tool calls, rechecks schedule grants, and persists LangGraph checkpoints. pg-boss dispatch and app records share one database so submission is transactional. Disabling a schedule does not cancel previously submitted tasks. A2A uses the same HTTP auth, origin/IP, body, and rate controls as MCP.
See agent/playbooks/service-onboarding.md and agent/templates/service-spec.md.
Security and persistence
Secrets: Vault only.
Non-secret configuration: Postgres only.
Multi-user scope: tenant plus user/account principal on config, credentials, tasks, memory, schedules, and grants.
API origin: adapter refuses non-
https://api.census.govorigins.Output: secret-bearing values are redacted; raw Vault lifecycle tokens are disabled unless explicitly and admin-guarded.
HTTP: bearer/OAuth auth, origins, IP allowlist, body limit, rate limit, TLS, bounded timeout.
Reliability: no automatic retries for Census queries (safe to call again because query operations are read-only).
Upstream Census API behavior, throttling, and API-key issuance remain Census-controlled.
Tests and CI
Run:
npm run inventory:check
npm testtests/census-service.test.js checks all 174 mappings, API-key redaction, scoped Vault paths, allowlisting, and read-only behavior. tests/server.integration.test.js covers generated tool registration, admin failures, redaction, and suggestions. Existing tests retain stdio/HTTP, the plaintext TLS-disabled default, opt-in native TLS validation and HTTPS behavior, OAuth, Vault token fallback/lifecycle, Vault Agent listener/both modes, agent/A2A, pg-boss, schedules, rotation, namespace collision, and production-Vault behavior.
Live Postgres agent/scheduling tests are opt-in with MCP_AGENT_TEST_DATABASE_URL and are reported as skipped when not configured. The base suite uses deterministic mocks/fixtures for Census and controlled scheduling.
.github/workflows/inventory-and-tests.yml generates/checks inventory, uploads a repository artifact, installs with npm ci, and runs npm test.
Install the local pre-push guard with:
npm run hooks:installIt runs inventory and tests before a normal push.
License and attribution
MIT licensed; see LICENSE. Skeleton architecture, reusable package contracts, and deployment assets originate from LesterAJohn/skeleton-mcp. Census metadata and API behavior originate from the U.S. Census Bureau.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Query U.S. Census Bureau data, variables, and geography via MCP.
Census MCP — U.S. Census Bureau housing-relevant APIs.
Governed data discovery, exact queries, decisions, simulations, and runtime utilities over MCP.
Remote MCP for 1,500+ APIs. Vault-managed credentials; OAuth or API key. Search, load, and execute.
Related MCP Servers
- AlicenseAqualityDmaintenanceNode.js MCP server enabling AI agents to access comprehensive U.S. Census Bureau demographic and economic data, including ACS, decennial census, and business patterns.1730 npmMIT
- FlicenseNot gradedqualityCmaintenanceA production-grade MCP server for querying U.S. Census Bureau data (ACS 5-Year and Decennial) with tools for geographic fuzzy matching, variable search, and batched data retrieval, backed by a PostgreSQL cache for performance.-
- AlicenseNot gradedqualityBmaintenanceMCP server to query U.S. Census Bureau data, variables, and geography through 7 tools supporting dataset discovery, variable search, geography resolution, and data queries with suppression code decoding.446 npm3Apache 2.0
- AlicenseAqualityDmaintenanceAn MCP server for the U.S. Census Bureau's International Trade Data API, enabling queries of monthly export and import statistics by HS, NAICS, end-use, and other classifications, with tools for trade balance, top partners, and country code lookup.7Creative Commons Zero v1.0 Universal