sha256:eb43c7d0583d32098d5da79ae8070bcbaa8212ce516f61705eb76343c94dcaf3
Last pushed
about 1 month by mateuszsjs
Type
Sandbox Kit
Manifest digest
sha256:eb43c7d0583d32098d5da79ae8070bcbaa8212ce516f61705eb76343c94dcaf3
schemaVersion: "2"
kind: mixin
name: codex-code-intelligence
version: 0.1.3
displayName: Codex Code Intelligence
description: Adds Context7 documentation and codebase-memory graph tools to Codex sandboxes.
requires:
agent: codex
agentInstructions:
content: |
Use Context7 whenever current library, framework, SDK, API, or configuration
documentation would improve the answer. Resolve the library identifier first,
then query its documentation with a focused, version-aware question.
<!-- codebase-memory-mcp:start -->
# Codebase Knowledge Graph (codebase-memory-mcp)
This project uses codebase-memory-mcp to maintain a knowledge graph of the codebase.
ALWAYS prefer MCP graph tools over grep/glob/file-search for code discovery.
## Priority Order
1. `search_graph` — find functions, classes, routes, variables by pattern
2. `trace_path` — trace who calls a function or what it calls
3. `get_code_snippet` — read specific function/class source code
4. `query_graph` — run Cypher queries for complex patterns
5. `get_architecture` — high-level project summary
## When to fall back to grep/glob
- Searching for string literals, error messages, config values
- Searching non-code files (Dockerfiles, shell scripts, configs)
- When MCP tools return insufficient results
## Examples
- Find a handler: `search_graph(name_pattern=".*OrderHandler.*")`
- Who calls it: `trace_path(function_name="OrderHandler", direction="inbound")`
- Read source: `get_code_snippet(qualified_name="pkg/orders.OrderHandler")`
<!-- codebase-memory-mcp:end -->
If the project is not indexed or the graph is stale, use `index_repository`,
`index_status`, or `detect_changes` as appropriate before falling back to
filesystem discovery.
permissions:
network:
allow:
- mcp.context7.com
- github.com
- api.github.com
- release-assets.githubusercontent.com
- objects.githubusercontent.com
credentials:
- service: context7
description: Optional Context7 API key for higher rate limits and private repositories.
apiKey:
name: CONTEXT7_API_KEY
inject:
- domain: mcp.context7.com
header: Authorization
format: Bearer %s
environment:
variables:
CBM_CACHE_DIR: /home/agent/.cache/codebase-memory-mcp
setup:
install:
- command: |
set -eu
CBM_VERSION="0.9.0"
CHECKSUMS_SHA256="b7294616f22050124c8f2cf029cc9943e0b7d6e426fb9a0b95b1de9815c76e57"
DESTINATION="/usr/local/bin/codebase-memory-mcp"
if [ -x "$DESTINATION" ] &&
[ "$("$DESTINATION" --version 2>/dev/null)" = "codebase-memory-mcp ${CBM_VERSION}" ]; then
exit 0
fi
case "$(uname -m)" in
x86_64|amd64)
CBM_ARCH="amd64"
;;
aarch64|arm64)
CBM_ARCH="arm64"
;;
*)
echo "unsupported sandbox architecture: $(uname -m)" >&2
exit 1
;;
esac
ASSET="codebase-memory-mcp-linux-${CBM_ARCH}-portable.tar.gz"
RELEASE_URL="https://github.com/DeusData/codebase-memory-mcp/releases/download/v${CBM_VERSION}"
DOWNLOAD_DIR="$(mktemp -d)"
trap 'rm -rf "$DOWNLOAD_DIR"' EXIT
curl --proto '=https' --tlsv1.2 -fsSL --retry 3 \
"${RELEASE_URL}/checksums.txt" -o "${DOWNLOAD_DIR}/checksums.txt"
echo "${CHECKSUMS_SHA256} ${DOWNLOAD_DIR}/checksums.txt" | sha256sum -c -
EXPECTED_SHA256="$(
awk -v asset="$ASSET" '$2 == asset || $2 == "*" asset { print $1 }' \
"${DOWNLOAD_DIR}/checksums.txt"
)"
if [ "${#EXPECTED_SHA256}" -ne 64 ] ||
! printf '%s\n' "$EXPECTED_SHA256" | grep -Eq '^[0-9a-fA-F]{64}$'; then
echo "release checksum is missing or invalid for ${ASSET}" >&2
exit 1
fi
curl --proto '=https' --tlsv1.2 -fsSL --retry 3 \
"${RELEASE_URL}/${ASSET}" -o "${DOWNLOAD_DIR}/${ASSET}"
echo "${EXPECTED_SHA256} ${DOWNLOAD_DIR}/${ASSET}" | sha256sum -c -
mkdir "${DOWNLOAD_DIR}/extract"
tar -xzf "${DOWNLOAD_DIR}/${ASSET}" \
-C "${DOWNLOAD_DIR}/extract" codebase-memory-mcp
test -f "${DOWNLOAD_DIR}/extract/codebase-memory-mcp"
test ! -L "${DOWNLOAD_DIR}/extract/codebase-memory-mcp"
install -m 0755 "${DOWNLOAD_DIR}/extract/codebase-memory-mcp" "$DESTINATION"
test "$("$DESTINATION" --version)" = "codebase-memory-mcp ${CBM_VERSION}"
user: "0"
description: Install checksum-verified codebase-memory-mcp 0.9.0
- command: |
set -eu
CONFIG_FILE="/home/agent/.codex/config.toml"
touch "$CONFIG_FILE"
if ! grep -q '^\[mcp_servers\.context7\]' "$CONFIG_FILE"; then
cat >> "$CONFIG_FILE" <<'EOF'
[mcp_servers.context7]
type = "http"
url = "https://mcp.context7.com/mcp"
EOF
fi
if ! grep -q '^\[mcp_servers\.codebase-memory-mcp\]' "$CONFIG_FILE"; then
cat >> "$CONFIG_FILE" <<'EOF'
[mcp_servers.codebase-memory-mcp]
command = "/usr/local/bin/codebase-memory-mcp"
EOF
fi
codex mcp get context7 >/dev/null
codex mcp get codebase-memory-mcp >/dev/null
user: agent
description: Register Context7 and codebase-memory with Codex
- command: |
set -eu
export CBM_CACHE_DIR=/home/agent/.cache/codebase-memory-mcp
mkdir -p "$CBM_CACHE_DIR"
/usr/local/bin/codebase-memory-mcp config set auto_index true
user: agent
description: Enable automatic codebase-memory indexing