Skip to content

Cadence-lang redesign + AI tools (MCP, Skills, LLM endpoints, AI Chat)#285

Open
lmcmz wants to merge 125 commits intoonflow:mainfrom
Outblock:main
Open

Cadence-lang redesign + AI tools (MCP, Skills, LLM endpoints, AI Chat)#285
lmcmz wants to merge 125 commits intoonflow:mainfrom
Outblock:main

Conversation

@lmcmz
Copy link
Copy Markdown

@lmcmz lmcmz commented Feb 21, 2026

Summary

Complete redesign of cadence-lang.org with AI-native developer tooling.

Preview: https://cadence-lang.vercel.app/

Site Redesign

  • New homepage with ASCII 3D animation (Cadence logo, Flow token, CryptoKitty cycle)
  • Dark mode support with proper background colors
  • Responsive layout with mobile optimizations
  • Updated header nav with AI Tools link

MCP Server (mcp-server/)

  • Cadence MCP server wrapping the Flow CLI Language Server over JSON-RPC
  • 6 tools: search_docs, get_doc, cadence_check, cadence_hover, cadence_definition, cadence_symbols
  • HTTP transport via Hono + WebStandardStreamableHTTPServerTransport (stateless)
  • Deployed on Railway at https://cadence-mcp.up.railway.app
  • Dockerfile with Flow CLI for containerized deployment
  • Stdio transport for local CLI usage
  • 54 unit + integration tests covering LSP message parsing, formatters, and Cadence syntax/type error detection

AI Skills

  • SKILL.md — one-command install via npx skills add outblock/cadence-lang.org
  • Injects Cadence language reference, patterns, and best practices into AI coding agents

LLM Endpoints

  • /llms.txt — concise site overview for LLM context
  • /llms-full.txt — full documentation dump optimized for LLM context windows

AI Chat Panel

  • Embedded Cadence AI chat panel in docs pages
  • Drag-to-resize from left edge
  • Responsive (full width on mobile)

Fumadocs

  • Migrated documentation framework to Fumadocs
  • Structured navigation via meta.json files

AI Tools Documentation (content/docs/ai-tools/)

  • Skills — installation and usage guide
  • MCP Server — tools reference, Claude Desktop/Code config, HTTP usage, local setup
  • LLM Endpoints — llms.txt and llms-full.txt documentation
  • Integration guides for: Antigravity, Claude (Code/Desktop/API), Cursor, OpenAI Codex, Gemini, OpenCode

Test plan

  • MCP server: 54 tests passing (bun test in mcp-server/)
  • Homepage renders with 3D animation cycle
  • Dark mode background color applies correctly
  • AI Tools docs render in Fumadocs
  • MCP endpoint responds at https://cadence-mcp.up.railway.app/mcp

zenabot27 and others added 14 commits February 15, 2026 21:29
Complete rewrite of cadence-lang.org:
- Fumadocs UI with TanStack Start router and Vite bundler
- Tailwind CSS 4 with Geist font family (including Pixel display variants)
- Custom Cadence syntax highlighting via Shiki + TextMate grammar
- AI-native homepage: skills command, LogoLoop ticker, social proof section
- AI toolkit section: Agent Skills, MCP Server, llms.txt, per-page AI actions
- Theme toggle with View Transitions API sweep animation
- StickerPeel draggable stickers (gsap + Draggable, SSR-safe)
- SEO: JSON-LD structured data, sitemap, robots.txt
- Env var VITE_SKILLS_ORG for org-agnostic skills command
- All 82 docs migrated to content/docs/ with GFM admonitions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate from Docusaurus to Fumadocs + TanStack Start + Vite
- VITE_SKILLS_ORG env var controls homepage skills command org
- Try/catch around Shiki codeToHtml with plain-text fallback
- Add .vercel/output to .gitignore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate to Fumadocs + TanStack Start + Vite
- Set Nitro runtime to nodejs20.x (was defaulting to nodejs24.x)
- Add buildCommand, installCommand, framework:null to vercel.json
- Prevents Vercel from auto-detecting wrong framework

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix Vercel: nodejs20.x runtime + build config
- Remove cleanUrls/trailingSlash from vercel.json (may conflict with Nitro routing)
- Simplify vite.config.ts to bare nitro({ preset: 'vercel' })
- Remove .vercel/output from git tracking (already in .gitignore)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: simplify Vercel deployment config
The native binding (@takumi-rs/core-linux-x64-gnu) is not available in
Vercel's serverless environment. Move to dynamic import so the module
is only loaded when the OG image route is hit, with SVG fallback when
the native binding is unavailable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: dynamic import for OG image native binding
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 21, 2026

