Skip to content

Conversation

@terylt
Copy link
Collaborator

@terylt terylt commented Aug 12, 2025

✨ Feature / Enhancement PR

πŸ”— Epic / Issue

Link to the epic or parent issue:
Closes #


πŸš€ Summary (1-2 sentences)

This PR adds support for external plugins to the Context Forge. External plugins are plugins that are backed by a service such as LLMGuard. External plugins communicate with these services through MCP, to do run services on the system.

The MCPGateway now has an ExternalPlugin object, that is configured as follows:

plugins:
  - name: "DenyListPlugin"
    kind: "external"
    mcp:
      proto: STREAMABLEHTTP
      url: http://127.0.0.1:3000/mcp

Where:

  1. name represents the External plugin residing on the MCP server.
  2. kind is "external"
  3. map signifies the type of transport protocol (StreamableHTTP, Stdio, SSE) and url or script (if stdio) of the external plugin.

Note that the external plugin will pull the PluginConfig from the MCP server and use it as a configuration. However, we can override any attribute EXCEPT the config: section of the plugin from the client side. The external plugin first downloads the plugin configuration from the server, merges with the configuration from the client and uses that in the PluginManager to determine things like priority, hook points, etc.

For example, we could set:

plugins:
  - name: "DenyListPlugin"
    kind: "external"
   priority: 100
   hooks: ["pre_prompt_fetch", "post_prompt_fetch"]
    mcp:
      proto: STREAMABLEHTTP
      url: http://127.0.0.1:3000/mcp

and this would use the configuration from the MCP server, but override priority and hooks using the client configurations.

The server side of the code currently resides here: https://github.com/araujof/mcp-context-forge-plugin/blob/feat/mcp_server_code/src/plugins/framework/mcp/server.py and has the following tools:

get_plugin_configs() - return all the plugin configurations from plugins installed in the MCP server.
get_plugin_config(name) - return the plugin config for a specific plugin given a name.
pre_prompt_fetch - pre prompt fetch hook
pos_prompt_fetch - post prompt fetch hook

We will support the other plugin hook points, and plugins will be installed into an MCP server as python packages. We will have a base MCP server image on which plugins can be installed.


πŸ§ͺ Checks

  • make lint passes
  • make test passes
  • CHANGELOG updated (if user-facing)

@araujof araujof added enhancement New feature or request plugins labels Aug 12, 2025
@araujof araujof added this to the Release 0.6.0 milestone Aug 12, 2025
@terylt terylt force-pushed the feat/remote_plugin_support branch from 4e6f728 to 3cde1e8 Compare August 13, 2025 00:02
@terylt terylt force-pushed the feat/remote_plugin_support branch from 3cde1e8 to a447b89 Compare August 13, 2025 00:11
@terylt
Copy link
Collaborator Author

terylt commented Aug 18, 2025

This was merged into the plugin CLI PR (#722) for simplicity as they go hand-in-hand. Closing this as it will be merged into the main code base through that.

@terylt terylt closed this Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request plugins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants