Oro Docs MCP architecture
internal prototype · canonical JSON + Dreamborn Forge HTML
internal generated
architecture · supabase_json

Oro Docs MCP architecture

architecture artifact · for Oro Docs MCP · status draft

Planning Surface

Use this to decide what happens next.

Status

draft

Risks
idseveritymitigationdescription
RISK-001mediumUse pragmatic heading/chunk extraction and preserve raw text fallback.RST parsing can become overcomplicated.
RISK-002highCentralize root resolution and add negative tests for traversal/absolute paths.Filesystem tool could accidentally expose host filesystem if path checks are weak.
RISK-003mediumCapture top-level section metadata and allow optional section filtering.Search may return noisy results across user/admin/developer docs.
components
idnameinputsoutputspurposefailure behavior
CMP-001Indexer- Oro documentation repo path- data/chunks.json - data/search-index.json - data/metadata.jsonWalk docs source and build chunk/index metadata.Fail with file path and parser error summary; do not partially overwrite known-good index unless build succeeds.
CMP-002RST Extractor- .rst file content- Document chunksExtract titles, headings, sections, directives, and code blocks from .rst files.Fall back to whole-file text chunk with warning.
CMP-003Search Service- query - optional limit - optional section - optional corpus - optional mode- ranked result listServe ranked query results over local chunks.Return structured MCP error if index is missing and recommend refresh command.
CMP-004Virtual Docs Filesystem- allowlisted command string- truncated stdoutRun safe read-only list/search/read commands against the docs root.Reject unsupported commands, path traversal, and write-like flags.
CMP-005MCP Server- MCP tool calls- MCP tool responsesExpose search_oro and query_docs_filesystem_oro tools to Codex/Atlas.Return concise structured errors without leaking host paths beyond configured docs root.
CMP-006Embedding Indexer- Document chunks - optional embedding provider config- data/embeddings.json or local vector storeGenerate and persist embeddings for docs/source chunks when credentials are configured.Record embedding failure and keep keyword search available.
CMP-007Application Source Indexer- Oro application source repo path - include/exclude rules- Source chunks with corpus labelsIndex selected OroCommerce application source files as a separate source corpus.Skip excluded/unreadable paths and report counts.
CMP-008Evaluation Harness- evaluation query set - MCP tool calls- quality and safety reportRun representative retrieval and safety tests before registration.Fail build or registration gate when required checks miss expected docs or safety tests fail.
CMP-009Hosted MCP Adapter- MCP tool calls over hosted transport- MCP tool responsesExpose hosted MCP endpoints under mcp.bezeliq.ai, including /oro, with stable routing, health, and discovery behavior.Return structured service errors and preserve local testability.
CMP-009ABrowser Catalog Site- MCP card registry - tool metadata - status metadata- HTML catalog page - capability detail pages - connection snippetsRender a human-readable MCP catalog for browser visitors at the root domain.If dynamic status checks fail, render static catalog metadata with status marked unknown.
CMP-010MCP Card Registry- cards/*.json- get_mcp_card tool response and static/discovery card metadataServe and validate MCP cards for the hosted server and Oro docs/source capability.Fail tests if required card fields are missing.
data model
files
idpathshapepurpose
DATA-001data/chunks.json- id: stable hash - url: best-effort public URL - kind: rst|markdown|code|config - path: docs-relative path - title: document title - content: chunk text - section: section heading - line end: optional integer - line start: optional integerNormalized searchable chunks with source metadata.
DATA-002data/search-index.jsonSerialized local search index.
DATA-003data/metadata.jsonIndex build metadata including source repo path, commit, file counts, and build timestamp.
DATA-004data/embeddings.jsonOptional semantic vectors keyed by chunk id.
DATA-005data/eval-results.jsonRetrieval quality and filesystem safety test output.
DATA-006cards/mcp.bezeliq.ai.jsonRegistry-level MCP card with transport, owner, auth, hosted routes, browser catalog metadata, and global safety policy.
DATA-007cards/oro-docs.jsonCapability-level MCP card with Oro tools, corpora, source repos, examples, and refresh policy.
routes
pathtypepurpose
/browser_catalogHuman-readable overview of BezelIQ MCPs, endpoint URLs, tools, auth, and examples.
/cardsjsonList available MCP cards.
/cards/orojsonReturn Oro MCP card.
/oromcp_or_browser_negotiatedServe Oro MCP transport for MCP clients; render Oro endpoint documentation for browser Accept headers if practical.
/healthjsonService health.
projects database entities
idnamepurposeminimum fields
PDB-001mcp_serversRegistry rows for hosted MCP servers/capabilities such as Oro.- id - slug - name - base_url - endpoint_path - status - card_ref - created_at - updated_at
PDB-002mcp_cardsVersioned MCP card metadata for browser catalog and agent discovery.- id - server_slug - card_version - content - status - published_at
PDB-003mcp_index_runsIndex/refresh metadata for docs and source corpora.- id - server_slug - corpus - source_commit - status - file_count - chunk_count - started_at - completed_at
risks
idseveritymitigationdescription
RISK-001mediumUse pragmatic heading/chunk extraction and preserve raw text fallback.RST parsing can become overcomplicated.
RISK-002highCentralize root resolution and add negative tests for traversal/absolute paths.Filesystem tool could accidentally expose host filesystem if path checks are weak.
RISK-003mediumCapture top-level section metadata and allow optional section filtering.Search may return noisy results across user/admin/developer docs.
open questions
idownerblocksstatusquestion
OQ-ARCH-001justinPost-M-01 repository hygiene, not initial local build.openShould the MCP package be committed as its own Git repo after creation?
Agent Handoff
Start Here

architecture artifact · for Oro Docs MCP · status draft

Completion Evidence

No explicit evidence field yet. Require tests, screenshots, linked PRs, or reviewed outputs before marking complete.

Components
  • Indexer: id: string, name: string, inputs: object, outputs: object, purpose: string, failure_behavior: string
  • RST Extractor: id: string, name: string, inputs: object, outputs: object, purpose: string, failure_behavior: string
  • Search Service: id: string, name: string, inputs: object, outputs: object, purpose: string, failure_behavior: string
  • Virtual Docs Filesystem: id: string, name: string, inputs: object, outputs: object, purpose: string, failure_behavior: string
  • MCP Server: id: string, name: string, inputs: object, outputs: object, purpose: string, failure_behavior: string
  • Embedding Indexer: id: string, name: string, inputs: object, outputs: object, purpose: string, failure_behavior: string
  • Application Source Indexer: id: string, name: string, inputs: object, outputs: object, purpose: string, failure_behavior: string
  • Evaluation Harness: id: string, name: string, inputs: object, outputs: object, purpose: string, failure_behavior: string
  • Hosted MCP Adapter: id: string, name: string, inputs: object, outputs: object, purpose: string, failure_behavior: string
  • Browser Catalog Site: id: string, name: string, inputs: object, outputs: object, purpose: string, failure_behavior: string
  • MCP Card Registry: id: string, name: string, inputs: object, outputs: object, purpose: string, failure_behavior: string
Risks
  • RISK-001: RST parsing can become overcomplicated.
  • RISK-002: Filesystem tool could accidentally expose host filesystem if path checks are weak.
  • RISK-003: Search may return noisy results across user/admin/developer docs.
Open Questions
  • OQ-ARCH-001: id: string, owner: string, blocks: string, status: string, question: string
Structured Payload

Machine-readable source fields

risks
idseveritymitigationdescription
RISK-001mediumUse pragmatic heading/chunk extraction and preserve raw text fallback.RST parsing can become overcomplicated.
RISK-002highCentralize root resolution and add negative tests for traversal/absolute paths.Filesystem tool could accidentally expose host filesystem if path checks are weak.
RISK-003mediumCapture top-level section metadata and allow optional section filtering.Search may return noisy results across user/admin/developer docs.
status

draft

handoff
blocking question ids

No items captured.

ready for coherence review

true

project
id

oro-docs-mcp

name

Oro Documentation MCP

client id

redkey

requirements ref

docs/projects/oro-docs-mcp/artifacts/REQUIREMENTS.json

tooling
commands
idnamecommandpurpose
CMD-001build-indexnpm run build:indexRebuild local Oro docs index.
CMD-002start-mcpnpm run startRun MCP server.
CMD-003testnpm testRun parser, search, and filesystem safety tests.
CMD-004deploynpm run deployDeploy hosted MCP to mcp.bezeliq.ai.
security
network

No network required for keyword search/read after repos are cloned. Embedding refresh may use provider network access when explicitly run.

secrets

No credentials required for keyword search or filesystem tools. Embedding generation may use OPENAI_API_KEY or another configured provider key.

filesystem policy
  • Resolve all paths under configured docs root.
  • Reject .., absolute paths outside root, drive-letter paths, glob writes, redirects, pipes that imply execution, and unsupported commands.
  • Allow only read/list/search/text-processing commands needed for docs inspection.
  • No write commands, package managers, network calls, process control, or script execution through the filesystem tool.
components
idnameinputsoutputspurposefailure behavior
CMP-001Indexer- Oro documentation repo path- data/chunks.json - data/search-index.json - data/metadata.jsonWalk docs source and build chunk/index metadata.Fail with file path and parser error summary; do not partially overwrite known-good index unless build succeeds.
CMP-002RST Extractor- .rst file content- Document chunksExtract titles, headings, sections, directives, and code blocks from .rst files.Fall back to whole-file text chunk with warning.
CMP-003Search Service- query - optional limit - optional section - optional corpus - optional mode- ranked result listServe ranked query results over local chunks.Return structured MCP error if index is missing and recommend refresh command.
CMP-004Virtual Docs Filesystem- allowlisted command string- truncated stdoutRun safe read-only list/search/read commands against the docs root.Reject unsupported commands, path traversal, and write-like flags.
CMP-005MCP Server- MCP tool calls- MCP tool responsesExpose search_oro and query_docs_filesystem_oro tools to Codex/Atlas.Return concise structured errors without leaking host paths beyond configured docs root.
CMP-006Embedding Indexer- Document chunks - optional embedding provider config- data/embeddings.json or local vector storeGenerate and persist embeddings for docs/source chunks when credentials are configured.Record embedding failure and keep keyword search available.
CMP-007Application Source Indexer- Oro application source repo path - include/exclude rules- Source chunks with corpus labelsIndex selected OroCommerce application source files as a separate source corpus.Skip excluded/unreadable paths and report counts.
CMP-008Evaluation Harness- evaluation query set - MCP tool calls- quality and safety reportRun representative retrieval and safety tests before registration.Fail build or registration gate when required checks miss expected docs or safety tests fail.
CMP-009Hosted MCP Adapter- MCP tool calls over hosted transport- MCP tool responsesExpose hosted MCP endpoints under mcp.bezeliq.ai, including /oro, with stable routing, health, and discovery behavior.Return structured service errors and preserve local testability.
CMP-009ABrowser Catalog Site- MCP card registry - tool metadata - status metadata- HTML catalog page - capability detail pages - connection snippetsRender a human-readable MCP catalog for browser visitors at the root domain.If dynamic status checks fail, render static catalog metadata with status marked unknown.
CMP-010MCP Card Registry- cards/*.json- get_mcp_card tool response and static/discovery card metadataServe and validate MCP cards for the hosted server and Oro docs/source capability.Fail tests if required card fields are missing.
data model
files
idpathshapepurpose
DATA-001data/chunks.json- id: stable hash - url: best-effort public URL - kind: rst|markdown|code|config - path: docs-relative path - title: document title - content: chunk text - section: section heading - line end: optional integer - line start: optional integerNormalized searchable chunks with source metadata.
DATA-002data/search-index.jsonSerialized local search index.
DATA-003data/metadata.jsonIndex build metadata including source repo path, commit, file counts, and build timestamp.
DATA-004data/embeddings.jsonOptional semantic vectors keyed by chunk id.
DATA-005data/eval-results.jsonRetrieval quality and filesystem safety test output.
DATA-006cards/mcp.bezeliq.ai.jsonRegistry-level MCP card with transport, owner, auth, hosted routes, browser catalog metadata, and global safety policy.
DATA-007cards/oro-docs.jsonCapability-level MCP card with Oro tools, corpora, source repos, examples, and refresh policy.
routes
pathtypepurpose
/browser_catalogHuman-readable overview of BezelIQ MCPs, endpoint URLs, tools, auth, and examples.
/cardsjsonList available MCP cards.
/cards/orojsonReturn Oro MCP card.
/oromcp_or_browser_negotiatedServe Oro MCP transport for MCP clients; render Oro endpoint documentation for browser Accept headers if practical.
/healthjsonService health.
projects database entities
idnamepurposeminimum fields
PDB-001mcp_serversRegistry rows for hosted MCP servers/capabilities such as Oro.- id - slug - name - base_url - endpoint_path - status - card_ref - created_at - updated_at
PDB-002mcp_cardsVersioned MCP card metadata for browser catalog and agent discovery.- id - server_slug - card_version - content - status - published_at
PDB-003mcp_index_runsIndex/refresh metadata for docs and source corpora.- id - server_slug - corpus - source_commit - status - file_count - chunk_count - started_at - completed_at
artifact type

ARCHITECTURE

open questions
idownerblocksstatusquestion
OQ-ARCH-001justinPost-M-01 repository hygiene, not initial local build.openShould the MCP package be committed as its own Git repo after creation?
schema version

1.0

architecture summary
stack
parser

Custom pragmatic RST section extractor with directive handling

search

Local keyword/BM25 search plus optional semantic/hybrid retrieval

hosting

mcp.bezeliq.ai, preferably Cloudflare Worker/Pages Function or a small Node service behind Cloudflare

runtime

Node.js/TypeScript MCP server

storage

Local JSON index files under the MCP package data directory

database

Projects database for MCP registry/card/status/refresh metadata

source docs

C:/Users/jstnk/Downloads/cc/projects/documentation

browser catalog

Static or server-rendered HTML/JSON registry at / plus capability detail pages such as /oro/docs or /oro when requested by browser

application source

C:/Users/jstnk/Downloads/cc/projects/orocommerce-application

approach

Build a hosted BezelIQ MCP capability registry at https://mcp.bezeliq.ai/ with a browser-readable catalog at the root and MCP endpoints under capability paths such as /oro. The Oro MCP indexes Oro documentation and selected Oro application source files. A separate indexer converts Sphinx/RST docs, code examples, and opt-in source files into local/generated keyword and optional semantic indexes. The MCP exposes search, constrained read-only inspection tools, and MCP card metadata, with local development support.

repo roots
  • C:/Users/jstnk/Downloads/cc/projects/oro-docs-mcp
major decisions
idreasondecisionalternatives rejected
ADR-001The MCP is reusable tooling and should not add vendored Oro docs/index noise to RedKey.Create the MCP as a sibling repo/package instead of inside RedKey.- Implement directly under RedKey scripts - Place Oro docs inside RedKey
ADR-002Exact Oro class, bundle, command, and config names need keyword search, while conceptual questions benefit from semantic search.Use hybrid retrieval as the complete target while preserving keyword-only fallback.- Embedding-only search - Live web search - Keyword-only final scope
ADR-003Agents need exact docs inspection but not host filesystem or write access.Implement a constrained read-only virtual filesystem tool rather than arbitrary shell execution.- Expose unrestricted shell - Only expose semantic search snippets
ADR-004Humans who open the root in a browser should understand available MCPs and agents should have stable endpoint/card URLs.Use mcp.bezeliq.ai as the BezelIQ MCP capability registry root, with /oro as the Oro endpoint.- Local-only MCP - Bundling MCP into RedKey agent runner
ADR-005Cards make the MCP discoverable and governable: tools, corpora, transport, safety, owner, refresh, and examples are explicit.Publish MCP cards as first-class capability metadata.- README-only documentation - Implicit tool discovery only
ADR-006Justin specified the database is the Projects database. Registry/card/status metadata belongs with project/capability management, while source corpora remain external checkouts.Use the Projects database for MCP registry state.- New MCP-only database - RedKey platform tables as the primary registry store - Storing full docs corpus in database rows