Files
LangBot/skills/skills/langbot-testing/SKILL.md
T
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

3.5 KiB

name, description
name description
langbot-testing Test LangBot WebUI and core product flows with an automated browser and backend logs. Use when validating the configured LangBot frontend, pipeline Debug Chat, model provider setup and test buttons, bot and knowledge-base UI flows, or troubleshooting failed LangBot end-to-end tests.

LangBot Testing

Use this skill when an agent needs to verify LangBot behavior through the WebUI instead of only reading code.

Routing

  • General WebUI testing: read references/web-ui-testing.md.
  • Pipeline Debug Chat: read references/pipeline-debug-chat.md.
  • Dify AgentRunner: read references/dify-agent-runner.md.
  • Model provider setup or test button: read references/model-provider-testing.md.
  • Plugin install/runtime/tool/page smoke: read references/plugin-e2e-smoke.md.
  • Local Agent Runner: read references/local-agent-runner.md.
  • Local Agent Runner path coverage: read references/local-agent-runner-coverage.md.
  • Diff-aware AgentRunner QA after code changes: read references/agent-runner-qa-workflow.md.
  • Agent Runner release gate: read references/agent-runner-release-gate.md.
  • Sandbox-backed skill authoring: read references/sandbox-skill-authoring.md.
  • LangRAG knowledge bases: read references/langrag-knowledge-base.md.
  • MCP stdio tool testing: read references/mcp-stdio-testing.md.
  • Drive a live instance over MCP (not raw HTTP): use the langbot-mcp-ops skill — the instance exposes an MCP server at http://<host>:5300/mcp (reuses API keys). Useful for setting up bots/pipelines/models as test fixtures programmatically.
  • Known failures and fixes: read references/troubleshooting.md.
  • Reusable test groups: run bin/lbs suite list and bin/lbs suite plan <suite-id> before manually assembling a case set.

Rules

  • Read ../.env first and use LANGBOT_FRONTEND_URL and LANGBOT_BACKEND_URL instead of hardcoded ports.
  • If a standalone frontend dev server is running, LANGBOT_FRONTEND_URL may point to LANGBOT_DEV_FRONTEND_URL; otherwise it may point to the backend WebUI.
  • Confirm the backend and frontend are actually running before testing.
  • Run bin/lbs fixture check before fixture-heavy MCP, RAG, multimodal, or plugin smoke tests.
  • For runner externalization release checks, run bin/lbs test run agent-runner-release-preflight before the full agent-runner-release-gate suite so configuration blockers are separated from product failures.
  • Read Manual Readiness in bin/lbs test plan <case-id>; manual_check means the declared preconditions or setup still need operator confirmation for this run.
  • Use an authenticated browser profile prepared by langbot-env-setup.
  • Do not expose API keys, OAuth secrets, tokens, or localStorage token values in output.
  • A WebUI test is not complete until the visible UI result is checked against backend logs or network behavior.
  • For a suite, use bin/lbs suite start <suite-id> to create the suite evidence root, per-case directories, and suite-start.json/suite-start.md handoff files; use bin/lbs test result <case-id> to write final per-case result.json, then run bin/lbs suite report <suite-id> --evidence-dir <dir>.
  • Do not mark a case pass until test result --evidence covers every value in the case's evidence_required.
  • For runner-specific Debug Chat cases, use the case-specific pipeline env declared by automation_pipeline_url_env / automation_pipeline_name_env; do not silently reuse a generic LANGBOT_PIPELINE_URL.