This repository hosts the MCP server that provides documentation search, source search, code templates, and smart-assist orchestration for the EaseIM SDK ecosystem. The MCP server is the primary focus of this document.
Key goals:
- Provide unified access to SDK docs, UIKit source, error codes, and integration guidance
- Support multi-platform material injection (docs, sources, templates, knowledge)
- Keep the orchestration layer thin and delegate to dedicated services
src/server.ts— MCP server entry, tool routing, and light orchestrationsrc/assist/SmartAssistService.ts— smart assist business flow and decisioningsrc/assist/SmartAssistContext.ts— context continuity and recommendationssrc/assist/SmartAssistResponse.ts— smart assist response composition
src/intelligence/IntentClassifier.ts— intent classification and entity extractionsrc/intelligence/IntentRegistry.ts— intent patterns/semantics and entity rulessrc/intelligence/TemplateRegistry.ts— template index for multi-platform code templatessrc/intelligence/KnowledgeRegistry.ts— scenario knowledge and steps per platformsrc/intelligence/ClassRegistry.ts— class metadata and inheritance indexingsrc/intelligence/LexiconRegistry.ts— lexicon data per platformsrc/intelligence/PlatformOrchestrator.ts— platform routing for scenarios/templatessrc/intelligence/TemplateRenderer.ts— template rendering and variable fillsrc/intelligence/CodeGenerator.ts— template selection and generation
src/search/SearchPipeline.ts— shared query preparation, corrections, expansionssrc/search/DocSearch.ts— documentation search + error lookupsrc/search/ShardedSourceSearch.ts— source search with shard loadingsrc/search/SourceSearch.ts— non-sharded source search (legacy/utility)
src/utils/ResponseBuilder.ts— response building with interactionssrc/utils/ResponseComposer.ts— interaction section + metadata compositionsrc/utils/InteractionStrategies.ts— reusable interaction hints
data/docs/*— SDK documentation index and modulesdata/sources/*— UIKit source shards and indexdata/templates/*— template index and shardsdata/knowledge/*— scenario knowledge shardsdata/classes/*— class metadata shardsdata/lexicon/*— lexicon (synonyms/abbr/stopwords) per platformdata/intents/*— intent patterns and rules
scripts/*— shard generation and indexing utilities
graph TD
A[src/server.ts] --> B[SmartAssistService]
A --> C[DocSearch]
A --> D[ShardedSourceSearch]
A --> E[PlatformOrchestrator]
B --> F[IntentClassifier]
B --> G[SmartAssistContext]
B --> H[SmartAssistResponse]
B --> C
B --> D
B --> E
F --> I[IntentRegistry]
G --> J[ContextManager]
H --> K[ResponseBuilder]
K --> L[ResponseComposer]
K --> M[InteractionStrategies]
E --> N[TemplateRegistry]
E --> O[KnowledgeRegistry]
E --> P[CodeGenerator]
P --> Q[TemplateRenderer]
C --> R[SearchPipeline]
D --> R
C --> S[LexiconRegistry]
D --> S
flowchart TD
Q[User Query] --> A[Ambiguity Check]
A -->|Ambiguous| R[SmartAssistResponse - clarification]
A -->|Clear| B[Context Continuity]
B --> C[Platform Detection]
C -->|Missing platform for implementation| R
C -->|Have platform| D[Intent Classification]
D --> E[Entity Extraction]
E --> F[Strategy Branch]
F -->|Error| G[DocSearch.lookupError]
F -->|Custom Message/UI/Menu| H[PlatformOrchestrator + TemplateRegistry]
F -->|Class Explanation| I[KnowledgeGraph + SourceSearch]
F -->|Other| J[Guidance + Tools]
G --> K[ResponseBuilder]
H --> K
I --> K
J --> K
K --> L[ResponseComposer]
L --> M[Tool Response]
- Source:
data/templates/index.json - Shards:
data/templates/shards/*.json - Consumers:
TemplateRegistry,PlatformOrchestrator,CodeGenerator,TemplateRenderer
- Source:
data/knowledge/index.json - Shards:
data/knowledge/shards/*.json - Consumers:
KnowledgeRegistry,PlatformOrchestrator,SmartAssistService
- Source:
data/classes/index.json - Shards:
data/classes/shards/*.json - Consumers:
ClassRegistry,KnowledgeGraph
- Source:
data/sources/index.json - Shards:
data/sources/shards/*.json - Consumers:
ShardedSourceSearch,SourceSearch
- Source:
data/intents/index.json,data/lexicon/index.json - Consumers:
IntentRegistry,IntentClassifier,QueryExpander,SpellCorrector,SearchSuggester
- Platform materials: add to
data/docs,data/sources,data/templates,data/knowledge,data/classes - Templates: add in
data/templates/index.jsonand regenerate shards - Scenarios: add in
data/knowledge/index.jsonand regenerate shards - Intent patterns: update
data/intents/index.json - Lexicon terms: update
data/lexicon/index.json
npm run build— TypeScript compilenpm run generate-template-shards— template shardsnpm run generate-lexicon-shards— lexicon shardsnpm run generate-integration-shards— integration shards
server.tsshould remain a thin router; services handle business logic.ResponseBuilderis now a composer facade; strategy logic lives inInteractionStrategies.SearchPipelinecentralizes query enhancement to keep searches consistent across domains.