lattice-talk 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,58 @@
1
+ # MCP compatibility
2
+
3
+ How Lattice Talk relates to the [Model Context Protocol](https://modelcontextprotocol.io/docs) specifications and SDK generations. This page is the detail; the README stays product-level.
4
+
5
+ ## Summary
6
+
7
+ | Aspect | Value |
8
+ | --- | --- |
9
+ | Docs / spec hub | <https://modelcontextprotocol.io/docs> · <https://modelcontextprotocol.io/specification/2026-07-28> |
10
+ | Current spec revision | **2026-07-28** (stateless core, `server/discover`, per-request `_meta`) |
11
+ | SDK Lattice uses | **SDK v2 stable line** — `@modelcontextprotocol/server` 2.x (plus `@modelcontextprotocol/client` 2.x in tests) |
12
+ | Bytes on the wire | **initialize-era by default**; the 2026-07-28 stateless wire is an explicit opt-in per the SDK's migration docs |
13
+ | Feature shape | Aligned with the current 2026-07-28 docs (tools / resources / prompts, annotations, `structuredContent`, stderr logging) |
14
+
15
+ ## Why "SDK v2 but initialize wire" is the correct combination
16
+
17
+ The [2026-07-28 announcement](https://blog.modelcontextprotocol.io/posts/2026-07-28/) describes MCP's move from a bidirectional stateful protocol to a request/response stateless core: the `initialize` handshake and `Mcp-Session-Id` are retired, every request carries protocol version/client identity/capabilities in `_meta`, and `server/discover` lets clients learn capabilities up front.
18
+
19
+ The TypeScript SDK v2 line is the stable release line supporting that specification. One important nuance from the SDK's own migration documentation: **constructing a normal v2 `Client`/`Server` still defaults to the 2025-era `initialize` wire** — speaking the 2026-07-28 stateless wire requires explicit opt-in/version negotiation. SDK v2 also maintains the legacy inbound route so modern clients can probe `server/discover` and fall back to `initialize` against servers like Lattice.
20
+
21
+ Lattice keeps that default deliberately:
22
+
23
+ * Today's installed stdio hosts — Claude Code, Cursor, Codex — connect with the `initialize` handshake and work unchanged.
24
+ * The 2026-07-28 spec defines the fallback path: modern clients probe with `server/discover`, and legacy-answer servers fall back to `initialize`. An initialize-era server is therefore reachable from both worlds.
25
+ * Nothing in Lattice's feature set depends on the old handshake; when the host ecosystem flips, enabling the stateless wire is an SDK-level change, not an application rewrite.
26
+
27
+ ## What Lattice implements per current docs
28
+
29
+ These behaviors follow the 2026-07-28 docs regardless of wire era:
30
+
31
+ * **Flat tool input schemas** — `{ type: "object", properties }` with no root `anyOf`/`oneOf`/`allOf`, ASCII property names (Claude Code restricts them to `[A-Za-z0-9_.-]{1,64}`).
32
+ * **`outputSchema` + `structuredContent`** — every tool publishes a zod-derived output schema and returns structured content plus the same JSON serialized as text content (the spec's backwards-compatibility recommendation).
33
+ * **Tool execution errors are `isError` results**, not JSON-RPC failures — user mistakes (bad `room_id`, not joined, wrong token) come back as actionable `isError` content so the model can self-correct. `structuredContent` is omitted on error results because clients validate it against `outputSchema` even on `isError`.
34
+ * **Unknown resources return `-32602`** (Invalid params) — the 2026-07-28 code for a missing resource, replacing the old `-32002` (the SDK v2 `ResourceNotFoundError` emits exactly this). Lattice never returns an empty `contents` array for a missing session.
35
+ * **Annotations** on every tool (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint: false` — Lattice tools talk only to this process and the configured store). Clients treat them as untrusted hints per the spec.
36
+ * **`listChanged: false`** on tools, resources, and prompts — Lattice never emits list-changed notifications, and its lists do not vary per connection (resource listings derive from process env, not from who joined).
37
+ * **stdio transport rules** — JSON-RPC on stdout, one message per line, all logging on stderr, graceful shutdown on stdin EOF (the spec's primary portable shutdown signal).
38
+ * **Deterministic lists** — tools, prompts, and resources come back in stable order.
39
+ * **Pagination** — `list_peers`, `memory_list`, `memory_notes` use opaque cursor strings with `next_cursor`/`truncated` fields, mirroring the protocol's cursor model at the tool layer.
40
+ * **Stdio + env credentials** — the spec says stdio implementations should retrieve credentials from the environment rather than the HTTP authorization framework; Lattice takes Redis credentials and `LATTICE_JOIN_TOKEN` only from env and refuses them as tool arguments.
41
+
42
+ ## Not implemented (by design)
43
+
44
+ * The 2026-07-28 stateless wire itself (`server/discover`, per-request `_meta` negotiation, `resultType`) — requires the SDK's explicit opt-in; Lattice serves hosts on the initialize era until the ecosystem moves.
45
+ * `subscriptions/listen`, resource subscriptions — Lattice's read model is pull-based (`pull_messages` with per-agent cursors).
46
+ * Progress, cancellation, logging (`notifications/message`) utilities — Lattice logs to stderr and answers quickly; nothing to cancel or stream today.
47
+ * Roots, sampling, elicitation — deprecated in 2026-07-28; a session bus has no use for them.
48
+
49
+ ## References
50
+
51
+ * Spec: <https://modelcontextprotocol.io/specification/2026-07-28>
52
+ * 2026-07-28 announcement: <https://blog.modelcontextprotocol.io/posts/2026-07-28/>
53
+ * Key changes in 2026-07-28: <https://modelcontextprotocol.io/specification/2026-07-28/changelog>
54
+ * Tools: <https://modelcontextprotocol.io/specification/2026-07-28/server/tools>
55
+ * Resources: <https://modelcontextprotocol.io/specification/2026-07-28/server/resources>
56
+ * Prompts: <https://modelcontextprotocol.io/specification/2026-07-28/server/prompts>
57
+ * stdio transport: <https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/stdio>
58
+ * TypeScript SDK v2: <https://ts.sdk.modelcontextprotocol.io/v2/> — packages `@modelcontextprotocol/server` (servers) and `@modelcontextprotocol/client` (clients), with the v1 line (`@modelcontextprotocol/sdk` 1.x) still maintained for older setups.
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "lattice-talk",
3
+ "version": "0.2.0",
4
+ "description": "Lattice — Cross-Harness MCP Session Bus. Shared sessions, DMs, rooms, memory, and OpenTelemetry for agents across Claude Code, Cursor, Codex, and custom harnesses.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "bin": {
8
+ "lattice-talk": "./dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "docs",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
16
+ "engines": {
17
+ "node": ">=20"
18
+ },
19
+ "scripts": {
20
+ "build": "tsup",
21
+ "start": "node dist/index.js",
22
+ "tui": "bun src/tui/main.tsx",
23
+ "test": "vitest run",
24
+ "typecheck": "tsc --noEmit",
25
+ "prepublishOnly": "npm run build"
26
+ },
27
+ "keywords": [
28
+ "mcp",
29
+ "mcp-server",
30
+ "lattice",
31
+ "session-bus",
32
+ "agents",
33
+ "claude",
34
+ "cursor",
35
+ "codex",
36
+ "opentelemetry",
37
+ "redis"
38
+ ],
39
+ "license": "MIT",
40
+ "author": "Lattice contributors",
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "git+https://github.com/d4rkNinja/lattice-talk.git"
44
+ },
45
+ "homepage": "https://github.com/d4rkNinja/lattice-talk#readme",
46
+ "bugs": {
47
+ "url": "https://github.com/d4rkNinja/lattice-talk/issues"
48
+ },
49
+ "dependencies": {
50
+ "@modelcontextprotocol/server": "^2.0.0",
51
+ "@opentui/core": "^0.5.11",
52
+ "@opentui/react": "^0.5.11",
53
+ "@opentelemetry/api": "^1.9.0",
54
+ "@opentelemetry/core": "^1.30.1",
55
+ "@opentelemetry/exporter-trace-otlp-http": "^0.57.2",
56
+ "@opentelemetry/resources": "^1.30.1",
57
+ "@opentelemetry/sdk-trace-base": "^1.30.1",
58
+ "@opentelemetry/sdk-trace-node": "^1.30.1",
59
+ "@opentelemetry/semantic-conventions": "^1.28.0",
60
+ "ioredis": "^5.8.2",
61
+ "react": "^19.2.0",
62
+ "zod": "^4.2.0"
63
+ },
64
+ "devDependencies": {
65
+ "@modelcontextprotocol/client": "^2.0.0",
66
+ "@types/node": "^24.5.2",
67
+ "@types/react": "^19.2.0",
68
+ "tsup": "^8.5.0",
69
+ "typescript": "^5.9.2",
70
+ "vitest": "^3.2.4"
71
+ }
72
+ }