Skip to content

feat: FastMCP-only server, ready for SEP-1686 background tasks - #64

Open
SkyeAv wants to merge 3 commits into
mainfrom
chore/fastmcp-background-tasks
Open

SkyeAv wants to merge 3 commits into
mainfrom
chore/fastmcp-background-tasks

Conversation

@SkyeAv

@SkyeAv SkyeAv commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

First of three stacked PRs for ARS querying (this PR, then #65, then #66). This one updates the MCP server dependency and cleans up the adapter so the last PR can expose long-running ARS queries as protocol-native background tasks.

What changed

  • fastmcp bumped from 2.12.2 to the 2.14 line (>=2.14.7, <3). 2.14 implements the MCP background task protocol (SEP-1686); 2.12 predates it.
  • TCT/interfaces/mcp.py no longer imports the mcp package directly. Tool errors raise fastmcp.exceptions.ToolError, which FastMCP turns into a tool error result, and middleware typing uses fastmcp's own context types. The mcp package is still installed as a fastmcp dependency, but nothing in TCT imports it, and the existing test that runs the tool surface without MCP dependencies now also rejects direct mcp imports.
  • All shared tools get MCP tool annotations (readOnlyHint, openWorldHint) so clients can tell which tools only read data.
  • Tool names, signatures, schemas, and the unstructured output contract are unchanged; tests/test_mcp_contract.py passes without edits. TCT/server.py compatibility imports are unaffected.
  • Verified in tests that an async task=True tool on a FastMCP instance registers task metadata and completes through task retrieval, and that the Progress dependency works in ordinary tools.
  • Not in this PR: FastMCP 3.x/4.x migration, structured outputs, tags/icons, Redis task backend, HTTP transport.

Verification

  • uv run pytest: 123 passed, 1 skipped (live tests gated). Includes the MCP contract tests.
  • Two in-process fastmcp.Client smokes against live Translator services (name_lookup resolved asthma to MONDO:0004979, normalize_nodes returned the normalized node), both green on separate runs.
  • Background-task smoke: call_tool(..., task=True) returns a task, task.result() carries the payload, get_task_status reports completed.

Stats (for audit)

  • 3 commits, 4 files, +1116/-169 (most of the additions are the regenerated uv.lock).
  • Offline suite: 123 passed, 1 skipped.
  • Live smokes: 2 of 2 green (name_lookup, normalize_nodes through an in-process fastmcp.Client).

@SkyeAv SkyeAv self-assigned this Sep 30, 2026
@SkyeAv
SkyeAv requested a review from yjzhang September 30, 2026 18:10
@SkyeAv
SkyeAv added this pull request to stack #67 October 2, 2026 17:28

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant