Skip to main content
Version: 2.0.1-alpha.1

MCP command

The mcp command has three modes:

  • --cli — AI-powered interactive CLI that lets you run js-recon modules through natural language.
  • -c/--chat "<prompt>"one-shot non-interactive chat. Send a single prompt, print the reply, exit. Repeatable.
  • --server — start a Model Context Protocol server over stdio so js-recon can be wired into Claude Code, Cursor, or any other MCP-aware tool as a tool provider.

Usage

js-recon mcp --cli [options]                # interactive REPL
js-recon mcp -c "scan https://example.com" # one-shot
js-recon mcp --server # MCP stdio server

Options

OptionAliasDescriptionDefaultRequired
--cliStart the interactive CLI session.falseNo
--serverStart a Model Context Protocol server over stdio.falseNo
-c, --chat <prompt>-cSend a one-shot prompt (repeatable; each -c adds another turn).No
--config <file>Path to a custom MCP config file.~/.js-recon/mcp.yamlNo
--api-key <key>API key for the LLM provider (overrides config and env vars).No
--model <model>AI model to use (for example, gpt-4o-mini, claude-sonnet-4-20250514).from configNo
--provider <provider>LLM provider to use (openai or anthropic).from configNo
--no-refresh-claude-credsDo not auto-refresh reused Claude Code OAuth tokens; fail with a hint if expired.No
--claude-client-id <id>OAuth client ID used when refreshing Claude Code credentials. Required in environments where the default Anthropic client ID is not registered.No

Reusing your Claude Code login

If you don't pass --api-key and don't have one configured, the --cli and -c/--chat modes automatically try to reuse the OAuth credentials from your local Claude Code install. On macOS those live in the keychain under the service name Claude Code-credentials; on Linux they're in ~/.claude/.credentials.json. The token is refreshed when expired (with a warning) and never written to ~/.js-recon/mcp.yaml — it stays in the OS credential store. Pass --no-refresh-claude-creds to opt out of automatic refresh.

MCP server mode

js-recon mcp --server speaks the Model Context Protocol over stdio. Registered tools: lazyload, strings, map, endpoints, analyze, report, run, list_skills, run_skill. To wire into Claude Code, add to ~/.claude.json:

{
"mcpServers": {
"js-recon": {
"command": "node",
"args": ["/abs/path/to/js-recon/build/index.js", "mcp", "--server"]
}
}
}

Smoke-test the protocol without a host:

echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node build/index.js mcp --server

Configuration

MCP stores its configuration at ~/.js-recon/mcp.yaml. A default file is created automatically on first run. You can also pass a custom path with --config.

config file format

provider: openai # openai or anthropic
model: gpt-4o-mini
openai_api_key: sk-...
anthropic_api_key: ""
default_output_dir: output
default_threads: 1
history_limit: 50
FieldDescriptionDefault
providerLLM provider (openai or anthropic)openai
modelModel to usegpt-4o-mini
openai_api_keyOpenAI API key (also reads OPENAI_API_KEY env var)
anthropic_api_keyAnthropic API key (also reads ANTHROPIC_API_KEY env var)
default_output_dirOutput directory used when running toolsoutput
default_threadsThreads passed to lazyload/run1
history_limitMaximum number of messages kept in conversation history50

API keys are resolved in order: --api-key CLI flag → config file → environment variable.

Starting a session

js-recon mcp --cli

If no API key is configured, the CLI will prompt you to select a provider and enter your key interactively. The key will be saved to ~/.js-recon/mcp.yaml.

To start with a specific provider and key without saving to config:

js-recon mcp --cli --provider anthropic --api-key <your-key> --model claude-sonnet-4-20250514

Chatting naturally

Once the session starts, you can interact in plain English. The CLI automatically detects intent and decides whether to call a tool:

  • "lazyload https://example.com" — downloads JS files from the target
  • "run a full analysis on https://example.com" — runs the complete pipeline (lazyload → strings → map → endpoints → analyze → report)
  • "summarize the results" — reads and summarizes the output files from the last run
  • Anything else is answered by the AI as a general question

The AI will ask for confirmation of the target URL before executing tools.

Slash commands

Slash commands can be typed at any time in the session. Tab completion is supported.

CommandDescription
/helpShow all available slash commands.
/exitExit the MCP CLI.
/statusShow current provider, model, conversation length, and cost.
/costShow token usage and estimated cost for this session.
/clearClear conversation history (keeps the system prompt).
/modelShow the current model.
/model <name>Switch to a different model (for example, /model gpt-4o).
/modelsList all available models for the current provider.
/providerShow the current provider.
/provider <name>Switch provider (openai or anthropic).
/configShow the current configuration.
/saveSave the current session config to ~/.js-recon/mcp.yaml.

Keyboard shortcuts

KeyAction
Ctrl-CStop the current in-progress tool call.
Ctrl-C ×2Exit the session (also accepts /exit).
TabAutocomplete slash commands.
Up ArrowNavigate to previous input in history.
Down ArrowNavigate to next input in history.

Example session

js-recon mcp --cli --provider openai --api-key sk-...

╔══════════════════════════════════════╗
║ js-recon MCP CLI ║
╚══════════════════════════════════════╝

Provider: openai | Model: gpt-4o-mini
Type /help for commands, or chat naturally.

js-recon> lazyload https://example.com
[Tool Output - lazyload]: Downloaded 12 JS files to output/

js-recon> summarize the results
Found: main.js, chunks/123.js, chunks/456.js ...

js-recon> /cost
Prompt tokens: 1,204 | Completion tokens: 387 | Estimated cost: $0.000248

js-recon> /exit