feat: add AdaL agent support (skills + MCP) - #176
Open
Ricardoran wants to merge 2 commits into
Open
Conversation
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.
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
Adds AdaL to the agent registries used by
firecrawl setup/firecrawl doctor/firecrawl init, sofirecrawl setup mcp --agent adaland 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, underprojects.<absolute_project_path>.mcpServers— it doesn't have anadd-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 throughinstallAddMcp.Changes
src/utils/agents.ts— newadalAgentSpecforfirecrawl doctordetection. Presence =~/.adal; MCP config =~/.adal/settings.json. The existing recursive JSON walker (hasFirecrawlMcpEntry) already finds a nestedmcpServers.firecrawlentry at any depth, so no walker changes were needed.src/commands/skills-native.ts— newadalAgentConfigfor native skill installs. Global skills dir =~/.adal/skills(matches AdaL'sSkillsManagerpersonal-skills path in its own source).src/commands/setup.ts— newinstallAdalMcp(), modeled directly oninstallHermesMcp(). Reads/creates~/.adal/settings.json, resolves the current project viaprocess.cwd(), and injectsprojects[cwd].mcpServers.firecrawl = { type: 'http', url, headers }. Wired intoresolveMcpAgent(--agent adal), theinstallMcpdispatch, andinstallAllMcpLaunchers(--agent all).Testing
Ran a full E2E validation against a real AdaL checkout (not just unit tests):
firecrawl setup mcp --agent adalcorrectly wroteprojects.<cwd>.mcpServers.firecrawlinto~/.adal/settings.json.mcp_firecrawl_firecrawl_scrape/search/parse) against Firecrawl's hosted MCP server (https://mcp.firecrawl.dev/v2/mcp, keyless). AdaL then successfully invokedmcp_firecrawl_firecrawl_scrapeagainsthttps://example.comand got back real markdown + metadata (scrapeId,creditsUsed: 1, etc.) from Firecrawl's live API.installSkillsNative({ agent: 'adal' })correctly symlinked all 10firecrawl/cliskills into~/.adal/skills/. AdaL's ownSkillsManager(in itsdeep_researchbackend) then discovered and indexed all 10 as personal skills, ready to inject into the agent prompt.npx vitest run— all 391 existing tests pass, no changes to existing agent behavior.Notes
--keylessis honored automatically foradalthe same way it is for other keyless-capable agents (no code path changes there —getApiKey()naturally returns undefined without a stored/env key).Need help on this PR? Tag
@codesmith-botwith 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 adalto register Firecrawl with AdaL.New Features
adalsupport: detection via~/.adaland MCP config at~/.adal/settings.json;installAdalMcp()writesprojects[<cwd>].mcpServers.firecrawland is wired to--agent adal/--agent all; native skills install to~/.adal/skills.Bug Fixes
installAdalMcp()now respects--keyless(no Authorization header) and validatessettings.jsonshape with a clear error when not an object.Written for commit d83dc45. Summary will update on new commits.