@zenabot27 is attempting to deploy a commit to the Flow Team on Vercel.

A member of the Team first needs to authorize it.

zenabot27 and others added 16 commits March 4, 2026 02:03
TanStack Router's Link resolves `to` relative to the route pattern, not
the actual page URL, breaking `./` and `../` relative links in MDX content.
Add a custom link component that pre-resolves relative hrefs to absolute
paths using standard URL resolution before passing to Fumadocs Link.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: resolve relative MDX links before passing to TanStack Router
- Dockerfile: multi-stage build, compiles LSP v2 from Outblock/cadence-tools rewrite/lsp-v2 branch
- client.ts: add lspBinary option to spawn v2 binary directly instead of flow CLI
- http.ts/index.ts: pass LSP_BINARY env var to LSPManager

Set LSP_BINARY=/usr/local/bin/lsp-v2 to use v2, unset to fall back to v1.
Flow CLI is still used for `flow dependencies install` (DepsWorkspace).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add LSP_BINARY env var to run integration tests against a standalone
LSP binary instead of Flow CLI. All 30 tests pass with v2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
chore: sync SKILL.md from docs changes
The debug endpoint leaked file paths, flow.json contents, and directory
listings without authentication. The /health endpoint is sufficient for
monitoring LSP status.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: integrate Cadence LSP v2 binary into MCP server
Add POST /api/security-scan that runs static analysis + LSP type check
directly, bypassing the MCP tool call. This eliminates the need for
Claude to re-output the entire contract code as tool arguments, which
was extremely slow for large contracts (100KB+).

Extract createApp() from http.ts for testability.

