@startuml plugin_system_actual
!define COMPONENT_INTERFACE <<Component Interface>>
!define ABSTRACT <<abstract>>
!define NOT_IMPLEMENTED <<Not Implemented>>
!includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml
title Plugin System - Code Level (Actual Implementation)
package "mcp_server.plugin_base" <<Component>> {
' ========================================
' ACTUAL Implementation
' ========================================
abstract class IPlugin <<ABC>> #LightGreen {
+lang: str
--
+{abstract} supports(path: str | Path) -> bool
+{abstract} indexFile(path: str | Path, content: str) -> IndexShard
+{abstract} getDefinition(symbol: str) -> SymbolDef | None
+{abstract} findReferences(symbol: str) -> Iterable[Reference]
+{abstract} search(query: str, opts: SearchOpts | None) -> Iterable[SearchResult]
}
' ========================================
' Data Types (TypedDict and dataclass)
' ========================================
class IndexShard <<TypedDict>> #LightGreen {
+file: str
+symbols: List[Dict]
+language: str
}
class SymbolDef <<TypedDict>> #LightGreen {
+name: str
+kind: str
+file: str
+line: int
+character: int
+docstring: str | None
+parent: str | None
}
class SearchResult <<TypedDict>> #LightGreen {
+file: str
+line: int
+snippet: str
+score: float | None
}
class SearchOpts <<TypedDict>> #LightGreen {
+semantic: bool
+limit: int
}
class Reference <<dataclass>> #LightGreen {
+file: str
+line: int
<<frozen>>
}
' ========================================
' TreeSitter Wrapper (Utility)
' ========================================
package "mcp_server.utils" {
class TreeSitterWrapper #LightGreen {
-parser: Parser
-language: Language
--
+__init__(language: str)
+parse(content: str) -> Tree
+extract_symbols(tree: Tree, source: str) -> List[Symbol]
+get_node_text(node: Node, source: str) -> str
+walk_tree(node: Node, callback: Callable) -> None
}
}
' ========================================
' What's Actually Implemented
' ========================================
note right of IPlugin #LightGreen
IMPLEMENTED:
- Abstract base class (ABC)
- Core plugin interface
- Type definitions
- Basic data structures
end note
note right of TreeSitterWrapper #LightGreen
IMPLEMENTED:
- Python parser support
- Symbol extraction
- Tree traversal
- Text extraction
end note
' ========================================
' What's Missing
' ========================================
note bottom of IPlugin #FF6B6B
NOT IMPLEMENTED:
- No Plugin Registry component
- No Plugin Manager component
- No Plugin Loader component
- No dynamic plugin discovery
- No lifecycle management
- No per-plugin configuration
- No plugin isolation/sandboxing
- No plugin versioning
- No dependency management
- Hardcoded plugin list in gateway
end note
' ========================================
' Relationships
' ========================================
IPlugin ..> IndexShard : returns
IPlugin ..> SymbolDef : returns
IPlugin ..> SearchResult : yields
IPlugin ..> Reference : yields
IPlugin --> SearchOpts : uses
TreeSitterWrapper <.. IPlugin : used by implementations
}
' ========================================
' Implementation Status Legend
' ========================================
legend right
|<#90EE90>| Implemented |
|<#FFD700>| Partially Implemented |
|<#FFA500>| Stub Only |
|<#FF6B6B>| Not Implemented |
endlegend
@enduml