@praxis-ai/praxis 0.1.3 → 0.1.5

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.
Files changed (56) hide show
  1. package/dist/agentCore/index.d.ts +11 -3
  2. package/dist/applicationLayer/applicationRuntime.js +7 -1
  3. package/dist/basetool/authoring.d.ts +2 -0
  4. package/dist/basetool/authoring.js +2 -0
  5. package/dist/basetool/catalog.d.ts +1 -1
  6. package/dist/basetool/catalog.js +86 -4
  7. package/dist/basetool/core/index.d.ts +4 -2
  8. package/dist/basetool/core/index.js +8 -0
  9. package/dist/basetool/core/mcpCompletions.d.ts +2 -0
  10. package/dist/basetool/core/mcpCompletions.js +70 -0
  11. package/dist/basetool/core/mcpPrompts.d.ts +2 -0
  12. package/dist/basetool/core/mcpPrompts.js +48 -0
  13. package/dist/basetool/core/mcpResources.js +41 -5
  14. package/dist/basetool/profiles.js +15 -1
  15. package/dist/basetool/registry.d.ts +1 -1
  16. package/dist/basetool/supportCatalog.js +23 -6
  17. package/dist/runtimeImplementation/praxisRuntimeKernel.js +1696 -1499
  18. package/dist/runtimeImplementation/runtime.execEngine/baseToolApprovalScope.js +11 -0
  19. package/dist/runtimeImplementation/runtime.execEngine/baseToolExecutorPortFactory.js +13 -1
  20. package/dist/runtimeImplementation/runtime.execEngine/baseToolPolicyAdjudicator.js +14 -0
  21. package/dist/runtimeImplementation/runtime.execEngine/mcpRuntimeAdapter.d.ts +27 -0
  22. package/dist/runtimeImplementation/runtime.execEngine/mcpRuntimeAdapter.js +648 -56
  23. package/dist/runtimeImplementation/runtime.execEngine/promptContextAssembly.d.ts +1 -0
  24. package/dist/runtimeImplementation/runtime.execEngine/promptContextAssembly.js +18 -0
  25. package/dist/runtimeImplementation/runtime.mcpPlane/index.d.ts +20 -7
  26. package/dist/runtimeImplementation/runtime.mcpPlane/index.js +105 -89
  27. package/dist/toolBase/catalog.d.ts +24 -0
  28. package/dist/toolBase/catalog.js +41 -3
  29. package/dist/toolBase/profiles.d.ts +3 -3
  30. package/dist/toolBase/profiles.js +2 -0
  31. package/dist/toolBase/types.d.ts +1 -1
  32. package/examples/raxode-mcp-plus-ten-server.config.json +229 -0
  33. package/examples/scripts/README.md +8 -2
  34. package/examples/scripts/mcp-plus-native-smoke.ts +1296 -0
  35. package/package.json +4 -2
  36. package/raxode-tui/dist/raxode-cli/backend/agents/codingAgent/prompts/tool-use.md +1 -1
  37. package/raxode-tui/dist/raxode-cli/backend/application/mcpConfig.d.ts +9 -0
  38. package/raxode-tui/dist/raxode-cli/backend/application/mcpConfig.js +65 -0
  39. package/raxode-tui/dist/raxode-cli/backend/application/mcpReadinessSummary.d.ts +28 -0
  40. package/raxode-tui/dist/raxode-cli/backend/application/mcpReadinessSummary.js +57 -0
  41. package/raxode-tui/dist/raxode-cli/backend/application/runtimeReadiness.d.ts +5 -1
  42. package/raxode-tui/dist/raxode-cli/backend/application/runtimeReadiness.js +40 -0
  43. package/raxode-tui/dist/raxode-cli/backend/application/stdioApplicationServer.js +6 -0
  44. package/raxode-tui/dist/raxode-cli/backend/directApplicationBackend.d.ts +4 -0
  45. package/raxode-tui/dist/raxode-cli/backend/directApplicationBackend.js +14 -0
  46. package/raxode-tui/dist/raxode-cli/backend/raxodeBackend.d.ts +1 -1
  47. package/raxode-tui/dist/raxode-cli/backend/raxodeBackend.js +16 -1
  48. package/raxode-tui/dist/raxode-cli/contracts.d.ts +1 -0
  49. package/raxode-tui/dist/raxode-cli/frontend/bridge/readiness.js +24 -0
  50. package/raxode-tui/dist/raxode-cli/frontend/tui/app/direct-tui.js +35 -0
  51. package/raxode-tui/dist/raxode-cli/frontend/tui/cli/raxode-cli.d.ts +2 -0
  52. package/raxode-tui/dist/raxode-cli/frontend/tui/cli/raxode-cli.js +8 -0
  53. package/raxode-tui/dist/raxode-cli/frontend/tui/config/raxode-config.d.ts +31 -0
  54. package/raxode-tui/dist/raxode-cli/frontend/tui/config/raxode-config.js +129 -0
  55. package/raxode-tui/dist/raxode-cli/index.d.ts +1 -0
  56. package/raxode-tui/package.json +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praxis-ai/praxis",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Praxis agentCore architecture scaffold, tests, and engineering contracts.",
@@ -129,6 +129,8 @@
129
129
  "example:minimal": "node --import tsx examples/minimal/runRepoInspector.ts",
130
130
  "example:fullstack": "node --import tsx examples/fullstack/runRepoInspector.ts",
131
131
  "smoke:agentCore": "node --import tsx examples/scripts/agentcore_smoke.ts",
132
+ "smoke:mcp-external-transport": "node --import tsx examples/scripts/agentcore_mcp_external_transport_smoke.ts --no-model",
133
+ "smoke:mcp-plus-native": "node --import tsx examples/scripts/mcp-plus-native-smoke.ts",
132
134
  "smoke:modelAdapter": "node --import tsx examples/scripts/modelAdapter_smoke.ts",
133
135
  "raxode:typecheck": "tsc -p raxode-tui/tsconfig.json --noEmit",
