Files
LangBot/skills
Junyan Chin e9dd584792 feat: MCP server + in-repo skills (agent-friendly platform) (#2269)
* feat(api): support global API key from config.yaml (api.global_api_key)

Accept a config-defined global API key anywhere a web-UI key is accepted
(X-API-Key / Bearer), with no login session and no DB record. Useful for
automated deployments and AI agents (HTTP API + MCP). Defaults to empty
(disabled); does not require the lbk_ prefix.

- templates/config.yaml: add api.global_api_key with security notes
- service/apikey.py: verify_api_key checks global key first (constant-time)
- docs/API_KEY_AUTH.md: document the global key + security guidance
- tests: cover global-key match, prefix-free, fallback-to-db, disabled

* feat(mcp): expose LangBot management as an MCP server at /mcp

Add an MCP (Model Context Protocol) server so external AI agents can manage a
LangBot instance. Reuses the same API-key auth as the HTTP API (including the
config.yaml global API key).

- pkg/api/mcp/server.py: FastMCP server wrapping the service layer; 21 curated
  tools across system/bots/pipelines/models/knowledge/mcp-servers/skills
- pkg/api/mcp/mount.py: ASGI dispatcher fronting Quart; authenticates /mcp
  requests with an API key, runs the streamable-HTTP session manager lifespan
- controller/main.py: serve the wrapped ASGI app via hypercorn (was run_task)
- web: new 'MCP' tab in the API integration dialog showing endpoint, auth, and
  client config; i18n for 8 locales
- tests/manual/mcp_smoke.py: e2e check (401 unauth, list tools, call tools)

Tool surface is intentionally curated (not all ~25 route groups) to keep the
agent surface small, safe, and maintainable. Extend deliberately.

* feat(skills): add in-repo skills/ as the single source of truth

Migrate the agent skills + QA/e2e test harness from the (now archived)
langbot-app/langbot-skills repo into LangBot/skills/, and add four new skills.

Migrated:
- langbot-plugin-dev, langbot-testing (e2e), langbot-env-setup,
  langbot-skills-maintenance, langbot-eba-adapter-dev
- the bin/lbs CLI (src/, test/, scripts/, schemas/, qa-agent-docs/)

New:
- langbot-dev      core backend + web development
- langbot-deploy   Docker/K8s deployment + config.yaml + global API key
- langbot-mcp-ops  operating the LangBot MCP server (/mcp)
- langbot-space-ops operating the Space marketplace MCP server

- src/cli.ts repoRoot(): recognize the skills assets root (skills.index.json +
  bin/lbs) so the CLI works when nested inside the LangBot repo
- README.md: unified skill catalog; skills.index.json regenerated

Parity with source verified: bin/lbs validate + node test suite match the
source repo (only the uncommitted .lbpkg build-artifact fixture differs).

* docs(agents): document agent-facing surfaces + API/MCP/skills sync rule

* docs(readme): add 'Built for AI Agents' section across all locales

Highlight MCP server, in-repo skills (single source of truth), AGENTS.md
sync rule, and llms.txt. Cross-link LangBot Space MCP marketplace.

* style(mcp): fix ruff format + prettier lint in MCP server and API panel

* style(web): prettier format MCP i18n locale entries

* docs(skills): note MCP instance control in dev/testing skills

All development-guidance skills now point to the LangBot instance MCP
server (/mcp) and the Space marketplace MCP server, reusing API keys.
2026-06-20 15:14:47 +08:00
..

LangBot Skills

This directory is the single source of truth for LangBot's agent skills — reusable, on-demand instruction packs for AI agents (Claude Code, Codex, Cursor, and LangBot's own Local Agent) working with the LangBot ecosystem.

These skills were consolidated here from the former langbot-app/langbot-skills repository (now archived). Documentation and the landing page link here; do not re-copy skill content elsewhere — link to this directory instead.

Skill catalog

Skill What it covers
langbot-dev Core backend + web frontend development (Quart, Vite, API, migrations, MCP server)
langbot-plugin-dev Plugin SDK / component development, debugging, WebSocket testing
langbot-deploy Docker / Compose / Kubernetes deployment, config.yaml, Box runtime, global API key
langbot-testing WebUI / e2e QA harness, cases, fixtures, troubleshooting (the bin/lbs CLI)
langbot-env-setup Local dev/test environment, browser access, OAuth, proxy, startup
langbot-mcp-ops Operating a LangBot instance through its MCP server (/mcp)
langbot-space-ops Browsing the LangBot Space marketplaces through the Space MCP server
langbot-eba-adapter-dev Building platform adapters for the Event-Based Agents architecture
langbot-skills-maintenance Adding, deduplicating, and auditing skills in this directory

skills.index.json is the machine-readable index (regenerate with bin/lbs index).

Quick start (for an AI agent)

  1. Read this README, AGENTS.md, and qa-agent-docs/ to understand the layout.
  2. Read skills/.env for shared local defaults. On a new machine, copy skills/.env.example to skills/.env.local (gitignored) and override machine-specific values there. Never commit secrets.
  3. Pick the smallest relevant skill from the catalog above and follow its SKILL.md.

The lbs CLI

The testing assets ship with a small CLI (bin/lbs, Node ≥ 22.6):

bin/lbs validate     # validate skills/cases/troubleshooting structure
bin/lbs index        # regenerate skills.index.json
bin/lbs env show     # inspect resolved env defaults (redacted)
bin/lbs env doctor   # diagnose local environment readiness
bin/lbs case list --ready
bin/lbs test plan <case-id>

Maintenance rule

When the LangBot / LangBot Space API or MCP server changes, the corresponding skill here MUST be updated in the same change. The MCP tool surface, the API, and these skills are kept in lockstep — see each repo's AGENTS.md.