Skip to main content

kestrel-feature-mcp

Model Context Protocol (MCP) server management and tool bridging for Kestrel Sovereign. Provides unified access to 311+ MCP servers via Docker MCP Toolkit, direct container management for custom servers, and a searchable catalog of available tools.

Installation

uv pip install kestrel-feature-mcp

Dependencies

  • kestrel-sovereign-sdk
  • docker>=7.1.0
  • mcp>=2.3,<3
  • httpx2>=2.10
  • requests>=2.34.2
  • anyio>=4.7,<5
  • pydantic>=2.12,<3

Usage

Once installed, the MCPAgent feature is automatically discovered by kestrel-sovereign via the kestrel_sovereign.features entry point.

Commands

  • !mcp-gateway-start <servers> — Start Docker MCP Gateway
  • !mcp-gateway-stop — Stop gateway
  • !mcp-load <image> — Load MCP server from Docker image
  • !mcp-unload <container> — Unload a container and remove its saved connection
  • !mcp-list — List running MCP servers
  • !mcp-search <query> — Search MCP catalog
  • !mcp-catalog — List all available servers

Calling tools

Discovered server tools are mounted in the host's dynamic registry. Invoke the advertised handle through Kestrel's governed tool dispatch; its exact owner and handle determine permissions, approvals and audit records. The generic mcp_call_tool / mcp_gateway_call tools and their command aliases have been removed: allowing a generic dispatcher could otherwise bypass a DENY on its target. A host without the dynamic registry cannot mount MCP tools.

Each handle is bound to the connection that advertised its schema. Reloading or withdrawing that connection invalidates its old handles, including a call still waiting for approval. A fresh handle and approval are required after reload.

Configuration

Variable Description
DOCKER_HOST Docker daemon socket (optional, defaults to local)

Development

uv pip install kestrel-sovereign-sdk && uv pip install -e ".[test]"
uv run pytest

Native MCP protocol

Version 0.5 uses the official MCP 2.x Client over Streamable HTTP. Its standard version negotiation selects 2026-07-28 with modern servers and a mutually supported published revision with other servers. Tool listings expose the selected protocol_version. Container servers must expose MCP at /mcp; the standalone HTTP+SSE transport and gateway transport="sse" selection have been removed. Docker MCP Gateway 0.44.1 negotiates 2025-11-25; its lack of the newer revision is tracked in Kestrel #3683. Features requiring newer capabilities must check the negotiated connection. Gateway server lists describe requested configuration; observed tools do not prove readiness of every requested server. Tool discovery follows pagination and fails on repeated cursors. Negotiation uses the connection deadline, then discovery uses the whole-call deadline. Cancelled startup joins its transport owner before returning. Shutdown has its own graceful deadline (KESTREL_MCP_CLOSE_TIMEOUT, default 15 seconds), including session termination and partially completed SDK entry. Forced cleanup gets one further budget of the same length. The owner timer survives caller cancellation; failures propagate and any unfinished owner is retained for a cleanup retry.

Upgrade the MCP feature before upgrading a host with the Phoenix 20/Pydantic AI 2 dependency set. Feature 0.4's mcp<2 requirement cannot resolve with that set. The host dependency lock must be regenerated and verified as part of the same rollout (Kestrel Sovereign epic #3679).

Container identities bind the agent DID and image, with Docker's implicit :latest tag made explicit by the same planner used for routing and unload. Catalog names resolve to their container image through the load route. New managers require owner_did; they reuse a process only when its ownership and image labels match. Each agent can reload or unload its own server independently. MCP container ports bind only to host loopback. Listings retain failed containers' identifiers so they can be unloaded even when no tools were published. Saved container entries using the former global identifiers require explicit removal with !mcp-unload <old-identifier> and reconnection with !mcp-load <image>. The current unload result does not distinguish saved-configuration removal from live-process removal; outcome reporting is tracked in #26. Shut down the old feature before upgrading to release the processes it owns. Hosts expose their agent DID through agent_id. Missing required Python dependencies, invalid identities and unexpected initialization failures stop startup. An unavailable local Docker daemon disables local Docker operations; it is handled separately from an invalid installation. This includes Docker SDK errors and its Requests transport failures during connection or ping. Other implementation errors still fail startup. Saved container connections retain their container mode when restored, even if the Docker catalog changes. Server selectors and image references reject surrounding whitespace before routing.

Container creation is recorded before Docker starts the process, so a rejected command still leaves an identifiable resource that unload can reclaim. Resource configuration transitions are serialized per container; a slow load does not block another container's unload. Model-facing handles use the image reference, while resource ownership keeps the full DID-bound identifier. Ordinary MCP tool calls remain concurrent and hold no configuration lock.

Docker catalog discovery uses the current OCI catalog JSON API. Set KESTREL_MCP_DOCKER_CATALOG to select a catalog reference (default mcp/docker-mcp-catalog). Missing metadata is pulled into Docker's cache; unreadable catalogs return an error. Catalog counts describe available definitions, while gateway status reports this process's requested configuration and observed tools.

The installation CI matrix also runs the production connection through the official MCP conformance harness, pinned to 0.2.0-alpha.12 with an npm integrity lock. It runs tools_call and request-metadata explicitly at 2026-07-28, with no expected-failure baseline. These checks cover native tool exchange, wire schemas, per-request metadata and version negotiation retry. Optional client capabilities that Kestrel does not advertise are reported as skipped by the official scenario. The OAuth, input request and extension scenarios remain outside this initial CI profile; passing these two scenarios does not establish full client conformance (epic #3679 A7).

To run the same profile locally with Python test dependencies and Node 24+:

npm ci --prefix tests/conformance --ignore-scripts --no-audit --no-fund
for scenario in tools_call request-metadata; do
  tests/conformance/node_modules/.bin/conformance client \
    --command '.venv/bin/python tests/conformance/client.py' \
    --scenario "$scenario" --spec-version 2026-07-28 --timeout 60000 \
    --output-dir "tests/conformance/results/$scenario" || exit $?
done

Update the pinned harness and lock together, rerun both scenarios, and review new required scenarios as the remaining host capabilities land.

Metadata

Release files for kestrel-feature-mcp 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kestrel-feature-mcp 0.5.0
File Size Uploaded Provenance
kestrel_feature_mcp-0.5.0.tar.gz 163.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for kestrel-feature-mcp 0.5.0
File Interpreter ABI Platform
kestrel_feature_mcp-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 210.8 kB

Release files / kestrel_feature_mcp-0.5.0.tar.gz

Download URL kestrel_feature_mcp-0.5.0.tar.gz
Size 163.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d8d514792249168eb73e48d5dc688d67a5233638dc6d64a56e558c9d2a6ce15c
BLAKE2b-256 checksum
How to use checksums
83689ba0ce1c75086f363ec2e8bb0522c23566a7a8c2fe7d651e2e7df2468699
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / kestrel_feature_mcp-0.5.0-py3-none-any.whl

Download URL kestrel_feature_mcp-0.5.0-py3-none-any.whl
Size 47.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db5ea77d9bf649059923d284cc24b0256897ac96e1ce62efd1a0018c24bcc76f
BLAKE2b-256 checksum
How to use checksums
edbc5f2d03c7f6827c551870ef86ff0585c1ff9be84cb234ad2aa01bb5f53e8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Security for kestrel-feature-mcp 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kestrel_feature_mcp-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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