134
136
  "raxode:test:backend": "cd raxode-tui && node --import tsx --test raxode-cli/frontend/bridge/*.test.ts raxode-cli/frontend/tui/cli/*.test.ts raxode-cli/frontend/tui/input/*.test.ts raxode-cli/backend/tests/*.test.ts",
@@ -154,7 +156,7 @@
154
156
  "@lancedb/lancedb": "^0.27.2",
155
157
  "@modelcontextprotocol/sdk": "^1.29.0",
156
158
  "@openai/agents": "^0.7.2",
157
- "@praxis-ai/mcp-plus": "^1.0.0",
159
+ "@praxis-ai/mcp-plus": "1.0.1",
158
160
  "@praxis-ai/raxcell": "^0.1.5",
159
161
  "@types/react": "^18.3.28",
160
162
  "apache-arrow": "^18.1.0",
@@ -21,6 +21,6 @@ Tool use rules:
21
21
  - For prices, quotes, news, or other time-sensitive facts, do not answer from a prepared search request or an empty-source native search result. Report the source, timestamp/market date, and unit when available.
22
22
  - Browser, computer-use, image, audio, and media tools are optional extension tools. If they are not mounted in the current toolDeclarations, do not pretend they are available. Use deterministic shell, file, and web evidence when those optional tools are absent.
23
23
  - Use `web.search` and `web.fetch` for current external information and source-backed answers when they are mounted.
24
- - Use `mcp.use`, `mcp.resources`, and `skill.load` through their declared Praxis basetool surfaces.
24
+ - Use `mcp.use`, `mcp.resources`, `mcp.prompts`, and `skill.load` through their declared Praxis basetool surfaces.
25
25
  - Use `tool.discover` and `tool.describe` when you need to confirm mounted tools or get tool-specific guidance.
26
26
  - Destructive actions must follow the active permission profile and application approval surface.
