Skip to content

Configuration

Syed Asif edited this page Jun 15, 2026 · 6 revisions

Configuration

web-search-mcp uses environment variables for configuration, managed via pydantic-settings.

Environment Variables

Variable Description Required Default
EXA_API_KEY API key for Exa search Yes (for search_exa) None
GROQ_API_KEY API key for Groq services Yes (for Groq tools) None
AUTH_TOKEN / CT0 X/Twitter auth cookie Yes (for search_x) None
GITHUB_TOKEN GitHub personal access token No (for higher API limits) None

Setup

You can set these variables in your shell or use a .env file:

export GROQ_API_KEY="your_api_key_here"

X/Twitter Authentication

search_x requires AUTH_TOKEN and CT0 cookies extracted from X:

export AUTH_TOKEN="your_auth_token_here"
export CT0="your_ct0_cookie_here"
  • To get token and ct0 press F12 in logged-in browser session on x.com
  • Click on Storage -> Cookies -> x.com to view and copy the AUTH_TOKEN and CT0 cookies
  • These are session cookies that expire periodically and need refreshing

GitHub Authentication

For GitHub, you can authenticate via the gh CLI instead of setting a token:

gh auth login  # if already authenticated, GitHub search works without a token
export GITHUB_TOKEN="ghp_your_token_here"  # or set the token directly

Exa Search Authentication

search_exa requires EXA_API_KEY to be set:

export EXA_API_KEY="your_api_key_here"

Troubleshooting

  • If you encounter authentication errors when using Groq tools (groq_search, groq_analyze), ensure GROQ_API_KEY is correctly exported in the environment where the MCP server is running.
  • If search_x returns authentication errors, refresh your AUTH_TOKEN and CT0 cookies from a logged-in browser session.
  • If GitHub search returns empty results, ensure you either have the gh CLI authenticated or set GITHUB_TOKEN.
  • Reddit, Hacker News, Wikipedia, arXiv, DuckDuckGo, and developer tools require no configuration or API keys.

Home | Architecture | Tools | Development

Clone this wiki locally