Skip to main content

mcp-plugin

Standalone MCP gateway — persistent connections to external MCP servers, with a CLI to configure and test them. Ships with Slife as its built-in MCP plugin but has no dependency on it. Depends only on fastmcp, mcp, httpx, json5, and credstore (for OAuth token storage).

Install

pip install mcp-plugin
# or bundled with Slife:
uv tool install git+https://github.com/juzcn/slife.git

Verify: mcp-plugin

Config

Server definitions live in mcp-plugin.json5, located by precedence:

  1. MCP_PLUGIN_FILE=<path> (env var — Slife exports this to the same directory as slife.json5 when it launches the plugin)
  2. ./mcp-plugin.json5 (dev — when the current directory is the Slife source root, i.e. its pyproject.toml has project.name == "slife")
  3. ~/.mcp-plugin/mcp-plugin.json5 (default, standalone use)

This is the same resolution credstore uses for its credentials.crypt.

Keys in env and auth.client_id/client_secret support these references, resolved in order shell env → credstore → literal:

// mcp-plugin.json5
{
  servers: {
    filesystem: {
      enabled: false,                  // optional; absent = enabled
      command: "npx",
      args: [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "."
      ],
    },
    github: {
      command: "npx",
      args: [
        "-y",
        "anyapi-mcp-server",
        "--name", "github",
        "--spec", "https://api.github.com/github-raml",
        "--base-url", "https://api.github.com",
        "--header", "Authorization: Bearer ${GITHUB_TOKEN}",
      ],
    },
    remote: {
      url: "https://example.com/mcp",
      headers: { Authorization: "Bearer ${REMOTE_TOKEN}" },
      auth: { type: "oauth", client_id: "${OAUTH_CLIENT_ID}" },
    },
  },
}

CLI

Command Description
mcp-plugin Overview of configured servers
mcp-plugin set <server> Interactive add/configure a server
mcp-plugin remove <server> Remove a server from config (takes effect at next server start)
mcp-plugin test [--port N] Start the real plugin server and verify it serves MCP; show the auto-connected servers
mcp-plugin test mcp <server> Bare-connect to one server (no framework) + list its tools

set accepts --transport stdio|http, --command, --url, --args, --env (KEY=VALUE), --enabled/--no-enabled, and --auth oauth prompts.

Testing

mcp-plugin test verifies the plugin itself end-to-end: it spawns the real plugin server (python -m mcp_plugin.server — the same entry Slife launches), reads its {"port": N} ready signal, connects over Streamable HTTP, checks the management tools are served, and reports the external servers the plugin auto-connected. --port N pins the server's port instead of auto-assigning.

mcp-plugin test mcp <server> is the opposite check — it bare-connects to one external MCP server using the raw mcp SDK (no plugin framework), confirms it speaks MCP, and lists its tools.

Plugin contract

An MCP-plugin distribution exposes a module that hosts its own FastMCP server (transport: streamable HTTP on an auto-assigned port, port signaled to stdout as {"port": N}). Slife discovers it via plugins.external in slife.json5 and spawns python -m <module>. The management tools (mcp_set, mcp_remove, mcp_set_enabled, mcp_list, mcp_list_tools, __mcp_call_tool, __mcp_connection_status) are kept separate from the servers they manage.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_plugin-0.1.1.tar.gz (75.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_plugin-0.1.1-py3-none-any.whl (62.9 kB view details)

Uploaded Python 3

File details

Details for the file mcp_plugin-0.1.1.tar.gz.

File metadata

  • Download URL: mcp_plugin-0.1.1.tar.gz
  • Upload date:
  • Size: 75.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.15

File hashes

Hashes for mcp_plugin-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a915325e3d26808f6e4a44f0083859229733e1032777888870efd2f270419ffa
MD5 1b0079079117cd4e2c5998cfff3d0805
BLAKE2b-256 192258380bda00a514ff2fe0f910f450240691c69e92db902908d8daca2642f5

See more details on using hashes here.

File details

Details for the file mcp_plugin-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mcp_plugin-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 62.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.15

File hashes

Hashes for mcp_plugin-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a98f7fad9ce13270f06d451a08cd51bf075596ac3e60200f5eebd3265e51c56
MD5 46beaff7b4a6d1256ac38d75fc753926
BLAKE2b-256 e299a4d2fea7b8336f793b34c04a395ad01cf3229b38b87e275a3e794f1d7aa5

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

This release

0.1.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page