@@ -0,0 +1,9 @@
1
+ import type { CreateApplicationProjectRuntimeOptions } from "@praxis-ai/praxis/application-layer";
2
+ import { type RaxodeMcpConfig } from "../../frontend/tui/config/raxode-config.js";
3
+ import { type RaxodeMcpReadinessSummary } from "./mcpReadinessSummary.js";
4
+ type RuntimeMcpPlusOptions = CreateApplicationProjectRuntimeOptions["mcpPlus"];
5
+ export declare function loadRaxodeMcpRuntimeOptions(fallbackDir?: string): Pick<CreateApplicationProjectRuntimeOptions, "mcpServers" | "mcpPlus">;
6
+ export declare function createRaxodeMcpRuntimeOptions(config: RaxodeMcpConfig): Pick<CreateApplicationProjectRuntimeOptions, "mcpServers" | "mcpPlus">;
7
+ export declare function loadRaxodeMcpReadinessSummary(fallbackDir?: string): RaxodeMcpReadinessSummary;
8
+ export declare function mergeRaxodeMcpPlusRuntimeOptions(configured: RuntimeMcpPlusOptions, explicit: RuntimeMcpPlusOptions): RuntimeMcpPlusOptions;
9
+ export {};
@@ -0,0 +1,65 @@
1
+ import { loadRaxodeMcpConfig, } from "../../frontend/tui/config/raxode-config.js";
2
+ import { createRaxodeMcpReadinessSummary, } from "./mcpReadinessSummary.js";
3
+ function runtimeMcpServerFromConfig(server) {
4
+ const common = {
5
+ serverId: server.serverId,
6
+ mode: server.mode,
7
+ title: server.title,
8
+ summary: server.summary,
9
+ timeoutMs: server.timeoutMs,
10
+ manifest: server.manifest,
11
+ metadata: {
12
+ ...(server.metadata ?? {}),
13
+ source: "raxode.config.mcp",
14
+ },
15
+ };
16
+ if (server.transport === "stdio") {
17
+ return {
18
+ ...common,
19
+ transport: "stdio",
20
+ command: server.command,
21
+ args: server.args,
22
+ cwd: server.cwd,
23
+ env: server.env,
24
+ framing: server.framing,
25
+ };
26
+ }
27
+ return {
28
+ ...common,
29
+ transport: server.transport,
30
+ url: server.url,
31
+ sseUrl: server.sseUrl,
32
+ headers: server.headers,
33
+ };
34
+ }
35
+ export function loadRaxodeMcpRuntimeOptions(fallbackDir = process.cwd()) {
36
+ return createRaxodeMcpRuntimeOptions(loadRaxodeMcpConfig(fallbackDir));
37
+ }
38
+ export function createRaxodeMcpRuntimeOptions(config) {
39
+ const servers = config.servers
40
+ .filter((server) => server.enabled)
41
+ .map(runtimeMcpServerFromConfig);
42
+ const mcpPlus = config.projectId === undefined && config.reprofileConsecutiveIndexedCalls === undefined
43
+ ? undefined
44
+ : {
45
+ projectId: config.projectId,
46
+ reprofileConsecutiveIndexedCalls: config.reprofileConsecutiveIndexedCalls,
47
+ };
48
+ return {
49
+ ...(servers.length === 0 ? {} : { mcpServers: servers }),
50
+ ...(mcpPlus === undefined ? {} : { mcpPlus }),
51
+ };
52
+ }
53
+ export function loadRaxodeMcpReadinessSummary(fallbackDir = process.cwd()) {
54
+ return createRaxodeMcpReadinessSummary(loadRaxodeMcpConfig(fallbackDir));
55
+ }
56
+ export function mergeRaxodeMcpPlusRuntimeOptions(configured, explicit) {
57
+ if (configured === undefined)
58
+ return explicit;
59
+ if (explicit === undefined)
60
+ return configured;
61
+ return {
62
+ ...configured,
63
+ ...explicit,
64
+ };
65
+ }
@@ -0,0 +1,28 @@
1
+ import type { CreateApplicationProjectRuntimeOptions } from "@praxis-ai/praxis/application-layer";
2
+ import type { RaxodeMcpConfig } from "../../frontend/tui/config/raxode-config.js";
3
+ export type RaxodeMcpReadinessSummary = {
4
+ kind: "raxode.mcpReadinessSummary";
5
+ schemaVersion: "raxode.mcpReadinessSummary.v1";
6
+ configuredServerCount: number;
7
+ enabledServerCount: number;
8
+ disabledServerCount: number;
9
+ enabledMcpPlusServerCount: number;
10
+ enabledNativeServerCount: number;
11
+ configuredServerIds: readonly string[];
12
+ enabledServerIds: readonly string[];
13
+ enabledMcpPlusServerIds: readonly string[];
14
+ enabledNativeServerIds: readonly string[];
15
+ recommendedMode: "mcp-plus";
16
+ nativeCompatible: true;
17
+ publicSafe: true;
18
+ profileIdentity: "serverId+project";
19
+ runtimeOverlayIdentity: "serverId+session";
20
+ schemaRefreshBoundary: "session-checkpoint";
21
+ projectId?: string;
22
+ reprofileConsecutiveIndexedCalls?: number;
23
+ };
24
+ export declare function createRaxodeMcpReadinessSummary(config?: RaxodeMcpConfig): RaxodeMcpReadinessSummary;
25
+ export declare function createRaxodeMcpReadinessSummaryFromRuntimeOptions(input: {
26
+ mcpServers?: CreateApplicationProjectRuntimeOptions["mcpServers"];
27
+ mcpPlus?: CreateApplicationProjectRuntimeOptions["mcpPlus"];
28
+ }): RaxodeMcpReadinessSummary;
@@ -0,0 +1,57 @@
1
+ /*
2
+ * 文件定位:raxode-cli / MCP readiness summary。
3
+ * 核心目的:把 Raxode MCP 配置转成 public-safe 的 runtime readiness 事实,不泄露 command/env/header。
4
+ */
5
+ export function createRaxodeMcpReadinessSummary(config) {
6
+ const servers = config?.servers ?? [];
7
+ const enabled = servers.filter((server) => server.enabled);
8
+ const mcpPlus = enabled.filter((server) => server.mode === "mcp-plus");
9
+ const native = enabled.filter((server) => server.mode === "native");
10
+ return {
11
+ kind: "raxode.mcpReadinessSummary",
12
+ schemaVersion: "raxode.mcpReadinessSummary.v1",
13
+ configuredServerCount: servers.length,
14
+ enabledServerCount: enabled.length,
15
+ disabledServerCount: servers.length - enabled.length,
16
+ enabledMcpPlusServerCount: mcpPlus.length,
17
+ enabledNativeServerCount: native.length,
18
+ configuredServerIds: servers.map((server) => server.serverId),
19
+ enabledServerIds: enabled.map((server) => server.serverId),
20
+ enabledMcpPlusServerIds: mcpPlus.map((server) => server.serverId),
21
+ enabledNativeServerIds: native.map((server) => server.serverId),
22
+ recommendedMode: "mcp-plus",
23
+ nativeCompatible: true,
24
+ publicSafe: true,
25
+ profileIdentity: "serverId+project",
26
+ runtimeOverlayIdentity: "serverId+session",
27
+ schemaRefreshBoundary: "session-checkpoint",
28
+ projectId: config?.projectId,
29
+ reprofileConsecutiveIndexedCalls: config?.reprofileConsecutiveIndexedCalls,
30
+ };
31
+ }
32
+ export function createRaxodeMcpReadinessSummaryFromRuntimeOptions(input) {
33
+ const servers = input.mcpServers ?? [];
34
+ const mcpPlus = servers.filter((server) => server.mode === "mcp-plus");
35
+ const native = servers.filter((server) => server.mode === "native");
36
+ return {
37
+ kind: "raxode.mcpReadinessSummary",
38
+ schemaVersion: "raxode.mcpReadinessSummary.v1",
39
+ configuredServerCount: servers.length,
40
+ enabledServerCount: servers.length,
41
+ disabledServerCount: 0,
42
+ enabledMcpPlusServerCount: mcpPlus.length,
43
+ enabledNativeServerCount: native.length,
44
+ configuredServerIds: servers.map((server) => server.serverId),
45
+ enabledServerIds: servers.map((server) => server.serverId),
46
+ enabledMcpPlusServerIds: mcpPlus.map((server) => server.serverId),
47
+ enabledNativeServerIds: native.map((server) => server.serverId),
48
+ recommendedMode: "mcp-plus",
49
+ nativeCompatible: true,
50
+ publicSafe: true,
51
+ profileIdentity: "serverId+project",
52
+ runtimeOverlayIdentity: "serverId+session",
53
+ schemaRefreshBoundary: "session-checkpoint",
54
+ projectId: input.mcpPlus?.projectId,
55
+ reprofileConsecutiveIndexedCalls: input.mcpPlus?.reprofileConsecutiveIndexedCalls,
56
+ };
57
+ }
@@ -2,9 +2,10 @@ import type { AgentManifest, DependencyDeclaration } from "@praxis-ai/praxis";
2
2
  import type { PraxisApplicationEvent, PraxisApplicationViewModel } from "@praxis-ai/praxis/application-layer";
3
3
  import type { RaxodeOptions } from "../agents/codingAgent/config/raxodeOptions.js";
4
4
  import { type RaxodeBackendModuleInventory } from "./backendModuleInventory.js";
5
+ import { type RaxodeMcpReadinessSummary } from "./mcpReadinessSummary.js";
5
6
  import { type RaxodeDependencyProbe, type RaxodeLocalReadinessProbe, type RaxodeLocalReadinessProbeInput } from "./localReadinessProbe.js";
6
7
  export type RaxodeReadinessStatus = "ready" | "passive-ready" | "contract-ready" | "degraded" | "missing";
