
Security News
White House Authorizes Private Companies to Conduct Offensive Cyber Operations
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.
@hlos/mcp-sdk
Advanced tools
Core authentication and utilities for HLOS MCP server packages.
Downstream server packages should use bootstrapServer() to get consistent startup behavior:
ServerMetadata.env) are validated before start() runs.formatEnvHelp(metadata) prints deterministic, sorted env var help.bootstrapServer strips exact values for env vars marked sensitive: true in ServerMetadata.env (and also applies token-pattern redaction).Minimal pattern:
import { bootstrapServer, formatEnvHelp, type ServerMetadata } from '@hlos/mcp-sdk';
export const SERVER_METADATA: ServerMetadata = {
id: 'my-server',
packageName: '@hlos/mcp-server-my-server',
binName: 'mcp-server-my-server',
description: '…',
hostedEndpoint: 'https://mcp.hlos.ai/my-server',
env: [{ name: 'HLOS_ACCESS_TOKEN', required: true, sensitive: true }],
capabilities: [],
};
if (process.argv.includes('--help')) {
console.log(formatEnvHelp(SERVER_METADATA));
process.exit(0);
}
await bootstrapServer({
metadata: SERVER_METADATA,
start: async ({ env, logger }) => {
logger.info(`Starting ${SERVER_METADATA.id}`);
// Use env[...] and never log secrets.
},
});
This package maintains canonical contracts (auth result shapes, hosted config shapes, shared metadata) and generates deterministic artifacts into src/generated/.
Versioning: CONTRACTS_VERSION follows SemVer:
Update / add Zod schemas in scripts/schema.ts
Regenerate committed artifacts:
pnpm -C packages/core generate:schemas
pnpm -C packages/core generate:schemas:check
import { CONTRACTS_SCHEMA, CONTRACTS_VERSION, assertContractsVersion } from '@hlos/mcp-sdk';
// Fail fast if you expect a compatible contracts major version:
assertContractsVersion('1.');
// CONTRACTS_SCHEMA is an embedded JSON Schema bundle you can feed into Ajv, etc.
console.log(CONTRACTS_VERSION, Object.keys((CONTRACTS_SCHEMA as any).schemas));
MCP servers can forward optional attribution metadata for downstream billing and analytics:
import type { AttributionMetadata } from '@hlos/mcp-sdk';
const attribution: AttributionMetadata = {
distributionSurface: 'discord', // "discord", "slack", "cli", "api", "web", "unknown"
clientType: 'claude_desktop', // "claude_desktop", "claude_code", "chatgpt", "ide", "api", "unknown"
};
Set defaults via environment variables:
| Env Var | Field | Example |
|---|---|---|
HLOS_DISTRIBUTION_SURFACE | distributionSurface | "discord" |
HLOS_CLIENT_TYPE | clientType | "claude_desktop" |
These defaults are baked into ServerMetadata.attribution and passed to the BootstrapContext:
await bootstrapServer({
metadata: SERVER_METADATA,
start: async (ctx) => {
// ctx.attribution?.distributionSurface
// ctx.attribution?.clientType
},
});
Server-level attribution is a default. Per-request attribution overrides (via headers or context) may be added in the future. Prefer per-request values when available.
FAQs
Surface SDK for HLOS MCP servers — bootstrap, auth, and Kernel client
We found that @hlos/mcp-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.