Coverage for mcpgateway / plugins / framework / external / __init__.py: 71%
7 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-09 03:05 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-09 03:05 +0000
1# -*- coding: utf-8 -*-
2"""Location: ./mcpgateway/plugins/framework/external/__init__.py
3Copyright 2025
4SPDX-License-Identifier: Apache-2.0
5Authors: Teryl Taylor
7External plugin which connects to a remote server.
8Module that contains plugin client/server code to serve external plugins.
10This package supports two transport mechanisms:
11- MCP (Model Context Protocol): HTTP/SSE-based transport (default)
12- gRPC: Binary protocol for higher performance
14Usage:
15 MCP Transport:
16 ```yaml
17 plugins:
18 - name: "MyPlugin"
19 kind: "external"
20 mcp:
21 proto: "STREAMABLEHTTP"
22 url: "http://localhost:8000/mcp"
23 ```
25 gRPC Transport:
26 ```yaml
27 plugins:
28 - name: "MyPlugin"
29 kind: "external"
30 grpc:
31 target: "localhost:50051"
32 ```
33"""
35# MCP transport exports (always available)
36from mcpgateway.plugins.framework.external.mcp.client import ExternalHookRef, ExternalPlugin
38__all__ = ["ExternalPlugin", "ExternalHookRef"]
40# gRPC transport exports (optional - requires grpc extras)
41try:
42 from mcpgateway.plugins.framework.external.grpc import GrpcExternalPlugin # noqa: E402, F401
44 __all__.extend(["GrpcExternalPlugin"])
45except ImportError:
46 # grpc extras not installed
47 pass