OpenPlugin is a vendor-agnostic plugin framework that allows you to:
- Load and manage plugins with standardized structure
- Execute plugin commands and agents using any LLM provider
- Integrate with MCP (Model Context Protocol) servers
- Build extensible AI applications
The PluginManager is the central component that:
- Discovers and loads plugins from directories
- Manages plugin lifecycle
- Coordinates command/agent execution
- Handles MCP client connections
The Plugin class represents a loaded plugin:
- Parses plugin manifest (
plugin.json) - Loads commands, agents, and skills
- Manages MCP configuration
- Provides access to plugin resources
Providers implement the LLMProvider interface:
OpenAIProvider: OpenAI GPT models- Future:
AnthropicProvider,GoogleProvider, etc. - Custom providers can be implemented
MCP (Model Context Protocol) integration:
MCPClient: Communicates with MCP servers- Supports stdio transport
- Tool discovery and execution
- Automatic tool conversion for providers
User Input
↓
PluginManager.execute_command()
↓
Plugin.get_command() → Command Content
↓
MCPClient.list_tools() → Available Tools
↓
Provider.execute_command() → LLM API Call
↓
Response with Tool Calls (if any)
↓
MCPClient.call_tool() → Tool Execution
↓
Final Response
Plugins are discovered by:
- Scanning the plugins directory
- Looking for
.claude-plugin/plugin.jsonfiles - Validating plugin structure
- Loading plugin resources
MCP servers are configured in .mcp.json:
- Each server has a command and arguments
- Servers run as subprocesses
- Communication via JSON-RPC 2.0 over stdio
- Tools are automatically discovered and made available
The LLMProvider interface abstracts LLM differences:
- Standardized command/agent execution
- Tool/function calling support
- Message format conversion
- Provider-specific optimizations
- Implement
LLMProviderinterface - Convert MCP tools to provider format
- Handle provider-specific features
- Register in
providers/__init__.py
- Extend
Pluginclass - Add resource loading methods
- Update
PluginManagerto use new features - Document in plugin structure guide
- HTTP/SSE transport for MCP servers
- Plugin registry and discovery
- Plugin versioning and updates
- Plugin dependencies resolution
- Caching and optimization
- Multi-provider fallback
- Plugin marketplace integration