Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,24 @@ jobs:
python -m pip install --quiet pytest
python -m pip install --quiet -e .
python -m pytest tests/ -q

mcp-python:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mcp:
- 'mcp==1.2.0'
# Deliberately tracks the latest compatible 1.x as an early warning.
- 'mcp>=1.2,<2'
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
- name: stdio handshake
run: >-
uv run --isolated --no-project
--with-editable ./sdk/mcp
--with anyio
--with pytest
--with '${{ matrix.mcp }}'
pytest -q sdk/mcp/tests/test_stdio.py
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ Versioning](https://semver.org/spec/v2.0.0.html) once it reaches

## Unreleased

### MCP compatibility

Constrain `forkd-mcp` to MCP `>=1.2,<2`: its FastMCP import is unavailable
in older 1.x releases and was removed in MCP 2.x. CI now verifies the stdio
initialize handshake and all registered tools against MCP 1.2.0 and the
latest compatible 1.x release. Closes #275.

## v0.5.3 - 2026-07-22

### KSM / memfd release catch-up
Expand Down
4 changes: 2 additions & 2 deletions sdk/mcp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "forkd-mcp"
version = "0.2.0"
version = "0.2.1"
description = "Model Context Protocol server for forkd microVM sandboxes (BRANCH, diff snapshots, prewarm)"
readme = "README.md"
authors = [{name = "Deeplethe", email = "info@deeplethe.com"}]
Expand All @@ -21,7 +21,7 @@ classifiers = [
"Topic :: Software Development :: Libraries",
]
dependencies = [
"mcp>=1.0",
"mcp>=1.2,<2",
"httpx>=0.27",
]

Expand Down
38 changes: 38 additions & 0 deletions sdk/mcp/tests/test_stdio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import sys

import anyio
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client

EXPECTED_TOOLS = {
"branch_sandbox",
"create_snapshot",
"eval_code",
"exec_command",
"get_sandbox",
"kill_sandbox",
"list_sandboxes",
"list_snapshots",
"ping_sandbox",
"spawn_sandboxes",
"wait_for_text",
}


def test_stdio_initialize_and_tool_registration() -> None:
async def scenario() -> None:
params = StdioServerParameters(
command=sys.executable,
args=["-m", "forkd_mcp.server"],
)
with anyio.fail_after(10):
async with stdio_client(params) as (read_stream, write_stream):
async with ClientSession(read_stream, write_stream) as session:
result = await session.initialize()
tools = await session.list_tools()

assert result.serverInfo.name == "forkd"
assert len(tools.tools) == len(EXPECTED_TOOLS)
assert {tool.name for tool in tools.tools} == EXPECTED_TOOLS

anyio.run(scenario)
Loading