Environment:1mcp app Agent Node js Runtime
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, Runtime |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Node.js 24 runtime with pnpm 12.10.1, TypeScript 5.3+, and the MCP SDK — the base execution environment for all 1MCP Agent source, tests, and CLI.
Description
The 1MCP Agent is a TypeScript application compiled to ES modules and run on Node.js. The `.node-version` file pins Node.js 24 as the canonical version for development, CI, and local testing. The `packageManager` field in `package.json` pins pnpm@12.10.1 via corepack. Dependencies include `@modelcontextprotocol/sdk` 1.30.0 (legacy), `@modelcontextprotocol/core` 2.3.1, `express` 5.1, `zod` 4.6.7, `winston` 3.17, and `yargs` 18. The build emits ES module output to `build/` via `tsc` with `tsconfig.build.json`; the CLI entry point is `build/index.js`. The SEA (Single Executable Application) bundle is built with `esbuild` and `postject` for platform-specific binaries.
Usage
Use this environment for any development, build, test, or CLI execution task. Every implementation in the repository requires this runtime. The `pnpm dev` watcher and `pnpm build` script both operate within this environment. The `pnpm check` gate runs static, source/Admin unit, release, and permission checks.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Linux, macOS, or Windows | Alpine Linux used in Docker; Ubuntu 24.04 in CI |
| Node.js | 24.x | Pinned in `.node-version`; CI reads this file via `actions/setup-node` |
| pnpm | 12.10.1 | Pinned in `package.json` `packageManager`; enabled via corepack |
| Disk | 1GB+ | Node modules, build artifacts, and SEA binaries |
| RAM | 512MB minimum | Schema validation workers use up to 128MB heap each |
Dependencies
System Packages
- `node` = 24 (from `.node-version`)
- `pnpm` = 12.10.1 (via `corepack enable`)
- `git` (for husky hooks and version resolution)
Runtime Dependencies (npm)
- `@modelcontextprotocol/sdk` = 1.30.0 (legacy, vendored under `src/sdk/legacy/`)
- `@modelcontextprotocol/core` = 2.3.1
- `@modelcontextprotocol/client` = 2.3.1
- `@modelcontextprotocol/server` = 2.3.1
- `express` >= 5.1.0
- `zod` = 4.6.7
- `winston` >= 3.17.0
- `yargs` >= 18.0.0
- `ajv` >= 8.17.1
- `axios` >= 1.20.0
- `tiktoken` >= 1.0.22
Development Dependencies
- `typescript` >= 5.3.3
- `vitest` >= 5.0.3
- `esbuild` >= 0.28.0
- `eslint` >= 10.6.0
- `vitepress` >= 1.6.3 (docs build)
- `playwright` = 1.64.1 (E2E browser tests)
Credentials
The following environment variables can be set (all optional for local development):
- `ONE_MCP_CONFIG`: Path to the config file (default: `~/.config/1mcp/mcp.json`)
- `ONE_MCP_CONFIG_DIR`: Path to the config directory
- `ONE_MCP_LOG_LEVEL`: Log level — `debug`, `info`, `warn`, or `error`
- `ONE_MCP_LOG_FILE`: File path for log output
- `ONE_MCP_PORT`: HTTP listen port (default: 3050)
- `ONE_MCP_HOST`: HTTP bind host (default: `localhost`)
- `ONE_MCP_EXTERNAL_URL`: External URL for OAuth callback resolution
- `ONE_MCP_ENABLE_AUTH`: Enable server-side authentication (`true`/`false`)
- `ONE_MCP_ENABLE_ASYNC_LOADING`: Enable non-blocking startup (`true`/`false`)
- `ONE_MCP_ADMIN_USERNAME`: Admin console bootstrap username
- `ONE_MCP_ADMIN_PASSWORD`: Admin console bootstrap password
- `ONE_MCP_PRODUCT_TELEMETRY`: Opt-in/out of product usage telemetry
- `ONE_MCP_PROJECT_OWNER`: Override automatic session ownership credential
Quick Install
# Install Node.js 24 (use nvm, fnm, or direct download)
nvm install 24
nvm use 24
# Enable pnpm via corepack
corepack enable
corepack prepare pnpm@12.10.1 --activate
# Install dependencies
pnpm install --frozen-lockfile
# Build the application
pnpm build
# Start development watcher (creates .env from .env.example if absent)
pnpm dev
Code Evidence
Node version pin from `.node-version:1`:
24
Package manager pin from `package.json:26`:
"packageManager": "pnpm@12.10.1"
CI setup reads `.node-version` from `.github/actions/setup-node-pnpm/action.yml:28`:
- name: Setup Node.js with dependency cache
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: pnpm
package-manager-cache: false
Config directory resolution by OS from `src/constants/paths.ts:30-32`:
const configDir =
process.platform === 'darwin' || process.platform === 'linux'
? `${homeDir}/.config/${CONFIG_DIR_NAME}`
: `${homeDir}/AppData/Roaming/${CONFIG_DIR_NAME}`;
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `corepack: command not found` | Node.js too old; corepack requires Node >= 16.9 | Install Node.js 24 from `.node-version` |
| `ERR_PNPM_PEER_DEP_ISSUES` | Lockfile out of sync | Run `pnpm install --frozen-lockfile` with exact pnpm version |
| `LOG_LEVEL is deprecated` | Using legacy `LOG_LEVEL` env var | Use `ONE_MCP_LOG_LEVEL` or `--log-level` CLI option |
| `tsc: command not found` | Build tools not installed | Run `pnpm install` (not `--prod`) before `pnpm build` |
Compatibility Notes
- Alpine Linux (Docker): Uses `node:22-alpine` as the Dockerfile fallback if `NODE_VERSION` arg is unset; `.node-version` pins 24 for local/CI. The `basic` and `extended` Docker targets inherit the build-stage Node version.
- Windows: Config directory is `AppData/Roaming/1mcp` instead of `~/.config/1mcp`. Windows Task Scheduler integration documented separately.
- SEA binaries: Single Executable Application binaries bundle the Node.js runtime; they do not require a separate Node.js install but are platform-specific (`darwin-arm64`, `linux-x64`, `win32-x64`, etc.).
- E2E tests: Use `NODE_COMPILE_CACHE` in CI to reuse bytecode across CLI launches on fresh runners.
Related Pages
- Implementation:1mcp_app_Agent_setupServer
- Implementation:1mcp_app_Agent_serveCommand
- Implementation:1mcp_app_Agent_runCommand
- Implementation:1mcp_app_Agent_cliSetupCommand
- Implementation:1mcp_app_Agent_McpLoadingManager
- Implementation:1mcp_app_Agent_ConfigManager
- Implementation:1mcp_app_Agent_ServerManager
- Implementation:1mcp_app_Agent_ClientManager
- Implementation:1mcp_app_Agent_PresetManager
- Implementation:1mcp_app_Agent_inspectCommand
- Implementation:1mcp_app_Agent_instructionsCommand
- Implementation:1mcp_app_Agent_Global_Options
- Implementation:1mcp_app_Agent_Release_Pipeline_Workflow
- Implementation:1mcp_app_Agent_Test_And_Validate_Workflow
- Implementation:1mcp_app_Agent_Pnpm_Lockfile