Appearance
Market Intelligence Bot
You will build a company research agent that turns a single sentence into a boardroom-ready executive briefing. Type a company name and the bot searches the web for recent news, competitive positioning, pricing data, and market sentiment, then compiles everything into a clean markdown report with a risk assessment and recommended next steps. This is for business analysts, strategy consultants, and founders who need quick but thorough competitive intelligence without spending two hours manually searching.
What you will need
| Item | Detail |
|---|---|
| Stack | Claude Code, Search MCP server (Brave Search or Tavily), markdown output |
| Time | 30-45 minutes |
| Cost | Claude API usage (~$0.15-0.30 per report with Sonnet) plus any MCP search provider costs (Brave Search has a free tier with 2,000 queries/month; Tavily offers 1,000 free queries/month) |
| Prerequisites | Claude Code installed and authenticated, Node.js 18+, a search API key (Brave or Tavily) |
How it works
The bot runs as a Claude Code session with the Search MCP server attached. You type one prompt. Claude Code calls the search tool multiple times with different queries (company overview, recent news, financials, competitor moves), processes the results through a structured prompt template, and writes a polished markdown report to disk. No orchestration framework, no external scripts.
Build it
1. Get a search API key
The search MCP server needs an API key to query the web. Brave Search works well for business research and has a generous free tier. Sign up at api.search.brave.com and copy your API key. Tavily is another option optimized for AI agent usage at tavily.com. Pick one and keep the key handy.
2. Configure the MCP server
Claude Code reads MCP server configs from .mcp.json in your project directory. Create that file in a folder where you will run the bot. The following config registers a Brave Search MCP server installed via npx.
json
{
"mcpServers": {
"brave-search": {
"command": "npx",
"args": [
"-y",
"@anthropic-ai/mcp-server-brave-search"
],
"env": {
"BRAVE_API_KEY": "your-brave-api-key-here"
}
}
}
}For Tavily, use this config instead:
json
{
"mcpServers": {
"tavily": {
"command": "npx",
"args": [
"-y",
"tavily-mcp"
],
"env": {
"TAVILY_API_KEY": "your-tavily-api-key-here"
}
}
}
}Replace the placeholder API key with your actual key. Claude Code picks up this config automatically when you launch from this directory.
3. Write the prompt template
Create a text file called briefing-prompt.md in the same directory. This is the reusable prompt you will feed to Claude Code each time you want a report.
markdown
You are a senior competitive intelligence analyst. Your task is to research a company and produce an executive briefing report.
## Company to research
{{COMPANY_NAME}}
## Process
1. Search for the company overview: what they do, their size, key products, target market
2. Search for recent news (last 6 months): funding rounds, product launches, leadership changes, partnerships
3. Search for competitive positioning: main competitors, market share, pricing information if available
4. Search for risks and challenges: regulatory issues, lawsuits, market headwinds, negative press
## Output format
Write a file called `briefings/{{COMPANY_SLUG}}-briefing.md` with this structure:
# {{COMPANY_NAME}} - Executive Briefing
**Date:** {{DATE}}
**Prepared by:** Market Intelligence Bot
## Company Snapshot
- **Founded:** [year]
- **Headquarters:** [location]
- **Employees:** [estimate]
- **Key Products:** [list]
- **Target Market:** [description]
## Recent Developments
[3-5 bullet points with dates, each one sentence]
## Competitive Landscape
[2-3 paragraph analysis of competitors and positioning]
## Pricing & Market Position
[Available pricing intelligence and market share data]
## Risk Assessment
| Risk Factor | Severity (Low/Medium/High) | Detail |
|---|---|---|
| [factor] | [severity] | [one-sentence explanation] |
## Recommended Next Steps
[3-4 actionable recommendations for the reader, based on findings]
## Sources
[List each source URL used]
## Rules
- Every claim must cite a source found via search
- If information is unavailable, state "Not publicly available" rather than guessing
- Keep the report under 1,200 words
- Use the exact heading structure shown aboveThe , , and variables get replaced each time. You can do this manually or with a small shell wrapper.
4. Create the run script
Create a shell script called brief.sh that replaces the variables and invokes Claude Code:
bash
#!/bin/bash
# Usage: ./brief.sh "Company Name"
# Example: ./brief.sh "Rivian Automotive"
COMPANY_NAME="$1"
if [ -z "$COMPANY_NAME" ]; then
echo "Usage: ./brief.sh \"Company Name\""
exit 1
fi
COMPANY_SLUG=$(echo "$COMPANY_NAME" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
DATE=$(date +%Y-%m-%d)
OUTPUT_DIR="briefings"
mkdir -p "$OUTPUT_DIR"
# Build the prompt with variables substituted
PROMPT=$(sed "s/{{COMPANY_NAME}}/$COMPANY_NAME/g" briefing-prompt.md |
sed "s/{{COMPANY_SLUG}}/$COMPANY_SLUG/g" |
sed "s/{{DATE}}/$DATE/g")
echo "$PROMPT" | claude --bare -p - --max-turns 12 --output-format text
echo ""
echo "Report saved to: $OUTPUT_DIR/${COMPANY_SLUG}-briefing.md"Make it executable:
bash
chmod +x brief.sh5. Run your first briefing
With the MCP config in place and your API key set, run:
bash
./brief.sh "Stripe"Claude Code launches in bare mode (--bare skips the interactive TUI), reads the prompt from stdin, performs 3-5 search tool calls, and writes the report to briefings/stripe-briefing.md. The complete run takes 20-40 seconds depending on model speed.
What goes wrong
| Mistake | Symptom | Fix |
|---|---|---|
Missing or wrong API key in .mcp.json | Claude Code starts but search tool calls fail with authorization errors | Verify the key in env.BRAVE_API_KEY or env.TAVILY_API_KEY matches your provider dashboard. Run echo $BRAVE_API_KEY to check if it is exported in your shell. |
| MCP server not installed | "Server not found" or "Cannot find module" errors | The npx -y flag in the config auto-installs the package, but the first run needs internet. If behind a proxy or offline, run npx -y @anthropic-ai/mcp-server-brave-search manually first. |
| Report missing sections or too short | Output has placeholder text or skipped sections | Claude Code default token limits may truncate. Add --max-turns 15 to give the model more rounds to complete all sections. For very large companies, bump --max-turns to 20. |
| Search results are stale or irrelevant | Report cites old information or misses major news | Brave Search defaults to web results which can include older pages. Add &freshness=pm (past month) or &freshness=pw (past week) to the search query if your MCP server supports it. Or try Tavily which defaults to recent results. |
The result
You now have a working company research pipeline. To verify it works:
- Run
./brief.sh "Databricks"and check thatbriefings/databricks-briefing.mdwas created - Open the report. Every section from the template should be populated with real data from search results
- Each claim should have a source URL in the Sources section
- The risk assessment table should contain at least 3 rows with specific factors, not generic statements
The reports are plain markdown and render on GitHub, in Obsidian, or in any markdown viewer. You can drop them into a Notion page, attach them to a Slack thread, or pipe them into a presentation deck. The briefings/ folder becomes your searchable archive of company intelligence, each one generated from a single command.