-
Notifications
You must be signed in to change notification settings - Fork 1
Use hosted MCP by default and harden deploy runtime paths #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f7bbf7a
3536a1c
f60c747
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,4 @@ | ||
| #:schema https://developers.openai.com/codex/config-schema.json | ||
|
|
||
| [mcp_servers.fpf_memory] | ||
| command = "bun" | ||
| args = ["src/mastra/stdio.ts"] | ||
| cwd = "." | ||
| required = false | ||
| startup_timeout_sec = 15 | ||
| tool_timeout_sec = 60 | ||
| url = "https://fpf-memory-remote-20260414.server.mastra.cloud/api/mcp/fpf_memory/mcp" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,4 +11,5 @@ output.txt | |
| *.db-* | ||
| .mastra-project.json | ||
| package-lock.json | ||
| src/mastra/public | ||
| .DS_Store | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "mcpServers": { | ||
| "fpf_memory": { | ||
| "type": "http", | ||
| "url": "https://fpf-memory-remote-20260414.server.mastra.cloud/api/mcp/fpf_memory/mcp" | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,8 @@ description: "Design-Rationale Record for the Codex-facing interface decision in | |
|
|
||
| Status: accepted for the bounded context `CodexAccess:LocalFPFSpecRuntime` | ||
|
|
||
| Update 2026-04-13: the default Codex registration path now uses the hosted public MCP URL. The local stdio transport remains available as an optional full-surface expert/dev path. | ||
|
|
||
| ## Problem frame | ||
|
|
||
| `fpf_memory` needs a Codex-facing interface for grounded access to the local `FPF-spec.md` runtime. The repo already exposes a local MCP server, a Bun CLI, and a hosted Hono/Mastra runtime path, but the interface promise was implicit rather than recorded as an explicit decision. | ||
|
|
@@ -28,9 +30,9 @@ The decision includes these commitments: | |
|
|
||
| 1. The primary Codex integration surface is the `fpf_memory` MCP server. | ||
| 2. The CLI remains an operator/debug surface, not the primary semantic boundary for agent use. | ||
| 3. Hosted HTTP remains a transport/hosting option, not the first interface to optimize for in this repo slice. | ||
| 4. The Codex registration path is documented and packaged around the stdio entry point: | ||
| `bun src/mastra/stdio.ts` | ||
| 3. The current default Codex transport is the hosted public MCP URL. | ||
| 4. The repo also keeps a local stdio entry point for optional full-surface expert/dev work: | ||
| `FPF_MCP_SURFACE=full bun src/mastra/stdio.ts` | ||
|
Comment on lines
+33
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Narrow the stated default contract to the public 3-tool surface. After making hosted/public the default here, the later rationale still says Codex can ask for exact docs, retrieval traces, and refresh. Those capabilities now require the optional full-surface path, so the DRR overstates what the default Codex registration actually exposes. 🤖 Prompt for AI Agents |
||
| 5. This decision is recorded as a DRR outside the normative FPF core, consistent with `E.9`. | ||
|
|
||
| ## Rationale | ||
|
|
@@ -44,7 +46,7 @@ This choice keeps the FPF layers separate. | |
| Why MCP, rather than the alternatives: | ||
|
|
||
| - **Against CLI-first:** the CLI is useful for operators and smoke tests, but it is not the native tool-selection boundary for Codex. | ||
| - **Against custom HTTP-first:** Codex already supports MCP natively, so a bespoke API would add interface work without solving the current local integration problem. | ||
| - **Against custom HTTP-first:** Codex already supports MCP natively, so a bespoke API would add interface work without improving the MCP boundary itself. | ||
| - **For MCP-first:** the repo already ships an MCP server, Codex natively supports MCP configuration, and the server contract matches the bounded need for grounded retrieval over local spec artifacts. | ||
|
|
||
| This also follows FPF boundary discipline: | ||
|
|
@@ -63,14 +65,14 @@ Positive consequences: | |
| - Codex setup, packaging metadata, and verification can all align around a single published interface decision. | ||
| - Future work can distinguish between: | ||
| - boundary choice: MCP-first | ||
| - transport choice: stdio now, HTTP optional later | ||
| - transport choice: hosted/public by default, stdio optional for local expert work | ||
| - surface-shape work: discovery, browse/search, tools/resources/prompts | ||
|
|
||
| Trade-offs and follow-up consequences: | ||
|
|
||
| - A tool-only MCP surface is still heavier than ideal for first-pass discovery, so later work should improve discovery without changing this decision. | ||
| - Documentation now has one more artifact to keep current; that is acceptable because the DRR is the durable rationale carrier. | ||
| - If the bounded context changes from local Codex use to a hosted multi-tenant product, a later DRR may designate HTTP as an additional first-class external boundary for that different scope. | ||
| - If the bounded context changes again, a later DRR can further refine hosted/public vs local expert transport choices without overturning the MCP-first boundary. | ||
|
|
||
| References: | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||
| { | ||||||
| "name": "fpf_memory", | ||||||
| "version": "1.0.0", | ||||||
| "description": "Local vectorless FPF-spec runtime with MCP tools for answers, structured queries, and status.", | ||||||
| "description": "Compiler-backed FPF-spec runtime with hosted public MCP tools plus an optional local full-surface expert runtime.", | ||||||
| "tools": { | ||||||
| "public": [ | ||||||
| "ask_fpf", | ||||||
|
|
@@ -19,7 +19,7 @@ | |||||
| }, | ||||||
| "transport": ["stdio", "http"], | ||||||
| "runtime": { | ||||||
| "bun": "bun src/mastra/stdio.ts" | ||||||
| "bun": "FPF_MCP_SURFACE=full bun src/mastra/stdio.ts" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don’t force expert surface in the manifest runtime command. Line 22 hard-enables full surface for every manifest-driven local start, which removes opt-in gating for expert tools. 🔧 Proposed fix- "bun": "FPF_MCP_SURFACE=full bun src/mastra/stdio.ts"
+ "bun": "bun src/mastra/stdio.ts"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| }, | ||||||
| "http": { | ||||||
| "path": "/api/mcp/fpf_memory/mcp" | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #!/bin/bash | ||
| # Stage the two files the deployed runtime actually reads: | ||
| # 1. FPF-spec.md — source hash for freshness check | ||
| # 2. snapshot.json — compiled index (the only artifact loadSnapshot() reads) | ||
| # | ||
| # The other 6 artifact files (index-map, pattern-graph, …) are | ||
| # write-only debugging output — never loaded back by the runtime. | ||
| # | ||
| # Usage: bash scripts/prepare-deploy.sh | ||
| # bun run deploy | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| ROOT="$(cd "$(dirname "$0")/.." && pwd)" | ||
| PUBLIC="$ROOT/src/mastra/public" | ||
| INDEX="$ROOT/.runtime/fpf-index" | ||
|
|
||
| # 1. Rebuild snapshot so staged artifact matches current source | ||
| echo "Refreshing index snapshot..." | ||
| bun "$ROOT/src/cli.ts" refresh | ||
|
|
||
| # 2. Stage only what the runtime reads | ||
| mkdir -p "$PUBLIC/.runtime/fpf-index" | ||
| cp "$ROOT/FPF-spec.md" "$PUBLIC/FPF-spec.md" | ||
| cp "$INDEX/snapshot.json" "$PUBLIC/.runtime/fpf-index/snapshot.json" | ||
|
Comment on lines
+24
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Useful? React with 👍 / 👎.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Valid observation — the staging |
||
|
|
||
| echo "Staged into src/mastra/public/:" | ||
| du -sh "$PUBLIC/FPF-spec.md" "$PUBLIC/.runtime/fpf-index/snapshot.json" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,14 @@ | ||
| { | ||
| "name": "fpf_memory", | ||
| "version": "1.0.0", | ||
| "description": "Local vectorless FPF-spec runtime for MCP clients.", | ||
| "description": "Optional local full-surface FPF MCP runtime for expert clients.", | ||
| "transport": "stdio", | ||
| "command": "bun", | ||
| "cwd": ".", | ||
| "args": ["src/mastra/stdio.ts"], | ||
| "env": { | ||
| "FPF_SPEC_SOURCE_PATH": "FPF-spec.md", | ||
| "FPF_RUNTIME_ARTIFACT_DIR": ".runtime/fpf-index" | ||
| "FPF_RUNTIME_ARTIFACT_DIR": ".runtime/fpf-index", | ||
| "FPF_MCP_SURFACE": "full" | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: venikman/fpf-memory
Length of output: 448
🏁 Script executed:
Repository: venikman/fpf-memory
Length of output: 6525
Add local MCP reconfiguration step for expert-tool Codex sessions.
The Codex Setup section (lines 131–140) configures the hosted public MCP. Lines 148–158 then instruct starting
FPF_MCP_SURFACE=full bun run mcpto access expert tools. However, if Codex is configured via.codex/config.tomlto use the hosted URL (as shown in lines 131–140), starting a local full-surface server does not expose expert tools—Codex will continue connecting to the hosted endpoint where only public tools (ask_fpf,query_fpf_spec,get_fpf_index_status) are available.The section must clarify that expert-tool sessions require either:
.codex/config.tomltohttp://localhost:1234(or the port where local MCP runs), orFPF_MCP_SURFACE=full bun src/mastra/stdio.ts) without MCP client reconfiguration.🤖 Prompt for AI Agents