AI Agents & MCP Integration
JetPack includes a complete AI-Agent Developer Experience (DX) suite designed so coding agents (Claude Code, Cursor, Windsurf, OpenClaw, and custom MCP clients) can scaffold, type-check, validate, and debug @jetpack-desktop/client + Python Worker applications with zero hallucinations.
1. LLM-Friendly Documentation (llms.txt & llms-full.txt)
Every JetPack documentation build publishes clean, HTML-free Markdown entry points at the root of the static site:
https://jetpack-desktop.github.io/llms.txt— Structured index of all Guide, Security Audit, Frontend SDK, Worker SDK, and Publishing & CLI pages with 1-line summaries.https://jetpack-desktop.github.io/llms-full.txt— Single concatenated Markdown document containing the entire JetPack documentation set.
Linking Docs in AI IDEs
- Cursor: Open Settings → Features → Docs → Add new doc and enter
https://jetpack-desktop.github.io/llms-full.txt, then reference@JetPackin Composer/Chat. - Claude Code / OpenClaw: Fetch or reference
https://jetpack-desktop.github.io/llms.txtto discover relevant pages, or attachllms-full.txtdirectly when working offline. - Offline / Local via MCP: Use the
search_docstool insidejetpack mcp(which embeds version-matcheddocs/Markdown directly inside thejetpackCLI binary and supports overriding withJETPACK_DOCS_DIR).
2. Built-In Local MCP Server (jetpack mcp)
The standalone console CLI jetpack (crates/jetpack-cli) includes a Model Context Protocol server powered by the official rmcp crate over stdio transport (stdin/stdout JSON-RPC, with all diagnostic tracing routed strictly to stderr).
Client Configuration (mcpServers)
Every official JetPack release bundle includes the jetpack CLI alongside jetpack-daemon, so you can point your MCP client directly at the installed binary without building from source.
Add the appropriate configuration for your OS to Claude Code (.mcp.json or ~/.claude.json), Cursor (.cursor/mcp.json or ~/.cursor/mcp.json), Windsurf (~/.codeium/windsurf/mcp_config.json), or any MCP-compatible IDE:
macOS (darwin/arm64)
When JetPack.app is installed in /Applications:
{
"mcpServers": {
"jetpack": {
"command": "/Applications/JetPack.app/Contents/MacOS/jetpack",
"args": ["mcp"]
}
}
}(If you placed JetPack.app in ~/Applications, use /Users/<you>/Applications/JetPack.app/Contents/MacOS/jetpack.)
Windows (windows/amd64)
When JetPack-windows-x64.zip is extracted into %LOCALAPPDATA%\JetPack\:
{
"mcpServers": {
"jetpack": {
"command": "C:\\Users\\<you>\\AppData\\Local\\JetPack\\jetpack.exe",
"args": ["mcp"]
}
}
}Linux (linux/amd64)
When JetPack-linux-x64.tar.gz is extracted into ~/.local/opt/jetpack/:
{
"mcpServers": {
"jetpack": {
"command": "/home/<you>/.local/opt/jetpack/jetpack",
"args": ["mcp"]
}
}
}Using PATH or Building from Source
If jetpack is on your shell PATH (for example via cargo install --path crates/jetpack-cli or a symlink in /usr/local/bin / ~/.local/bin), or if you are testing an unreleased local build (target/release/jetpack):
{
"mcpServers": {
"jetpack": {
"command": "jetpack",
"args": ["mcp"]
}
}
}Note: Regardless of where
jetpackis invoked from,jetpack mcpautomatically discovers and communicates with your activejetpack-daemonvia<JETPACK_HOME>/config/pairing.ipc(including when the daemon was launched from/Applications/JetPack.app,%LOCALAPPDATA%\JetPack\jetpack-daemon.exe, or~/.local/opt/jetpack/jetpack-daemon), andjetpack install-local/jetpack packageautomatically use the siblingjetpack-daemonbinary in the same directory.
Exposed MCP Tools
| Tool | Parameters | Description |
|---|---|---|
search_docs | query: string, max_results?: number (1..20, default 5) | Searches embedded version-matched JetPack documentation (or JETPACK_DOCS_DIR) by keyword/topic and returns ranked Markdown snippets. |
get_daemon_status | (none) | Checks jetpack-daemon health, version, bound 127.0.0.1 WebSocket port, reachability, paired origins, and active sandboxed workers via token-authenticated pairing.ipc. |
read_worker_logs | app_id: string, lines?: number (1..2000, default 100) | Tails live or offline worker.log / daemon.log crash tracebacks and stdout/stderr for app_id, automatically redacting sensitive keys, tokens, and user paths. |
validate_manifest | path: string, env?: "prod" | "dev" (default "prod") | Validates app.toml (or merged app.dev.toml when env = "dev") against the strict #[serde(deny_unknown_fields)] schema, permissions (gpu_access, model_cache), volumes, runtimes, python_env, services, and lazy [models.<name>] declarations. |
scaffold_app | target_dir: string, app_id?: string, dev_app_id?: string, template?: "python" | "fullstack" (default "fullstack") | Generates a two-environment starter JetPack app (app.toml, app.dev.toml, .env.*, cross-platform package.json npm scripts, locales/en.json, worker.py, optional @jetpack-desktop/client frontend, AGENTS.md, CLAUDE.md, .cursor/rules/jetpack.mdc, .agents/skills/). |
3. Project Scaffolding Rules & Agent Skills (jetpack init)
Running jetpack init (or jetpack-daemon --init-app, or the scaffold_app MCP tool) generates a ready-to-run two-environment project preloaded with AI guardrails and unified cross-platform npm scripts (npm run validate, npm run env:check, npm run i18n:check, npm run i18n:sync, npm run codegen, npm run install:local, npm run dev, npm run build, npm run package, npm run sdk:install, npm run sdk:update):
# Python worker starter + AI rules & skills
jetpack init ./workers/my-ocr-worker --app-id com.acme.my-ocr-worker --template python
# Fullstack TypeScript (@jetpack-desktop/client) + Python worker starter
jetpack init ./apps/my-ai-app --app-id com.acme.my-ai-app --dev-app-id com.dev.my-ai-app --template fullstackGenerated Two-Environment & AI Artifacts
app.toml&app.dev.toml— ProdEnv manifest (package.id = "com.acme.my-ai-app") and strict DevEnv partial overlay (package.id = "com.dev.my-ai-app") so localnpm run install:localruns side-by-side withoutAPP_SPOOFING_DETECTED..env.development&.env.production— Pre-configuredVITE_JETPACK_ENV,VITE_JETPACK_APP_ID, andVITE_JETPACK_DAEMON_PORTvariables.package.json— Cross-platform unified developernpmscripts (validate,validate:prod,env:check,i18n:check,i18n:sync,codegen,install:local,dev,build,package,sdk:install,sdk:update, plustypecheckinfullstack).locales/en.json(infullstack) — Canonical flat English translation catalog pre-wired insrc/main.tswithcreateI18nandclient.onLanguageChanged(...)(and included cleanly in OCI packages).AGENTS.md— Canonical instructions enforcingJetPackAppClient.connectAndEnsureApp(), DevEnv/ProdEnv separation, English-firstlocales/en.jsoni18n patterns (createI18n,client.language,jetpack i18n),[models.<name>]+model_cacheandclient.app_home, strict MsgPack metadata vs zero-copyUint8Arraypayload separation, frontend-to-worker opcode parity, andapp.tomlsecurity rules.CLAUDE.md— Regular-file mirror ofAGENTS.md(not a symlink, ensuring full compatibility on Windows and OCI layer packaging)..cursor/rules/jetpack.mdc— Cursor MDC rule file auto-attaching JetPack architecture and localization constraints..agents/skills/— Step-by-step reusable Agent Skills:.agents/skills/create-jetpack-worker/SKILL.md— Scaffolding, DevEnv/ProdEnv setup,[models.<name>],client.app_home,npm run env:check, and local installation..agents/skills/add-binary-opcode/SKILL.md— Adding a Pydantic/typed Python worker handler, regeneratingjetpack-env.d.ts, and calling it from@jetpack-desktop/client..agents/skills/add-translations/SKILL.md— Adding and validating English-firstlocales/*.jsontranslation catalogs, wiring@jetpack-desktop/clientcreateI18n, and handlingJETPACK_LANGviaclient.language..agents/skills/debug-pairing/SKILL.md— Diagnosing127.0.0.1:9470WebSocket pairing,DAEMON_NOT_RUNNING,APP_SPOOFING_DETECTED,APP_IS_RUNNING, proxy blocks, and worker launch errors via MCP.
All AI instruction files (AGENTS.md, CLAUDE.md, .cursor/, .agents/), generated jetpack-env.d.ts declarations, and DevEnv files (app.dev.toml, .env, .env.*) are automatically excluded when packaging OCI bundles via jetpack package or jetpack-daemon --package-app, while runtime translation catalogs (locales/, ui/locales/) are preserved.
4. End-to-End Agentic Workflow with jetpack codegen
To eliminate frontend/worker opcode drift and metadata typos, define your Python worker schemas with Pydantic BaseModel, TypedDict, or @dataclass, and optionally annotate handlers with @opcode (or client.opcode(...)) from jetpack_sdk:
from pydantic import BaseModel
from jetpack_sdk import JetPackClient, opcode
class TranscribeRequest(BaseModel):
language: str = "en"
diarize: bool = False
class TranscribeResponse(BaseModel):
text: str
duration_ms: int
@opcode("audio.transcribe", request=TranscribeRequest, response=TranscribeResponse, binary=True)
def handle_transcribe(client: JetPackClient, meta: TranscribeRequest, payload: bytes):
return {"text": "ok", "duration_ms": len(payload)}Generate strict TypeScript declarations from the worker AST (without executing Python):
jetpack codegen --worker worker.py --out src/jetpack-env.d.ts --strictThen pass JetPackOpcodeMap as the generic parameter to JetPackAppClient:
import { JetPackAppClient } from '@jetpack-desktop/client';
import type { JetPackOpcodeMap } from './jetpack-env';
const client = new JetPackAppClient<JetPackOpcodeMap>();
await client.connectAndEnsureApp({
env: 'auto',
environments: {
dev: { appId: 'com.dev.my-ai-app', daemonPort: 9470 },
prod: { appId: 'com.acme.my-ai-app', daemonPort: 9470 },
},
});
// Compile-time checked by tsc: opcode name, meta shape, required Uint8Array, and response type
const reply = await client.request('audio.transcribe', { language: 'en' }, audioBytes);If an agent invents a nonexistent opcode, forgets the required Uint8Array payload when binary: true, or misspells a metadata field, tsc --noEmit fails immediately so the agent can self-correct before runtime.