Co-authored-by: ZenaBot <qq_agent_hao@proton.me>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…ution (#13)

Co-authored-by: ZenaBot <qq_agent_hao@proton.me>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
The rewrite/lsp-v2 branch has been merged to master with WASM slimming
(47→22MB) and all Phase 1-3 LSP improvements.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@j1010001
Copy link
Copy Markdown
Member

@lmcmz The Language reference (https://cadence-lang.org/docs/language) menu structure and order should be preserved, the new site is all over the place.

@j1010001
Copy link
Copy Markdown
Member

@lmcmz There is whole bunch of broken links in the language reference, see:
link-check-report.md

Keep LLM endpoints accessible via settings only.

Co-authored-by: ZenaBot <qq_agent_hao@proton.me>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@joshuahannan joshuahannan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started reviewing SKILL.md, but didn't get very far because there is a lot of bad advice. I assume you used AI to generate it.

I already spent a lot of time reviewing and added a bunch of advice to https://github.com/onflow/cadence-rules. Can you please import those rules into the AI that you're using to generate SKILL.md and have it re-generate it? Also make sure it knows about the few comments I already left here because I'm sure those apply to many of the skills in the rest of the file.

I also agree with Bastian about breaking this into smaller PRs. This is way too difficult to review as one big PR

| Testing framework | https://cadence-lang.org/docs/testing-framework |
| Flow NFT Standard | https://github.com/onflow/flow-nft |
| Flow FT Standard | https://github.com/onflow/flow-ft |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should include other repos in here like core contracts, bridge, hybrid custody, NFT storefront, etc

| `access(all)` | Everyone (public read, callable by anyone) |
| `access(self)` | Only within the type itself |
| `access(contract)` | Same contract |
| `access(account)` | Same account |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `access(account)` | Same account |
| `access(account)` | Contracts within the same account |

| `access(self)` | Only within the type itself |
| `access(contract)` | Same contract |
| `access(account)` | Same account |
| `access(E)` | Callers holding entitlement `E` |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `access(E)` | Callers holding entitlement `E` |
| `access(E)` | Either callers holding the actual object or callers holding a reference to the object authorized with entitlement `E` |

// 4. Borrow from another account
let receiver = getAccount(address).capabilities
.borrow<&{FungibleToken.Receiver}>(/public/receiver)
?? panic("Account has no receiver capability")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update all the error messages in here to have more descriptive messages that include values? For example, this one should be, "Account \(address) has no FungibleToken.Receiver capability at path /public/receiver"

transaction(amount: UFix64, recipient: Address) {

// Declare fields shared across phases
let vaultRef: auth(FungibleToken.Withdraw) &FungibleToken.Vault
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an invalid type. It should be &{FungibleToken.Vault}. You'll need to update this type wherever else it is in these skills

// Access accounts — the ONLY phase with account access
prepare(signer: auth(BorrowValue) &Account) {
self.vaultRef = signer.storage
.borrow<auth(FungibleToken.Withdraw) &FungibleToken.Vault>(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still invalid

self.vaultRef = signer.storage
.borrow<auth(FungibleToken.Withdraw) &FungibleToken.Vault>(
from: /storage/vault
) ?? panic("No vault found")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need descriptive error message here and everywhere else in this file with error messages

…, SKILL.md, bun migration

- Fix 68 broken internal links across language reference, tutorials, ai-tools, and migration guide
- Restore Language Reference sidebar menu order to match production site
- SKILL.md: add repo links (core-contracts, bridge, hybrid-custody, nft-storefront),
  fix access(account)/access(E) descriptions, fix invalid &FungibleToken.Vault types,
  improve all panic messages with descriptive values
- Convert relative ./links in index.mdx files to absolute paths (Fumadocs resolves
  ./ from index pages incorrectly)
- Fix anchor slugs (#semicolons → #-semicolon, #accessing-objects → #borrowing-objects, etc.)
- Migrate from npm to bun (remove package-lock.json, add bun.lockb)
- Add scripts/check-links.mjs for link validation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lmcmz
Copy link
Copy Markdown
Author

lmcmz commented Mar 31, 2026

@j1010001 Both issues have been addressed in the latest push:

1. Language Reference menu order — Restored to match the production site order

2. Broken links — All 68 broken links from the link-check report have been fixed. The root cause was ./ relative links in index.mdx files

@joshuahannan All SKILL.md review comments resolved:

  • Added repo links (core-contracts, bridge, hybrid-custody, nft-storefront)
  • Fixed access(account) → "Contracts within the same account"
  • Fixed access(E) description
  • Fixed invalid &FungibleToken.Vault&{FungibleToken.Vault} (Cadence 1.0 interface syntax)
  • Updated all panic messages with descriptive values (addresses, paths, capability IDs)

@lmcmz
Copy link
Copy Markdown
Author

lmcmz commented Mar 31, 2026

Hey @joshuahannan @j1010001 — quick update on the review feedback:

What's been fixed (latest push):

  • All broken links resolved (68 total, verified with a link checker across 107 pages — 0 remaining)
  • Language Reference sidebar order restored to match production
  • SKILL.md updates per Josh's review: added repo links, fixed access modifier descriptions, fixed &{FungibleToken.Vault} types, improved panic messages

On splitting the PR:
This is a static docs site framework migration — TanStack Start + Fumadocs replacing the old engine. The core MDX documentation content is unchanged; the diff is routing/config/components and link syntax adaptation. Splitting it isn't practical since the framework, routes, and components are interdependent — each piece wouldn't build or run on its own.

Review guide — where to focus:

  • skills/cadence/SKILL.md — Josh has already reviewed this line by line, updates applied
  • mcp-server/ — standalone package with 54 tests, can be reviewed independently
  • content/docs/ — the MDX content migrated from the old site. Spot-check a few pages against production to confirm nothing was lost
  • Everything else (components, routes, config) — framework scaffolding, not content

Happy to hand off further iterations:
The SKILL.md content and landing page copy are areas where Cadence experts/creator can improve directly. Feel free to push commits to this branch for any wording, code examples, or content changes — I'll keep the framework and tooling side working.

Preview is live at https://cadence-lang.vercel.app/ for testing.

lmcmz and others added 6 commits March 31, 2026 23:14
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New MCP tool that validates JSON-CDC encoded arguments for Cadence
scripts and transactions. Supports two modes:
- Standalone: validates format, type names, and value correctness
  (integer ranges, Fix64 precision, Address format, nested types)
- With source code: additionally verifies args match the entry
  function signature via LSP or regex fallback

Stricter than FCL's @onflow/types — catches range overflows, invalid
addresses, and type mismatches that FCL passes through silently.

220 tests with FCL-generated ground truth fixtures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…dk to 1.26.0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants