Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs-mcp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
FROM node:20-slim
FROM node:22-slim

RUN apt-get update && \
apt-get install -y --no-install-recommends python3 make g++ && \
npm install -g @arabold/docs-mcp-server@2.0.4 && \
npm install -g @arabold/docs-mcp-server@2.4.0 && \
apt-get purge -y python3 make g++ && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*

ENV PORT=8080
ENV DOCS_URL=https://docs.genlayer.com
ENV SDK_URL=https://sdk.genlayer.com/main/
ENV DOCS_MCP_SERVER_HEARTBEAT_MS=10000

EXPOSE 8080

Expand Down
48 changes: 41 additions & 7 deletions docs-mcp/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,53 @@
set -e

STORE_PATH="${STORE_PATH:-/data}"
MAX_PAGES="${MAX_PAGES:-1000}"
MAX_DEPTH="${MAX_DEPTH:-8}"

index_docs() {
echo "Indexing documentation..."
docs-mcp-server scrape genlayer-docs "$DOCS_URL" \
--store-path "$STORE_PATH" \
--scope hostname \
--scrape-mode fetch \
--max-pages "$MAX_PAGES" \
--max-depth "$MAX_DEPTH" \
--exclude-pattern '/full-documentation\.txt/' \
--exclude-pattern '/developers/intelligent-contracts/?$/' \
--exclude-pattern '/understand-genlayer-protocol/consensus/?$/' \
--exclude-pattern '/validators/?$/'
docs-mcp-server scrape genlayer-sdk "$SDK_URL" \
--store-path "$STORE_PATH" \
--scope hostname \
--scrape-mode fetch \
--max-pages "$MAX_PAGES" \
--max-depth "$MAX_DEPTH"
}

index_is_usable() {
docs-mcp-server --quiet find-version genlayer-docs --store-path "$STORE_PATH" >/dev/null 2>&1 &&
docs-mcp-server --quiet find-version genlayer-sdk --store-path "$STORE_PATH" >/dev/null 2>&1
}

# Initial index if database doesn't exist
if [ ! -f "$STORE_PATH/documents.db" ]; then
echo "First boot — indexing documentation..."
docs-mcp-server scrape genlayer-docs "$DOCS_URL" --store-path "$STORE_PATH" --scope hostname --scrape-mode fetch --exclude-pattern "/full-documentation\.txt/"
docs-mcp-server scrape genlayer-sdk "$SDK_URL" --store-path "$STORE_PATH" --scope hostname --scrape-mode fetch
echo "Initial indexing complete."
echo "No index found at $STORE_PATH/documents.db"
index_docs
elif ! index_is_usable; then
echo "Existing index at $STORE_PATH/documents.db is not usable; rebuilding..."
index_docs
else
echo "Existing index found at $STORE_PATH/documents.db"
echo "Usable index found at $STORE_PATH/documents.db"
fi

echo "Verifying index..."
if ! index_is_usable; then
echo "Index verification failed." >&2
exit 1
fi
echo "Index verification complete."

echo "Starting docs-mcp-server..."
exec docs-mcp-server server \
exec docs-mcp-server mcp \
--port "$PORT" \
--host 0.0.0.0 \
--store-path "$STORE_PATH" \
Expand Down
6 changes: 3 additions & 3 deletions public/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

- [Full Documentation](https://docs.genlayer.com/full-documentation.txt): Complete documentation in a single file
- [Developers Guide](https://docs.genlayer.com/developers): Build on GenLayer
- [Validators Guide](https://docs.genlayer.com/validators): Run a validator node
- [Validators Guide](https://docs.genlayer.com/validators/setup-guide): Run a validator node

## API References

Expand All @@ -19,6 +19,6 @@

## Key Concepts

- [Intelligent Contracts](https://docs.genlayer.com/developers/intelligent-contracts): Contracts that can access the web and use LLMs
- [Equivalence Principle](https://docs.genlayer.com/understand-genlayer-protocol/consensus): How validators reach consensus on nondeterministic outputs
- [Intelligent Contracts](https://docs.genlayer.com/developers/intelligent-contracts/introduction): Contracts that can access the web and use LLMs
- [Equivalence Principle](https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/optimistic-democracy/equivalence-principle): How validators reach consensus on nondeterministic outputs
- [Staking](https://docs.genlayer.com/developers/staking-guide): Validator and delegator staking guide
Loading