stateless-mcp-incident-lab-typescript-sdk

stateless-mcp-incident-lab-typescript-sdk

A stateless MCP server for incident lab operations, exposing MCP and health endpoints, with conformance testing.

Category
访问服务器

README

Stateless MCP Incident Lab — TypeScript SDK

Official @modelcontextprotocol/sdk implementation of the Stateless MCP Incident Lab.

Requirements

  • Node.js 24+
  • The external conformance repository checked out as ../stateless-mcp-incident-lab-conformance (or set CONFORMANCE_PATH)

Development

npm ci
npm run format
npm run lint
npm run typecheck
npm test
npm run test:coverage
npm run test:conformance
npm run test:mutation

The external suite holds 197 golden contracts; the SDK lane selects and runs 159 of them. Conformance fixtures remain in the external repository and are never copied into this implementation.

Runtime

npm run build
npm start

The server listens on port 3102 by default (PORT overrides it). Every request crosses an official @modelcontextprotocol/sdk Server/Client pair over InMemoryTransport before application dispatch, carrying the request's real JSON-RPC method, its params, and the negotiated protocol version for the SDK's own request schema to validate. The lab's 2026-07-28 wire revision — the _meta protocol-version envelope, resultType/requestState/inputRequests results, and Mcp-Method/Mcp-Name header mirroring — is not representable by the pinned SDK's HTTP transport, so HTTP framing and header validation remain in this adapter:

  • MCP: POST /sdk/mcp
  • Health: GET /sdk/healthz

The same executable is the network client; the command group comes first, with no client prefix:

node dist/src/main.js discover http://localhost:3102/sdk/mcp
node dist/src/main.js tools list http://localhost:3102/sdk/mcp
node dist/src/main.js tools call http://localhost:3102/sdk/mcp get_incident '{"incident_id":"..."}'

Configuration

  • PORT (default 3102) and HOST (default 127.0.0.1; the image sets 0.0.0.0).
  • MCP_REQUEST_STATE_SECRET — at least 32 bytes. Required when NODE_ENV=production: without it /sdk/healthz reports 503 and signing requestState fails. Outside production a per-process random key is used, so signed state does not survive a restart or span replicas.
  • EFFECT_STORE — memory for explicit local, per-replica state, or dynamodb for durable shared state.
  • DYNAMODB_TABLE — required with EFFECT_STORE=dynamodb. Create this table with string partition and sort keys named PK and SK; enable DynamoDB TTL on the numeric attribute ttl so expired incident rows are eventually reaped. The single-table adapter uses strongly consistent reads, conditional lifecycle writes, and an atomic effect-claim/incident-mitigation transaction. Its health probe performs one non-mutating strongly consistent read when the same store instance backs both persistence interfaces.

Container

docker build -t incident-lab-sdk .
docker run --rm -p 3102:3102 \
  -e EFFECT_STORE=memory \
  -e MCP_REQUEST_STATE_SECRET=0123456789abcdef0123456789abcdef \
  incident-lab-sdk
curl http://localhost:3102/sdk/healthz

The Docker test target accepts the conformance repository as a named build context, as demonstrated by CI.

Quality gates

CI enforces formatting, lint, type checking, unit tests, coverage thresholds (90% statements/functions/lines, 80% branches), the complete SDK conformance lane, production dependency audit, build, mutation score ≥80%, the charter invariants (197 external contracts, zero vendored fixtures, the architecture contract directories, and no suppression pragmas in src/), the container test target, and a build-and-probe of the production image against /sdk/healthz and a live server/discover.

The mutation gate is scoped to the decision-dense modules listed in stryker.config.mjs: the incident lifecycle and state machine, MRTR and request-state signing, the client cache and cache-key laws, the domain transition table, header codec, protocol validation, the capability scanner, version recovery, the official SDK dispatch boundary (sdk-registry.ts:59-107), and the complete DynamoDB adapter. The ≥80% score speaks only to those modules. It deliberately excludes the HTTP framing in server.ts and the request-metadata validation in http.ts, whose behaviour is covered instead by the live-server integration tests in test/unit/main.test.ts and by the external conformance lane. The implementation stub scan stays a local step because it is supplied by the separate cdd-skills tooling repository, which CI does not check out.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选