# SAP Docs MCP – High-level Overview (Rule)
Use this when asked about "how it works", "where to change X", or "what runs in prod".
## System Architecture
- **MCP Server**: Stdio-based server for Claude/LLM integration
- **HTTP Servers**: Development server (port 3001) and streamable HTTP server (port 3122)
- **Search Pipeline**: BM25-only (FTS5) → metadata-driven configuration → formatted results
- **Metadata-Driven**: All source configurations centralized in `src/metadata.json`
- **Submodule Management**: Shallow, single-branch clones with blob filtering for performance
## Key Components
- **Search**: Pure BM25 using SQLite FTS5 for fast, reliable search
- **Configuration**: Centralized metadata system with type-safe APIs
- **Sources**: 27 documentation sources including 8 ABAP versions (SAPUI5, CAP, ABAP, wdi5, Cloud SDK, etc.)
- **Tools**: 5 MCP tools (search, fetch, sap_community_search, sap_help_search, sap_help_get)
- **Build Process**: TypeScript compilation → Index building → FTS database creation
- **ABAP Integration**: 40,761+ files across 8 versions with intelligent version filtering
## Production Setup
- **Remote Server**: Hosted MCP server at https://mcp-sap-docs.marianzeis.de/mcp
- **PM2**: 3 processes (proxy, http, streamable) via `ecosystem.config.cjs`
- **Deployment**: GitHub Actions → SSH → enhanced `setup.sh` → PM2 restart
- **Health**: Multiple endpoints (/status, /health, /healthz, /readyz)
- **Submodules**: Optimized shallow clones with partial clone filtering
- **Protocol**: MCP Streamable HTTP (latest protocol) + STDIO support
@file package.json
@file src/metadata.json
@file src/lib/config.ts
@file src/lib/metadata.ts
@file src/lib/search.ts
@file src/server.ts
@file src/http-server.ts
@file src/streamable-http-server.ts
@file ecosystem.config.cjs
@file docs/ARCHITECTURE.md
@file docs/DEV.md