Bug reports and PRs welcome.
git clone https://github.com/AutomateLab-tech/citation-intelligence
cd citation-intelligence
npm install
npm run buildRun the server locally with npm start. For development with hot reload: npm run dev.
src/
index.ts # MCP server entry, registers all 5 tools
types.ts # shared types
lib/
config.ts # env vars, cache paths
cache.ts # local JSON cache
fetch.ts # undici wrapper with timeouts + ToolFetchError
adapters/
perplexity.ts # Sonar API
serpapi.ts # Google AI Overview
bing.ts # Bing Web Search
anthropic.ts # Claude with web_search tool
openai.ts # ChatGPT via Responses API
gemini.ts # Gemini with google_search grounding
predictors.ts # Wikipedia, GitHub, Reddit, schema.org, llms.txt
tools/
check-citations.ts
am-i-cited.ts
ai-overview.ts
cited-for.ts
predict-citation.ts
- Create
src/adapters/<engine>.tsreturning anAdapterResult. - Add it to the
Enginetype insrc/types.ts. - Wire it into
runEngineandpickAutoEngineinsrc/tools/check-citations.ts. - Add a smoke test in
tests/.
npm testSmoke tests live in tests/smoke.test.ts. They run with no API keys configured and verify each tool returns either a sane result or a structured missing_key error.
- No em-dashes. Use
-. - All logging goes to stderr (
console.error). stdout is reserved for JSON-RPC. - Errors flow through
ToolFetchErrorso the MCP layer can serialize a typedToolError.