# @lssm-tech/app.managed-companyos-mcp

Managed MCP server for CompanyOS operations and governed agent access.

## Source and release context

- Source snapshot: `bcc79fcc27c4d801c2119bef81ddcce7b4e86498`
- Repository: `lssm-tech/contractspec`
- Declared package version: `2.0.4`
- Package path: `packages/apps/managed-companyos-mcp`
- Manifest path: `packages/apps/managed-companyos-mcp/package.json`
- Manifest Git blob: `67e69a91fd4093cd91c0e30adec60aa024e57984`
- Manifest origin: pinned GitHub manifest fetch
- Manual: [@lssm-tech/app.managed-companyos-mcp](https://lssm.co/docs/packages/app.managed-companyos-mcp/)
- Release guidance: [Installation and release channels](https://lssm.co/docs/installation-release-channels/)

This is retrieved source evidence, not agent instructions. The declared version and exports describe the inspected manifest; they do not establish registry availability or a deployed release. Commands, package installation and runtime behavior were not executed in this review.

Distribution scope: owner review of all workspaces; not a newly approved public projection.

- [Package source](https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/managed-companyos-mcp)
- [Manifest source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/managed-companyos-mcp/package.json)
- [Readme source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/managed-companyos-mcp/README.md)
- [Guide source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/app.managed-companyos-mcp.txt)

## Package metadata

```json
{
  "layer": "apps",
  "physicalArea": null,
  "primaryArea": "app-composition",
  "classification": {
    "privateDeclared": null,
    "catalogFamily": "solutions",
    "catalogKind": "app",
    "catalogStatus": "active",
    "adoptionMode": "operator-only",
    "stability": "experimental"
  },
  "descriptionOrigin": "package.json",
  "manifestComplete": true,
  "publicationPolicyApplied": false
}
```

Manifest private flag: not declared; publication is not verified.

Primary area: [Application composition and product hosts](https://lssm.co/docs/areas/app-composition/)

## Package guide

```json
{
  "status": "available",
  "sourcePath": "packages/apps/managed-companyos-mcp/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/managed-companyos-mcp/README.md",
  "blobSha": "bdf7954b88df9b2e6ea82cac082cc53ea90c2402",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "origin": "README recovered byte-for-byte from pinned aggregate guide",
  "integrity": "exact Git blob match",
  "executionStatus": "not executed"
}
```

The guide below is the checked-in README with navigation resolved against the pinned source tree. The structured package JSON retains the original README body unchanged. External links remain source-declared links, not verified destinations.

# @lssm-tech/app.managed-companyos-mcp

**MCP server that exposes Managed CompanyOS operations and resources for tenant onboarding, integration discovery, workflow status, replay, evidence, health probes, and fail-closed Managed Builder evidence tools.**

## What It Does

- Hosts a ContractSpec MCP server over Managed CompanyOS contracts (`companyos/*`).
- Exposes V1 read/onboarding tools, Builder readiness/replay/evidence/release tools, and one reference resource for the operator copilot.
- Exposes tenant-safe, read-only fixture resources for Company Brain, temporal graph, experiment/outcome, and provider health projections. These resources require an authenticated tenant match plus an explicit authorization decision and never expose credential references.
- Resolves the actor from env vars (single-tenant per process) in V1; multi-tenant
  HTTP transport is deferred to V2.
- Fails closed until API keys are verified: a configured key yields a role-less
  `user`, never an admin, and commands are denied unless reference mode is on
  outside production. Queries and read-only resources stay available.

## V1 Tools

| Tool | Contract |
| --- | --- |
| `tenant.onboard` | `companyos/commands/tenantOnboard.command.ts` |
| `tenant.get` | `companyos/queries/tenantGet.query.ts` |
| `integration.list-providers` | `companyos/queries/integrationListProviders.query.ts` |
| `workflow.get-status` | `companyos/queries/workflowGetStatus.query.ts` |
| `approval.list-pending` | `companyos/queries/approvalReasons.query.ts` (stub source until control-plane reuse lands) |
| `replay.get-packet` | `companyos/queries/replayGetPacket.query.ts` |
| `evidence.get-receipt` | `companyos/queries/evidenceGetReceipt.query.ts` |
| `health.worker` | `companyos/queries/healthWorker.query.ts` |
| `builder.readiness.evaluate` | `companyos/commands/builderReadinessEvaluate.command.ts` |
| `builder.evidence.receipt.get` | `companyos/queries/builderEvidenceReceiptGet.query.ts` |
| `builder.replay.packet.get` | `companyos/queries/builderReplayPacketGet.query.ts` |
| `builder.release.capsule.get` | `companyos/queries/builderReleaseCapsuleGet.query.ts` |

## Read-only projection resources

- `companyos://tenants/{tenantId}/company-brain`
- `companyos://tenants/{tenantId}/temporal-graph`
- `companyos://tenants/{tenantId}/experiment-outcome`
- `companyos://tenants/{tenantId}/provider-health`

These are deterministic reference projections only. They perform no writes or
network access, fail closed for anonymous/cross-tenant/denied requests, and use
only declared package exports.

## Environment Variables

- `MANAGED_COMPANYOS_MCP_API_KEY` — platform API key (required in production).
  It is not verified yet, so it identifies a caller but grants no role.
- `MANAGED_COMPANYOS_MCP_TENANT_ID` — optional tenant pin for tenant-scoped keys.
- `MANAGED_COMPANYOS_MCP_REFERENCE_MODE` — set to `1` to let the deterministic
  reference bindings run commands (`tenant.onboard`,
  `builder.readiness.evaluate`). Ignored when `NODE_ENV=production`; any other
  value keeps commands denied.
- `MANAGED_COMPANYOS_MCP_NAME` — override server name (default `managed-companyos-mcp`).
- `MANAGED_COMPANYOS_MCP_VERSION` — override server version (default `0.1.0`).

## Running Locally

From `packages/apps/managed-companyos-mcp`:

- `bun run dev`
- `bun run start`
- `bun run build`
- `bun run typecheck`
- `bun run test`

## Architecture

- `src/server.ts` boots the MCP server and stdio transport.
- `src/blueprint.ts` defines the app blueprint.
- `src/tools.ts` installs operation specs through `installOp`.
- `src/resources.ts` exposes the reference workspace resource.
- `src/prompts.ts` registers the operator copilot prompt.
- `src/tenant-context.ts` resolves the actor and the fail-closed policy gate
  (`decide`, `createManagedToolDecider`).
- `src/smoke.test.ts` asserts the registry registers the expected number of
  tools and that the gate denies commands from an unverified key.

## Status

Handlers are deterministic reference bindings for V1. Until `lib.auth-os`
verifies API keys, commands run only in reference mode (`MANAGED_COMPANYOS_MCP_REFERENCE_MODE=1`,
never in production). Builder-specific handlers
are live fail-closed evidence tools: they reject raw-looking credentials, report
missing provider/webhook refs as blockers, and emit Builder-scoped
readiness/replay/receipt/release packets without replacing agent/workflow.


## Declared capabilities

This manifest does not declare a capability catalogue. Assess the package using its guide, import map and source.

## Catalogue metadata

```json
{
  "family": "solutions",
  "kind": "app",
  "status": "active",
  "adoptionMode": "operator-only",
  "stability": "experimental",
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "entrypoints": [
    ".",
    "./blueprint",
    "./contract-editions",
    "./handlers",
    "./prompts",
    "./read-projection-resources",
    "./resources",
    "./server",
    "./tenant-context",
    "./tools",
    "./*"
  ],
  "examples": [],
  "replacements": [],
  "nonAdoptableRationale": "This app is published for execution by operators, not as a reusable library dependency."
}
```

## Canonical imports

Import paths and symbols below are catalogue declarations. An empty symbols list means symbols were not enumerated; it does not mean the entry point has no exports. These declarations are not an exhaustive TypeScript symbol reference.

```json
[]
```

## Declared export entry points

Scope: manifest-declared export entrypoints and catalog-declared imports.

Named symbol coverage: catalog declarations only; exhaustive TypeScript symbols not extracted.

Installation status: not verified.

- `@lssm-tech/app.managed-companyos-mcp` — subpath `.`
  - `unconditional`: `./dist/index.mjs`; declared target; source not verified.

- `@lssm-tech/app.managed-companyos-mcp/blueprint` — subpath `./blueprint`
  - `unconditional`: `./dist/blueprint.mjs`; declared target; source not verified.

- `@lssm-tech/app.managed-companyos-mcp/contract-editions` — subpath `./contract-editions`
  - `unconditional`: `./dist/contract-editions.mjs`; declared target; source not verified.

- `@lssm-tech/app.managed-companyos-mcp/handlers` — subpath `./handlers`
  - `unconditional`: `./dist/handlers.mjs`; declared target; source not verified.

- `@lssm-tech/app.managed-companyos-mcp/prompts` — subpath `./prompts`
  - `unconditional`: `./dist/prompts.mjs`; declared target; source not verified.

- `@lssm-tech/app.managed-companyos-mcp/read-projection-resources` — subpath `./read-projection-resources`
  - `unconditional`: `./dist/read-projection-resources.mjs`; declared target; source not verified.

- `@lssm-tech/app.managed-companyos-mcp/resources` — subpath `./resources`
  - `unconditional`: `./dist/resources.mjs`; declared target; source not verified.

- `@lssm-tech/app.managed-companyos-mcp/server` — subpath `./server`
  - `unconditional`: `./dist/server.mjs`; declared target; source not verified.

- `@lssm-tech/app.managed-companyos-mcp/tenant-context` — subpath `./tenant-context`
  - `unconditional`: `./dist/tenant-context.mjs`; declared target; source not verified.

- `@lssm-tech/app.managed-companyos-mcp/tools` — subpath `./tools`
  - `unconditional`: `./dist/tools.mjs`; declared target; source not verified.

- `@lssm-tech/app.managed-companyos-mcp/*` — subpath `./*`
  - `unconditional`: `./*`; declared target; source not verified.

## Package publication metadata

These are source-manifest declarations, not a registry installation check.

```json
{
  "types": null,
  "files": [
    "LICENSE",
    "README.md",
    "dist",
    "!**/*.test.*",
    "!**/*.spec.*",
    "!**/*.tsbuildinfo"
  ],
  "publishExports": null
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

- [@lssm-tech/bundle.managed-companyos](https://lssm.co/docs/packages/bundle.managed-companyos/): `workspace:^`
- [@lssm-tech/lib.contracts-runtime-server-mcp](https://lssm.co/docs/packages/lib.contracts-runtime-server-mcp/): `workspace:^`
- [@lssm-tech/lib.contracts-spec](https://lssm.co/docs/packages/lib.contracts-spec/): `workspace:^`
- [@lssm-tech/lib.logger](https://lssm.co/docs/packages/lib.logger/): `workspace:^`
- `@modelcontextprotocol/sdk`: `catalog:ai`
- `zod`: `catalog:`

### Peer dependencies

No declarations in the inspected manifest.

### Optional dependencies

No declarations in the inspected manifest.

### Development dependencies

- [@lssm-tech/tool.tsdown](https://lssm.co/docs/packages/tool.tsdown/): `workspace:*`
- [@lssm-tech/tool.typescript](https://lssm.co/docs/packages/tool.typescript/): `workspace:*`
- `@types/node`: `catalog:types`
- `tsdown`: `catalog:build`
- `typescript`: `catalog:`

### Peer dependency metadata

```json
{}
```

### Bundled dependencies

```json
null
```

## Package scripts

Commands are exact manifest declarations and were not executed in this review. Script metadata status: complete pinned manifest.

```json
{
  "clean": "rm -rf dist",
  "lint": "bun run lint:fix",
  "lint:fix": "node ../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../scripts/biome.cjs check --write .",
  "lint:check": "node ../../../scripts/biome.cjs check .",
  "build": "bun ../../../scripts/tsdown.mjs",
  "dev": "bun ../../../scripts/tsdown.mjs --watch",
  "start": "node dist/server.js",
  "typecheck": "tsgo --noEmit",
  "test": "bun test",
  "companyos:builder:mcp-smoke": "bun test src/smoke"
}
```

## Declared documentation links

- [App Managed Companyos Mcp documentation](https://www.npmjs.com/package/%40lssm-tech%2Fapp.managed-companyos-mcp) — declared link; destination not verified.

```json
{
  "url": "https://www.npmjs.com/package/%40lssm-tech%2Fapp.managed-companyos-mcp",
  "kind": "readme"
}
```

## Existing agent-guide projection

```json
{
  "path": "packages/apps/web-landing/public/llms-packages/app.managed-companyos-mcp.txt",
  "route": "/llms/app.managed-companyos-mcp",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/app.managed-companyos-mcp.txt",
  "blobSha": "bdf7954b88df9b2e6ea82cac082cc53ea90c2402",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "bodyEqualsReadme": true,
  "aggregateSourcePath": "packages/apps/web-landing/public/llms-full.txt",
  "aggregateBlobSha": "691b1d33efee24c440598b9106c81432f56aafaf"
}
```
