How southleft/company-docs-mcp works
Company Docs MCP ingests documentation into a searchable knowledge base, then serves sourced answers through MCP, HTTP chat/search, and Slack. The graph preserves the distinct ingestion formats, publishing, search, and response paths, plus the provider layer. Some ingestion and runtime modules were not excerpted; their subsystem paths and links are included only where the README or SOURCE INDEX supports them.
Main entry points: index.ts Cloudflare Worker · search-handler.ts Unified search · ingest-supabase.ts Vector publishing · tools.ts MCP tools
Components 26
Ingestion
- Markdown ingestion
scripts/ingest/ingest-markdown.ts - Web and file ingestion
scripts/ingest/ingest.ts - CSV URL ingestion
scripts/ingest/ingest-csv.ts - Website crawling
scripts/ingest/website-crawler.ts - Ingestion CLI
cli/index.ts
Publishing
- Content model
src/lib/content.ts - Vector publishing
scripts/ingest/ingest-supabase.ts
Query Runtime
- Cloudflare Worker
src/index.ts - Unified search
src/lib/search-handler.ts - Local content search
src/lib/content-manager.ts - Diverse chunk search
src/lib/content-manager-enhanced.ts
User Interfaces
- MCP handler
src/mcp-handler.ts - MCP tools
src/tools.ts - AI chat handler
src/ai-chat-handler.ts - Chat interface
src/chat-ui.ts - Slack webhook
src/slack-webhook.ts
Provider Layer
- Embedding generation
src/lib/embedding-provider.ts - Supabase vector store
src/providers/impl/supabase-vector-store.ts - Service container
src/providers/container.ts - Provider registry
src/providers/registry.ts - Embedding adapters
src/providers/impl/embeddings.ts
Other components
- Content maintainer
- Team user
- Documentation sources
- MCP-compatible AI tool
- Slack user
Connections 32
- Content maintainer → Documentation sources: provides
README.md - Documentation sources → Markdown ingestion: ingests
README.md - Documentation sources → Web and file ingestion: ingests
README.md - Documentation sources → CSV URL ingestion: ingests
README.md - Documentation sources → Website crawling: crawls
README.md - Ingestion CLI → Markdown ingestion: dispatches to
cli/index.ts - Ingestion CLI → Vector publishing: dispatches to
cli/index.ts - Markdown ingestion → Content model: creates entries
scripts/ingest/ingest-markdown.ts - Web and file ingestion → Content model: creates entries
scripts/ingest/ingest.ts - CSV URL ingestion → Content model: creates entries
- Vector publishing → Content model: publishes entries
scripts/ingest/ingest-supabase.ts - Vector publishing → Embedding generation: requests vectors
scripts/ingest/ingest-supabase.ts - Vector publishing → Supabase vector store: stores vectors
README.md - Embedding adapters → Embedding generation: adapts
src/providers/impl/embeddings.ts - Team user → Cloudflare Worker: asks questions
README.md - MCP-compatible AI tool → Cloudflare Worker: connects to
README.md - Cloudflare Worker → MCP handler: routes /mcp
src/index.ts - Cloudflare Worker → AI chat handler: routes /ai-chat
src/index.ts - Cloudflare Worker → Slack webhook: routes /slack
src/index.ts - Cloudflare Worker → Chat interface: serves interface
src/index.ts - MCP handler → MCP tools: dispatches tools
src/mcp-handler.ts - AI chat handler → MCP tools: uses tool definitions
src/ai-chat-handler.ts - Slack user → Slack webhook: sends command
README.md - Slack webhook → Unified search: searches docs
src/slack-webhook.ts - MCP tools → Unified search: queries
src/tools.ts - MCP tools → Diverse chunk search: falls back to
src/tools.ts - Cloudflare Worker → Unified search: handles /search
src/index.ts - Unified search → Service container: resolves services
src/lib/search-handler.ts - Unified search → Local content search: falls back to
src/lib/search-handler.ts - Service container → Provider registry: resolves providers
src/providers/container.ts - Provider registry → Embedding adapters: registers adapters
- Unified search → Supabase vector store: searches vectors
README.md