7
- export type RaxodeReadinessOwner = "basetool" | "promptPack" | "applicationLayer" | "runtime" | "authPlane" | "dependencyPlane" | "sandboxPlane" | "cachePlane" | "multiagentPlane";
8
+ export type RaxodeReadinessOwner = "basetool" | "promptPack" | "applicationLayer" | "runtime" | "authPlane" | "dependencyPlane" | "sandboxPlane" | "cachePlane" | "multiagentPlane" | "mcpPlane";
8
9
  export type RaxodeReadinessPhase = "implemented" | "passive" | "declared" | "adapter-ready" | "missing";
9
10
  export type RaxodeReadinessSeverity = "ok" | "info" | "warning" | "blocking";
10
11
  export type RaxodeReadinessArea = {
@@ -40,6 +41,7 @@ export type RaxodeBackendReadiness = {
40
41
  expectedCoreToolIds: readonly string[];
41
42
  mountedToolIds: readonly string[];
42
43
  };
44
+ mcp: RaxodeMcpReadinessSummary;
43
45
  dependencies: readonly {
44
46
  dependencyId: string;
45
47
  kind: DependencyDeclaration["kind"];
@@ -82,6 +84,7 @@ export declare function inspectRaxodeBackendReadiness(input?: {
82
84
  now?: () => string;
83
85
  probe?: RaxodeLocalReadinessProbe;
84
86
  ports?: Partial<RaxodeBackendReadiness["ports"]>;
87
+ mcp?: RaxodeMcpReadinessSummary;
85
88
  }): RaxodeBackendReadiness;
86
89
  export declare function inspectRaxodeBackendReadinessWithLocalProbe(input?: {
87
90
  manifest?: AgentManifest;
@@ -90,6 +93,7 @@ export declare function inspectRaxodeBackendReadinessWithLocalProbe(input?: {
90
93
  now?: () => string;
91
94
  localProbe?: Omit<RaxodeLocalReadinessProbeInput, "manifest">;
92
95
  ports?: Partial<RaxodeBackendReadiness["ports"]>;
96
+ mcp?: RaxodeMcpReadinessSummary;
93
97
  }): RaxodeBackendReadiness;
94
98
  export declare function createRaxodeReadinessEvent(input: {
95
99
  readiness: RaxodeBackendReadiness;
@@ -10,6 +10,7 @@ import { mpBridge } from "../memory/memoryBridge.js";
10
10
  import { providerProfiles } from "../authentication/providerProfiles.js";
11
11
  import { inspectRaxodeMultiagentTopology, topology } from "../topology/multiagentTopology.js";
12
12
  import { createRaxodeBackendModuleInventory, } from "./backendModuleInventory.js";
13
+ import { createRaxodeMcpReadinessSummary, } from "./mcpReadinessSummary.js";
13
14
  import { probeLocalRaxodeReadiness, } from "./localReadinessProbe.js";
14
15
  const EXPECTED_AGENT_CORE_TOOL_IDS = [
15
16
  "shell.run",
@@ -32,6 +33,8 @@ const EXPECTED_AGENT_CORE_TOOL_IDS = [
32
33
  "agent.kill",
33
34
  "mcp.use",
34
35
  "mcp.resources",
36
+ "mcp.prompts",
37
+ "mcp.completions",
35
38
  "process.wait",
36
39
  "process.kill",
37
40
  "media.viewImage",
@@ -117,6 +120,7 @@ export function inspectRaxodeBackendReadiness(input = {}) {
117
120
  const providerRoute = typeof manifest.model.metadata?.providerRoute === "string"
118
121
  ? manifest.model.metadata.providerRoute
119
122
  : undefined;
123
+ const mcpSummary = input.mcp ?? createRaxodeMcpReadinessSummary();
120
124
  const modelRouteReady = providerProfiles.primary.authSource === "codex-openai-profile"
121
125
  && (providerRoute !== undefined || manifest.model.endpointShape !== undefined);
122
126
  const areas = [
@@ -177,6 +181,40 @@ export function inspectRaxodeBackendReadiness(input = {}) {
177
181
  surfaces: cmpBridge.surfaces,
178
182
  },
179
183
  },
184
+ {
185
+ area: "mcp",
186
+ status: "ready",
187
+ owner: "mcpPlane",
188
+ phase: "implemented",
189
+ severity: "ok",
190
+ summary: "MCP is mounted as a first-class runtime plane with bare MCP compatibility and MCP+ as the recommended exposure layer.",
191
+ evidence: [
192
+ `configured=${mcpSummary.configuredServerCount}`,
193
+ `enabled=${mcpSummary.enabledServerCount}`,
194
+ `mcpPlus=${mcpSummary.enabledMcpPlusServerCount}`,
195
+ `native=${mcpSummary.enabledNativeServerCount}`,
196
+ `schemaRefreshBoundary=${mcpSummary.schemaRefreshBoundary}`,
197
+ `profileIdentity=${mcpSummary.profileIdentity}`,
198
+ ],
199
+ facts: {
200
+ configuredServerCount: mcpSummary.configuredServerCount,
201
+ enabledServerCount: mcpSummary.enabledServerCount,
202
+ disabledServerCount: mcpSummary.disabledServerCount,
203
+ enabledMcpPlusServerCount: mcpSummary.enabledMcpPlusServerCount,
204
+ enabledNativeServerCount: mcpSummary.enabledNativeServerCount,
205
+ configuredServerIds: mcpSummary.configuredServerIds,
206
+ enabledServerIds: mcpSummary.enabledServerIds,
207
+ enabledMcpPlusServerIds: mcpSummary.enabledMcpPlusServerIds,
208
+ enabledNativeServerIds: mcpSummary.enabledNativeServerIds,
209
+ recommendedMode: mcpSummary.recommendedMode,
210
+ nativeCompatible: mcpSummary.nativeCompatible,
211
+ profileIdentity: mcpSummary.profileIdentity,
212
+ runtimeOverlayIdentity: mcpSummary.runtimeOverlayIdentity,
213
+ schemaRefreshBoundary: mcpSummary.schemaRefreshBoundary,
214
+ projectId: mcpSummary.projectId ?? "",
215
+ reprofileConsecutiveIndexedCalls: mcpSummary.reprofileConsecutiveIndexedCalls ?? 0,
216
+ },
217
+ },
180
218
  {
181
219
  area: "memory",
182
220
  status: mpBridge.status,
@@ -377,6 +415,7 @@ export function inspectRaxodeBackendReadiness(input = {}) {
377
415
  expectedCoreToolIds: EXPECTED_AGENT_CORE_TOOL_IDS,
378
416
  mountedToolIds: manifest.harness.tools.map((tool) => tool.toolId),
379
417
  },
418
+ mcp: mcpSummary,
380
419
  dependencies: manifest.dependencies.map((dependency) => dependencySummary(dependency, dependencyProbes.get(dependency.dependencyId))),
381
420
  policy: {
382
421
  permissionProfile: view?.permissionProfile ?? manifest.toolPolicy.profile,
@@ -424,6 +463,7 @@ export function inspectRaxodeBackendReadinessWithLocalProbe(input = {}) {
424
463
  now: input.now,
425
464
  probe,
426
465
  ports: input.ports,
466
+ mcp: input.mcp,
427
467
  });
428
468
  }
429
469
  export function createRaxodeReadinessEvent(input) {
@@ -8,6 +8,7 @@ import { createApplicationProjectRuntime, createLocalApplicationTransport, } fro
8
8
  import { createRaxodeLiveProvider, resolveRaxodeConfiguredModelOptions, } from "../authentication/liveProvider.js";
9
9
  import { inspectRaxodeMemoryBridge } from "../memory/memoryBridge.js";
10
10
  import { raxodeApplication } from "./raxodeApplication.js";
11
+ import { loadRaxodeMcpReadinessSummary, loadRaxodeMcpRuntimeOptions, } from "./mcpConfig.js";
11
12
  import { resolveRaxodeRaxcellSandboxProvider } from "./raxcellSandboxProvider.js";
12
13
  import { createRaxodeReadinessEvent, inspectRaxodeBackendReadinessWithLocalProbe, } from "./runtimeReadiness.js";
13
14
  function defaultProjectRoot() {
@@ -78,6 +79,8 @@ export async function startRaxodeStdioApplicationServer(options = {}) {
78
79
  sandboxProfile: options.sandboxProfile,
79
80
  sandboxProvider: options.sandboxProvider,
80
81
  });
82
+ const configuredMcp = loadRaxodeMcpRuntimeOptions(startDir);
83
+ const mcpReadiness = loadRaxodeMcpReadinessSummary(startDir);
81
84
  const created = await createApplicationProjectRuntime(projectRoot, {
82
85
  applicationId: raxodeApplication.id,
83
86
  cwd: startDir,
@@ -94,6 +97,8 @@ export async function startRaxodeStdioApplicationServer(options = {}) {
94
97
  agentOptions,
95
98
  sandboxProvider,
96
99
  now: options.now,
100
+ mcpServers: configuredMcp.mcpServers,
101
+ mcpPlus: configuredMcp.mcpPlus,
97
102
  liveProviderResolver: async (manifest, context) => createRaxodeLiveProvider(manifest, {
98
103
  startDir,
99
104
  sessionId: context?.sessionId,
@@ -134,6 +139,7 @@ export async function startRaxodeStdioApplicationServer(options = {}) {
134
139
  options: agentOptions,
135
140
  now: options.now,
136
141
  localProbe: options.localReadinessProbe,
142
+ mcp: mcpReadiness,
137
143
  ports: {
138
144
  sandboxProvider: sandboxProvider ? "configured" : "not-configured",
139
145
  liveProviderResolver: "configured",
@@ -19,6 +19,10 @@ type DirectApplicationBackendOptions = RaxodeOptions & {
19
19
  preCompactGovernanceEnabled?: CreateApplicationProjectRuntimeOptions["preCompactGovernanceEnabled"];
20
20
  compactContextWindowTokens?: CreateApplicationProjectRuntimeOptions["compactContextWindowTokens"];
21
21
  compactThresholdRatio?: CreateApplicationProjectRuntimeOptions["compactThresholdRatio"];
22
+ mcpServers?: CreateApplicationProjectRuntimeOptions["mcpServers"];
23
+ mcpPlusServers?: CreateApplicationProjectRuntimeOptions["mcpPlusServers"];
24
+ mcpModule?: CreateApplicationProjectRuntimeOptions["mcpModule"];
25
+ mcpPlus?: CreateApplicationProjectRuntimeOptions["mcpPlus"];
22
26
  sandboxProvider?: SandboxExecutionProviderPort;
23
27
  localReadinessProbe?: Omit<RaxodeLocalReadinessProbeInput, "manifest">;
24
28
  };
@@ -6,6 +6,8 @@ import { mkdir, appendFile } from "node:fs/promises";
6
6
  import path from "node:path";
7
7
  import { pathToFileURL } from "node:url";
8
8
  import { inspectRaxodeMemoryBridge } from "./memory/memoryBridge.js";
9
+ import { loadRaxodeMcpRuntimeOptions, mergeRaxodeMcpPlusRuntimeOptions, } from "./application/mcpConfig.js";
10
+ import { createRaxodeMcpReadinessSummaryFromRuntimeOptions } from "./application/mcpReadinessSummary.js";
9
11
  import { resolveRaxodeRaxcellSandboxProvider } from "./application/raxcellSandboxProvider.js";
10
12
  import { loadDirectTuiSessionSnapshot, listDirectTuiAgents, saveDirectTuiAgent, saveDirectTuiSessionSnapshot, } from "../frontend/tui/input/direct-session-store.js";
11
13
  function defaultProjectRoot() {
@@ -897,6 +899,13 @@ export async function startDirectApplicationBackend(options = {}) {
897
899
  const reasoningEffort = options.reasoningEffort ?? modelOptions.reasoningEffort;
898
900
  const maxOutputTokens = options.maxOutputTokens ?? modelOptions.maxOutputTokens;
899
901
  const compactOptions = resolveDirectCompactOptions(options);
902
+ const configuredMcp = loadRaxodeMcpRuntimeOptions(cwd);
903
+ const mcpServers = options.mcpServers ?? configuredMcp.mcpServers;
904
+ const mcpPlus = mergeRaxodeMcpPlusRuntimeOptions(configuredMcp.mcpPlus, options.mcpPlus);
905
+ const mcpReadiness = createRaxodeMcpReadinessSummaryFromRuntimeOptions({
906
+ mcpServers,
907
+ mcpPlus,
908
+ });
900
909
  const projectRoot = path.resolve(options.projectRoot ?? defaultProjectRoot());
901
910
  const memoryBridge = await inspectRaxodeMemoryBridge({
902
911
  projectRoot,
@@ -944,6 +953,10 @@ export async function startDirectApplicationBackend(options = {}) {
944
953
  preCompactGovernanceEnabled: options.preCompactGovernanceEnabled,
945
954
  compactContextWindowTokens: compactOptions.compactContextWindowTokens,
946
955
  compactThresholdRatio: compactOptions.compactThresholdRatio,
956
+ mcpServers,
957
+ mcpPlusServers: options.mcpPlusServers,
958
+ mcpModule: options.mcpModule,
959
+ mcpPlus,
947
960
  liveProviderResolver: options.liveProviderResolver ?? (async (manifest, context) => liveProviderModule.createRaxodeLiveProvider(manifest, {
948
961
  startDir: cwd,
949
962
  sessionId: context?.sessionId,
@@ -1060,6 +1073,7 @@ export async function startDirectApplicationBackend(options = {}) {
1060
1073
  options: agentOptions,
1061
1074
  now: options.now,
1062
1075
  localProbe: options.localReadinessProbe,
1076
+ mcp: mcpReadiness,
1063
1077
  ports: {
1064
1078
  approvalResolver: "configured",
1065
1079
  sandboxProvider: sandboxProvider ? "configured" : "not-configured",
@@ -13,7 +13,7 @@ export type RaxodeBackendCommand = {
13
13
  toolProfile?: PraxisApplicationToolProfile;
14
14
  };
15
15
  export type RaxodeBackendResult = PraxisApplicationCommandResult;
16
- type RaxodeBackendRuntimePorts = Pick<CreateApplicationProjectRuntimeOptions, "approvalResolver" | "agentReviewResolver" | "contextArtifactAdapters" | "baseToolAdapters" | "authStateProvider" | "sandboxProvider" | "foundationProject" | "openFoundationProject" | "liveProviderResolver" | "compactExecutor" | "preCompactGovernanceExecutor" | "preCompactGovernanceEnabled" | "compactContextWindowTokens" | "compactThresholdRatio">;
16
+ type RaxodeBackendRuntimePorts = Pick<CreateApplicationProjectRuntimeOptions, "approvalResolver" | "agentReviewResolver" | "contextArtifactAdapters" | "baseToolAdapters" | "authStateProvider" | "sandboxProvider" | "foundationProject" | "openFoundationProject" | "liveProviderResolver" | "compactExecutor" | "preCompactGovernanceExecutor" | "preCompactGovernanceEnabled" | "compactContextWindowTokens" | "compactThresholdRatio" | "mcpServers" | "mcpPlusServers" | "mcpModule" | "mcpPlus">;
17
17
  export type RaxodeBackendOptions = RaxodeOptions & RaxodeBackendRuntimePorts & {
18
18
  projectRoot?: string;
19
19
  cwd?: string;
@@ -10,6 +10,8 @@ import { resolveRaxodeRaxcellSandboxProvider } from "./application/raxcellSandbo
10
10
  import { createRaxodeAuthStateProvider } from "./authentication/authStateProvider.js";
11
11
  import { createRaxodeContextAdapter } from "./context/contextBridge.js";
12
12
  import { inspectRaxodeMemoryBridge } from "./memory/memoryBridge.js";
13
+ import { loadRaxodeMcpRuntimeOptions, mergeRaxodeMcpPlusRuntimeOptions, } from "./application/mcpConfig.js";
14
+ import { createRaxodeMcpReadinessSummaryFromRuntimeOptions } from "./application/mcpReadinessSummary.js";
13
15
  import { inspectRaxodeBackendReadinessWithLocalProbe, } from "./application/runtimeReadiness.js";
14
16
  function configuredRuntimePorts(options) {
15
17
  return {
@@ -43,6 +45,13 @@ async function createRaxodeRuntime(options = {}) {
43
45
  const reasoningEffort = options.reasoningEffort ?? modelOptions.reasoningEffort;
44
46
  const maxOutputTokens = options.maxOutputTokens ?? modelOptions.maxOutputTokens;
45
47
  const permissionProfile = options.policyProfile ?? "permissive";
48
+ const configuredMcp = loadRaxodeMcpRuntimeOptions(startDir);
49
+ const mcpServers = options.mcpServers ?? configuredMcp.mcpServers;
50
+ const mcpPlus = mergeRaxodeMcpPlusRuntimeOptions(configuredMcp.mcpPlus, options.mcpPlus);
51
+ const mcpReadiness = createRaxodeMcpReadinessSummaryFromRuntimeOptions({
52
+ mcpServers,
53
+ mcpPlus,
54
+ });
46
55
  const agentOptions = {
47
56
  policyProfile: permissionProfile,
48
57
  sandboxProfile: options.sandboxProfile,
@@ -104,6 +113,10 @@ async function createRaxodeRuntime(options = {}) {
104
113
  preCompactGovernanceEnabled: options.preCompactGovernanceEnabled,
105
114
  compactContextWindowTokens: options.compactContextWindowTokens,
106
115
  compactThresholdRatio: options.compactThresholdRatio,
116
+ mcpServers,
117
+ mcpPlusServers: options.mcpPlusServers,
118
+ mcpModule: options.mcpModule,
119
+ mcpPlus,
107
120
  liveProviderResolver: options.liveProviderResolver ?? (async (manifest, context) => createRaxodeLiveProvider(manifest, {
108
121
  startDir,
109
122
  sessionId: context?.sessionId,
@@ -127,10 +140,11 @@ async function createRaxodeRuntime(options = {}) {
127
140
  authStateProvider,
128
141
  openFoundationProject,
129
142
  }),
143
+ mcpReadiness,
130
144
  };
131
145
  }
132
146
  export async function createRaxodeBackend(options = {}) {
133
- const { projectRoot, runtime, readinessOptions, readinessPorts } = await createRaxodeRuntime(options);
147
+ const { projectRoot, runtime, readinessOptions, readinessPorts, mcpReadiness } = await createRaxodeRuntime(options);
134
148
  const transport = createLocalApplicationTransport(runtime);
135
149
  return {
136
150
  backendId: "applicationLayer",
@@ -145,6 +159,7 @@ export async function createRaxodeBackend(options = {}) {
145
159
  now: options.now,
146
160
  localProbe: options.localReadinessProbe,
147
161
  ports: readinessPorts,
162
+ mcp: mcpReadiness,
148
163
  });
149
164
  },
150
165
  async dispatch(command) {
@@ -1,4 +1,5 @@
1
1
  export type { PraxisApplicationAttachment as RaxodeApplicationAttachment, PraxisApplicationCommand as RaxodeApplicationCommand, PraxisApplicationCommandResult as RaxodeApplicationBackendResult, PraxisApplicationEvent as RaxodeApplicationEvent, PraxisApplicationInputEnvelope as RaxodeApplicationInputEnvelope, PraxisApplicationPermissionProfile as RaxodeApplicationPermissionProfile, PraxisApplicationReasoningEffort as RaxodeApplicationReasoningEffort, PraxisApplicationRuntimeMode as RaxodeApplicationRunMode, PraxisApplicationStatus as RaxodeApplicationStatus, PraxisApplicationViewModel as RaxodeApplicationViewModel, } from "@praxis-ai/praxis/application-layer";
2
2
  export type { RaxodeBackendReadiness, RaxodeReadinessArea, RaxodeReadinessOwner, RaxodeReadinessPhase, RaxodeReadinessSeverity, RaxodeReadinessStatus, } from "./backend/application/runtimeReadiness.js";
3
+ export type { RaxodeMcpReadinessSummary, } from "./backend/application/mcpReadinessSummary.js";
3
4
  export type { RaxodeBackendModuleId, RaxodeBackendModuleInventory, RaxodeBackendModuleInventoryItem, RaxodeBackendModuleStatus, } from "./backend/application/backendModuleInventory.js";
4
5
  export type { RaxodeDependencyProbe, RaxodeDependencyProbeStatus, RaxodeLocalReadinessProbe, RaxodeSandboxProbe, RaxodeSandboxProbeStatus, } from "./backend/application/localReadinessProbe.js";
@@ -63,6 +63,29 @@ function isReadinessTools(value) {
63
63
  isStringArray(record.expectedCoreToolIds) &&
64
64
  isStringArray(record.mountedToolIds);
65
65
  }
66
+ function isReadinessMcp(value) {
67
+ const record = recordValue(value);
68
+ return record !== undefined &&
69
+ record.kind === "raxode.mcpReadinessSummary" &&
70
+ record.schemaVersion === "raxode.mcpReadinessSummary.v1" &&
71
+ typeof record.configuredServerCount === "number" &&
72
+ typeof record.enabledServerCount === "number" &&
73
+ typeof record.disabledServerCount === "number" &&
74
+ typeof record.enabledMcpPlusServerCount === "number" &&
75
+ typeof record.enabledNativeServerCount === "number" &&
76
+ isStringArray(record.configuredServerIds) &&
77
+ isStringArray(record.enabledServerIds) &&
78
+ isStringArray(record.enabledMcpPlusServerIds) &&
79
+ isStringArray(record.enabledNativeServerIds) &&
80
+ record.recommendedMode === "mcp-plus" &&
81
+ record.nativeCompatible === true &&
82
+ record.publicSafe === true &&
83
+ record.profileIdentity === "serverId+project" &&
84
+ record.runtimeOverlayIdentity === "serverId+session" &&
85
+ record.schemaRefreshBoundary === "session-checkpoint" &&
86
+ (record.projectId === undefined || typeof record.projectId === "string") &&
87
+ (record.reprofileConsecutiveIndexedCalls === undefined || typeof record.reprofileConsecutiveIndexedCalls === "number");
88
+ }
66
89
  function isReadinessDependency(value) {
67
90
  const record = recordValue(value);
68
91
  const probe = recordValue(record?.probe);
@@ -158,6 +181,7 @@ export function isRaxodeBackendReadiness(value) {
158
181
  typeof record.storageKind === "string" &&
159
182
  isReadinessModel(record.model) &&
160
183
  isReadinessTools(record.tools) &&
184
+ isReadinessMcp(record.mcp) &&
161
185
  Array.isArray(record.dependencies) &&
162
186
  record.dependencies.every(isReadinessDependency) &&
163
187
  isReadinessPolicy(record.policy) &&
@@ -1028,6 +1028,36 @@ function isDirectTuiInitRunningStatus(status) {
1028
1028
  || status === "waiting"
1029
1029
  || status === "started";
1030
1030
  }
1031
+ function cloneRaxodeMcpServerConfig(server) {
1032
+ const common = {
1033
+ serverId: server.serverId,
1034
+ mode: server.mode,
1035
+ title: server.title,
1036
+ summary: server.summary,
1037
+ enabled: server.enabled,
1038
+ timeoutMs: server.timeoutMs,
1039
+ manifest: server.manifest ? { ...server.manifest } : undefined,
1040
+ metadata: server.metadata ? { ...server.metadata } : undefined,
1041
+ };
1042
+ if (server.transport === "stdio") {
1043
+ return {
1044
+ ...common,
1045
+ transport: "stdio",
1046
+ command: server.command,
1047
+ args: server.args ? [...server.args] : undefined,
1048
+ cwd: server.cwd,
1049
+ env: server.env ? { ...server.env } : undefined,
1050
+ framing: server.framing,
1051
+ };
1052
+ }
1053
+ return {
1054
+ ...common,
1055
+ transport: server.transport,
1056
+ url: server.url,
1057
+ sseUrl: server.sseUrl,
1058
+ headers: server.headers ? { ...server.headers } : undefined,
1059
+ };
1060
+ }
1031
1061
  function cloneRaxodeConfigFile(configFile) {
1032
1062
  return {
1033
1063
  schemaVersion: configFile.schemaVersion,
@@ -1045,6 +1075,11 @@ function cloneRaxodeConfigFile(configFile) {
1045
1075
  },
1046
1076
  workspace: { ...configFile.workspace },
1047
1077
  ui: { ...configFile.ui },
1078
+ mcp: {
1079
+ projectId: configFile.mcp.projectId,
1080
+ reprofileConsecutiveIndexedCalls: configFile.mcp.reprofileConsecutiveIndexedCalls,
1081
+ servers: configFile.mcp.servers.map(cloneRaxodeMcpServerConfig),
1082
+ },
1048
1083
  permissions: {
1049
1084
  ...configFile.permissions,
1050
1085
  requireHumanOnRiskLevels: [...configFile.permissions.requireHumanOnRiskLevels],
@@ -1,4 +1,5 @@
1
1
  import { type RaxodeResolvedRoleConfig } from "../config/raxode-config.js";
2
+ import type { RaxodeMcpReadinessSummary } from "../../../backend/application/mcpReadinessSummary.js";
2
3
  import type { RaxodeLocalReadinessProbeInput } from "../../../backend/application/localReadinessProbe.js";
3
4
  import type { RaxodeOptions } from "../../../backend/agents/codingAgent/config/raxodeOptions.js";
4
5
  export type RaxodeUiCommand = "tui";
@@ -13,6 +14,7 @@ export declare function buildBackendReadinessStatusLines(input?: {
13
14
  backendOptions?: RaxodeOptions;
14
15
  now?: () => string;
15
16
  localProbe?: Omit<RaxodeLocalReadinessProbeInput, "manifest">;
17
+ mcp?: RaxodeMcpReadinessSummary;
16
18
  }): string[];
17
19
  export declare function resolveRaxodeCliCommand(argv: string[]): {
18
20
  command: RaxodeUiCommand | "login" | "logout" | "status" | "help" | "resume";
@@ -9,6 +9,7 @@ import { listDirectTuiSessions, resolveDirectTuiSessionSelection, } from "../inp
9
9
  import { loadWorkspaceRaxodeAgent } from "../input/workspace-raxode-store.js";
10
10
  import { formatBackendModuleGapsLine, formatBackendModuleStatusLine, } from "../input/backend-readiness-status.js";
11
11
  import { summarizeRaxodeReadiness } from "../../bridge/readiness.js";
12
+ import { loadRaxodeMcpReadinessSummary } from "../../../backend/application/mcpConfig.js";
12
13
  import { inspectRaxodeBackendReadinessWithLocalProbe } from "../../../backend/application/runtimeReadiness.js";
13
14
  const PRIMARY_CLI_COMMAND = "raxode";
14
15
  const CLI_DISPLAY_NAME = "Raxode";
@@ -44,6 +45,7 @@ export function buildBackendReadinessStatusLines(input = {}) {
44
45
  options: input.backendOptions,
45
46
  now: input.now,
46
47
  localProbe: input.localProbe,
48
+ mcp: input.mcp,
47
49
  ports: {
48
50
  contextArtifactAdapters: "configured",
49
51
  authStateProvider: "configured",
@@ -77,11 +79,16 @@ export function buildBackendReadinessStatusLines(input = {}) {
77
79
  `fallback=${readiness.sandbox.probe.fallback}`,
78
80
  ].join(", ")
79
81
  : "none";
82
+ const mcpServersLine = readiness.mcp.enabledServerIds.length === 0
83
+ ? "none"
84
+ : readiness.mcp.enabledServerIds.join(", ");
80
85
  return [
81
86
  `Praxis backend readiness: ${digest.status}`,
82
87
  `Praxis backend modules: ${formatBackendModuleStatusLine(digest)}`,
83
88
  `Praxis backend module gaps: ${formatBackendModuleGapsLine(digest)}`,
84
89
  `Praxis backend runtime ports: ${runtimePortLine}`,
90
+ `Praxis backend MCP: configured=${readiness.mcp.configuredServerCount} enabled=${readiness.mcp.enabledServerCount} mcpPlus=${readiness.mcp.enabledMcpPlusServerCount} native=${readiness.mcp.enabledNativeServerCount} checkpoint=${readiness.mcp.schemaRefreshBoundary} profile=${readiness.mcp.profileIdentity}`,
91
+ `Praxis backend MCP servers: ${mcpServersLine}`,
85
92
  `Praxis backend model: provider=${readiness.model.provider ?? "unknown"}, model=${readiness.model.model}, route=${readiness.model.providerRoute ?? readiness.model.endpointShape ?? "auto"}`,
86
93
  `Praxis backend tools: ${readiness.toolProfile} mounted=${readiness.tools.mountedToolIds.length} expected=${readiness.tools.expectedCoreToolIds.length}`,
87
94
  `Praxis backend sandbox: ${readiness.sandbox.profile} execution=${readiness.sandbox.defaultExecution} fallback=${readiness.sandbox.fallback}`,
@@ -384,6 +391,7 @@ function printStatus() {
384
391
  backendOptions: primaryResolved === undefined
385
392
  ? undefined
386
393
  : raxodeBackendOptionsFromResolvedRole(primaryResolved),
394
+ mcp: loadRaxodeMcpReadinessSummary(),
387
395
  })) {
388
396
  process.stdout.write(`${line}\n`);
389
397
  }