# Plugins 與 MCP

> 透過 agent-plugins.org 格式的便攜式 plugins 與技能，以及您自己的 MCP servers（經由 Streamable HTTP 或 SSE），擴充 Enterprise agents。

Enterprise 透過 **Agent Plugins** 擴充 [agents](https://pentagi.com/zh-tw/docs/glossary/#agent) 的功能，這些套件採用開放的 [agent-plugins.org](https://agent-plugins.org/specification) 格式，包含技能、[MCP server](https://pentagi.com/zh-tw/docs/glossary/#mcp-server) 宣告及 PentAGI 專用 [agent profiles](https://pentagi.com/zh-tw/docs/glossary/#agent-profile)。

```text
my-plugin/
├── plugin.json      manifest (required)
├── skills/          Agent Skills
├── mcp.json         MCP server declarations
└── com.pentagi/     requirements and agent profiles
```

## [漸進式揭露](https://pentagi.com/zh-tw/docs/enterprise/plugins-and-mcp/#progressive-disclosure)

planner 僅能看到每個 [plugin](https://pentagi.com/zh-tw/docs/glossary/#plugin) 的名稱、簡短說明、其技能名稱以及所需的 MCP server。當 planner 選取 plugins 後，其技能會加入工作 agent 的提示詞中，其 MCP 函式則成為 agent 的工具——每個 [subtask](https://pentagi.com/zh-tw/docs/glossary/#subtask) 最多 20 個——而指令碼與參考資料則在容器內依需求讀取，因此即使 catalog 龐大，在選取 plugin 之前幾乎不會產生任何開銷。

## [MCP servers](https://pentagi.com/zh-tw/docs/enterprise/plugins-and-mcp/#mcp-servers)

![設定中的 MCP servers](https://pentagi.com/images/product/ee-mcp-servers.webp)

MCP servers 可在 **Settings → MCP Servers** 中透過 Streamable HTTP 或舊版 HTTP+SSE 進行連線。僅支援 `stdio` 的伺服器必須在您網路上的 MCP 閘道後方執行；PentAGI 絕不會在其 [sandbox](https://pentagi.com/zh-tw/docs/glossary/#sandbox) 之外啟動 plugin 提供的可執行檔。

除非 `MCP_ALLOWED_EGRESS_CIDRS` 列出該範圍，否則 PentAGI 會拒絕位於私有、環回、鏈路本地和中繼資料位址上的 MCP 端點，因此對於您網路上的閘道，請設定其前綴，例如 `10.8.0.0/24`。純 HTTP 僅接受用於 `localhost`、環回位址和 `host.docker.internal`。

新伺服器在 **Availability** 下切換為 **On** 之前會保持關閉狀態：管理員可設定 **Default for users**，而每位使用者均可在 **My state** 下覆寫此設定。agent 透過綁定其功能的 plugin 存取伺服器，或在您啟用 **Offer without a plugin** 並選取功能（**Allow direct use**）後直接存取。

憑證為唯寫：您在新增伺服器時輸入，之後可以更換或撤銷 — 撤銷也會將伺服器關閉 — 且 API 絕不會將其返回。它們使用 `MCP_CREDENTIALS_ENCRYPTION_KEY`（64 個十六進位字元；安裝程式會產生一個）進行加密。請備份此金鑰：一旦儲存了憑證，若沒有它，PentAGI 將無法啟動。

## [Plugins](https://pentagi.com/zh-tw/docs/enterprise/plugins-and-mcp/#plugins)

![設定中的 plugins](https://pentagi.com/images/product/ee-plugins.webp)

在 **Settings → Plugins** 中，您可以透過 **New plugin** 或 **Import package**（`.tar.gz` 檔案）來新增 plugin；匯入的套件會以草稿形式存在，只有在您發布後才會提供使用。放置在 `PLUGINS_DIR`（容器內的 `/opt/pentagi/plugins`）的套件，會在執行 **Reload registry** 後顯示於 **Bundled runtime plugins** 之下。

只有當 plugins 所需的 MCP servers 已安裝並啟用時，planner agents 才能使用該 plugin。管理員為每個 plugin 設定 **Default for users** — **On**、**Default** 或 **Off** — 而每位使用者可在 **My state**（針對捆綁的 plugins）或 **My override**（針對其他 plugins）下覆寫此設定。**Default** 遵循 `PLUGINS_ENABLEMENT_MODE`：`auto`（預設值）會提供所有 MCP servers 就緒的 plugin，而 `manual` 僅在 plugin 切換為 **On** 時才提供。