anthropics / anthropics/skills

mcp-builder: requirements.txt allows mcp>=2, where connections.py fails at import (streamablehttp_client renamed)

オープン 初心者向け
#1,668 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
176k
フォーク
20.9k
平均マージ
7時間 21分
マージ済み PR(30日)
5

説明

## Summary

`skills/mcp-builder/scripts/requirements.txt` pins `mcp>=1.1.0` with no upper bound. The MCP Python SDK is now at 2.x, where `streamablehttp_client` has been **renamed** to `streamable_http_client`. `connections.py` imports the old name at module scope, so a fresh install of the documented requirements fails at import — before any MCP server, evaluation file, or API key is involved.

This is the first thing anyone following the Phase-4 instructions hits today.

## Repro

```bash
python -m venv .venv
.venv/bin/pip install -r skills/mcp-builder/scripts/requirements.txt # resolves mcp 2.x
.venv/bin/python skills/mcp-builder/scripts/evaluation.py -t stdio -c node -a server.js eval.xml
```

```
Traceback (most recent call last):
File ".../scripts/evaluation.py", line 19, in
from connections import create_connection
File ".../scripts/connections.py", line 10, in
from mcp.client.streamable_http import streamablehttp_client
ImportError: cannot import name 'streamablehttp_client' from 'mcp.client.streamable_http'
```

Confirmed on `mcp` 2.1.1:

```python
>>> import mcp.client.streamable_http as s
>>> [n for n in dir(s) if 'client' in n.lower()]
['ClientMessageMetadata', 'create_mcp_http_client', 'streamable_http_client']
```

## Fix

Either cap the requirement:

```
mcp>=1.1.0,<2
```

or support both names in `connections.py`:

```python
try:
from mcp.client.streamable_http import streamable_http_client
except ImportError: # mcp < 2
from mcp.client.streamable_http import streamablehttp_client as streamable_http_client
```

The second is preferable — pinning `<2` in a shared environment holds back anything else on the machine using the SDK, which pushes users toward a throwaway venv for what should be a two-line install.

## Environment

- Windows 11, Python 3.13.14
- `mcp` 2.1.1 (fails), 1.29.1 (works)
- `anthropic` 1.0.0

## Context

Found while running the Phase-4 evaluation against a stdio MCP server exposing 66 tools. It was one of several independent failures between "follow the skill's instructions" and "get a score"; the others are #1390, #1386, and the report-write bug filed alongside this one. Happy to send a PR for whichever fix you prefer.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start with skills/mcp-builder/scripts/requirements.txt and skills/mcp-builder/scripts/connections.py, then run the documented virtualenv installation and evaluation.py command. Verify that importing connections succeeds with mcp 2.1.1 while preserving compatibility with mcp 1.29.1, and confirm the Phase-4 evaluation can proceed past startup.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
tooling
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
85/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。