Skip to main content

Plugin System: RunMCP, OpenAPI, API-first

The RunMCP plugin system lets you add new features, integrations, and custom logic to your gateway without modifying core code.

Plugin Patterns

  • Authentication plugins: Add OAuth, API key, or custom auth
  • Logging and monitoring: Integrate with observability tools
  • Custom routing: Add new routing rules or traffic shaping
  • Hooks and middleware: Run code before/after requests
tip

Design plugins to be stateless and configurable for maximum reusability.

Example: Registering a Plugin (YAML)

plugins:
- name: auth-oauth2
type: authentication
config:
clientId: "..."
clientSecret: "..."
- name: logging
type: logging
config:
provider: datadog

Example: Plugin Hook (JS)

// Pseudocode for a plugin hook
gateway.on('beforeRequest', (req, res, next) => {
// Custom logic here
next();
});
caution

Test plugins in a staging environment before deploying to production. Misconfigured plugins can impact all traffic.

Best Practices

  • Document plugin APIs and configuration
  • Use versioning for plugins
  • Monitor plugin performance and errors

Further Reading