Skip to content

feat: add AdaL agent support (skills + MCP) - #176

Open
Ricardoran wants to merge 2 commits into
firecrawl:mainfrom
Ricardoran:add-adal-agent-support
Open

feat: add AdaL agent support (skills + MCP)#176
Ricardoran wants to merge 2 commits into
firecrawl:mainfrom
Ricardoran:add-adal-agent-support

Conversation

@Ricardoran

@Ricardoran Ricardoran commented Jul 31, 2026

Copy link
Copy Markdown

TL;DR

Adds AdaL to the agent registries used by firecrawl setup / firecrawl doctor / firecrawl init, so firecrawl setup mcp --agent adal and native skills install work the same way they already do for Hermes/OpenClaw/Cursor/etc.

Why AdaL needs a dedicated installer (not add-mcp)

AdaL stores MCP servers per-project inside a single global ~/.adal/settings.json, under projects.<absolute_project_path>.mcpServers — it doesn't have an add-mcp-compatible CLI or a global per-agent config file. This mirrors why Hermes (installHermesMcp) and OpenClaw (installOpenClawMcp) already have their own installer functions instead of going through installAddMcp.

Changes

  • src/utils/agents.ts — new adal AgentSpec for firecrawl doctor detection. Presence = ~/.adal; MCP config = ~/.adal/settings.json. The existing recursive JSON walker (hasFirecrawlMcpEntry) already finds a nested mcpServers.firecrawl entry at any depth, so no walker changes were needed.
  • src/commands/skills-native.ts — new adal AgentConfig for native skill installs. Global skills dir = ~/.adal/skills (matches AdaL's SkillsManager personal-skills path in its own source).
  • src/commands/setup.ts — new installAdalMcp(), modeled directly on installHermesMcp(). Reads/creates ~/.adal/settings.json, resolves the current project via process.cwd(), and injects projects[cwd].mcpServers.firecrawl = { type: 'http', url, headers }. Wired into resolveMcpAgent (--agent adal), the installMcp dispatch, and installAllMcpLaunchers (--agent all).

Testing

Ran a full E2E validation against a real AdaL checkout (not just unit tests):

  1. MCP registration: firecrawl setup mcp --agent adal correctly wrote projects.<cwd>.mcpServers.firecrawl into ~/.adal/settings.json.
  2. Live MCP discovery + tool call: Started AdaL against that project — its MCP client manager discovered and registered 3 live tools (mcp_firecrawl_firecrawl_scrape/search/parse) against Firecrawl's hosted MCP server (https://mcp.firecrawl.dev/v2/mcp, keyless). AdaL then successfully invoked mcp_firecrawl_firecrawl_scrape against https://example.com and got back real markdown + metadata (scrapeId, creditsUsed: 1, etc.) from Firecrawl's live API.
  3. Skills install: installSkillsNative({ agent: 'adal' }) correctly symlinked all 10 firecrawl/cli skills into ~/.adal/skills/. AdaL's own SkillsManager (in its deep_research backend) then discovered and indexed all 10 as personal skills, ready to inject into the agent prompt.
  4. Regression check: npx vitest run — all 391 existing tests pass, no changes to existing agent behavior.

Notes

  • --keyless is honored automatically for adal the same way it is for other keyless-capable agents (no code path changes there — getApiKey() naturally returns undefined without a stored/env key).
  • No new README claims are made in this PR; happy to add AdaL to the "Works with Claude Code, Antigravity, OpenCode, and more" line in a follow-up once this lands, since that's now backed by a real, tested install path per the docs guidance for this kind of change.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Adds AdaL agent support to the CLI for MCP setup, detection, and native skills. Use firecrawl setup mcp --agent adal to register Firecrawl with AdaL.

  • New Features

    • adal support: detection via ~/.adal and MCP config at ~/.adal/settings.json; installAdalMcp() writes projects[<cwd>].mcpServers.firecrawl and is wired to --agent adal/--agent all; native skills install to ~/.adal/skills.
  • Bug Fixes

    • installAdalMcp() now respects --keyless (no Authorization header) and validates settings.json shape with a clear error when not an object.

Written for commit d83dc45. Summary will update on new commits.

Review in cubic

Adds AdaL (https://github.com/SylphAI-Inc/adal) to the agent registries
used by `firecrawl setup`/`firecrawl doctor`/`firecrawl init`, following
the existing per-agent patterns (Hermes/OpenClaw-style direct config
write, since AdaL has no `adal mcp add` subcommand).

- utils/agents.ts: add `adal` AgentSpec for `firecrawl doctor` detection.
  Presence = ~/.adal; MCP config = ~/.adal/settings.json. The existing
  recursive JSON walker (hasFirecrawlMcpEntry) already finds a nested
  `mcpServers.firecrawl` entry at any depth, so no walker changes needed.

- commands/skills-native.ts: add `adal` AgentConfig for native skill
  installs. Global skills dir = ~/.adal/skills (matches AdaL's
  SkillsManager personal-skills path).

- commands/setup.ts: add `installAdalMcp()`, mirroring installHermesMcp().
  AdaL stores MCP servers per-project inside a single global
  ~/.adal/settings.json, under `projects.<absolute_project_path>.mcpServers`
  (schema per deep_research/mcp_integration/mcp_client_manager.py
  MCPServerConfig). Registers against process.cwd() as the project path.
  Wired into `resolveMcpAgent`, `installMcp` dispatch, and
  `installAllMcpLaunchers` (--agent all).

Tested E2E against a real AdaL checkout:
- `firecrawl setup mcp --agent adal` correctly writes
  projects.<cwd>.mcpServers.firecrawl into ~/.adal/settings.json.
- AdaL's MCP client manager discovers it and registers 3 live tools
  (mcp_firecrawl_firecrawl_scrape/search/parse) against Firecrawl's
  hosted MCP server (keyless).
- AdaL successfully invoked mcp_firecrawl_firecrawl_scrape against
  https://example.com and returned real markdown/metadata from
  Firecrawl's API.
- installSkillsNative({ agent: 'adal' }) correctly symlinks all 10
  firecrawl/cli skills into ~/.adal/skills/, and AdaL's own
  SkillsManager (deep_research/skills/manager.py) successfully
  discovers and indexes all 10 as personal skills.

All 391 existing tests pass; no changes to existing agent behavior.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread src/commands/setup.ts Outdated
Comment thread src/commands/setup.ts Outdated
…lMcp

Addresses cubic review feedback on PR firecrawl#176:

1. installAdalMcp() was calling firecrawlMcpConfig('adal'), which
   unconditionally calls getApiKey() regardless of options.keyless.
   `firecrawl setup mcp --agent adal --keyless` would still write an
   Authorization header if a Firecrawl API key happened to be stored.
   Fixed by resolving apiKey the same way installAddMcp does
   (`options.keyless ? undefined : getApiKey()`) and passing it through
   firecrawlMcpHeaders('adal', apiKey) directly.

2. JSON.parse() succeeds on any valid JSON value, not just objects
   (e.g. `null`, `[1,2,3]`, `"a string"`). The previous code assumed
   the parsed result was always a plain object and read/wrote
   `root.projects` on it directly, which throws on null and silently
   drops the write on arrays/primitives (JSON.stringify ignores
   non-index properties on arrays). Added an explicit object-shape
   check after parsing, reusing the same actionable error message as
   the JSON.parse() failure case.

Verified both fixes directly against the compiled dist build:
- installAdalMcp({ keyless: true }) with a stored API key present now
  writes a firecrawl entry with no `headers` field.
- installAdalMcp() against a `~/.adal/settings.json` containing `[1,2,3]`
  now throws the actionable "Failed to parse existing AdaL settings..."
  error instead of crashing on `null`/array property access or
  silently discarding the registration.

All 391 existing tests still pass (44/44 in setup.test.ts).
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.

1 participant