# L7 : mcp\_chatbot.py fails with "No module named 'mcp.server.fastmcp'"

**URL:** <https://community.deeplearning.ai/t/l7-mcp-chatbot-py-fails-with-no-module-named-mcp-server-fastmcp/894529>\
**Category:** MCP: Build Rich-Context AI Apps with Anthropic\
**Created:** [August 11, 2026, 7:35am UTC](https://community.deeplearning.ai/t/l7-mcp-chatbot-py-fails-with-no-module-named-mcp-server-fastmcp/894529 "2026-08-11T07:35:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aravindagn](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/aravindagn/32/161357_2.png) [@aravindagn](https://community.deeplearning.ai/u/aravindagn)\
**Post date:** [August 11, 2026, 7:35am UTC](https://community.deeplearning.ai/t/l7-mcp-chatbot-py-fails-with-no-module-named-mcp-server-fastmcp/894529/1 "2026-08-11T07:35:32Z")

</div>

**The problem**

The course was written for version 1.x of the `mcp` Python package. The project’s `pyproject.toml` doesn’t set an upper limit on that version, so `uv` now installs **mcp 2.0** , which renamed and moved things. The lesson code no longer matches the library.

You’ll see some or all of these:

```auto
Error 'Tool' object has no attribute 'inputSchema'
ModuleNotFoundError: No module named 'mcp.server.fastmcp'
Error connecting to research: Connection closed
ImportError: cannot import name 'McpError' from 'mcp.shared.exceptions'
Error connecting to fetch: Connection closed

```

Three different messages, one cause: mcp 2.0.

**The fix**

Open the terminal in the notebook and run:

```auto
cd ~/work/L7/mcp_project
uv add "mcp>=1.2,<2"

```

The `<2` is the important part — it keeps you on the 1.x version the course expects. You should see it install `mcp==1.29.0`.

The `fetch` server is installed separately by `uvx`, so it needs the same limit.  
Open /L7/mcp\_project/`server_config.json` and change the fetch entry to:

```auto
"fetch": {
  "command": "uvx",
  "args": ["--with", "mcp<2", "mcp-server-fetch"]
}

```

Then clear the old cached copy and run again:

```auto
uv cache clean
uv run mcp_chatbot.py

```

 ![Screenshot 2026-08-11 093025](https://global.discourse-cdn.com/dlai/original/3X/6/a/6a34df2997b62c3e8ba886af73773bb77590f8cd.png)

Cheers !

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [August 11, 2026, 2:32pm UTC](https://community.deeplearning.ai/t/l7-mcp-chatbot-py-fails-with-no-module-named-mcp-server-fastmcp/894529/2 "2026-08-11T14:32:33Z")

</div>

@lesly.zerna, seems like an update is needed.

---

<div class="post-metadata">

**Author:** ![lesly.zerna](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/lesly.zerna/32/47465_2.png) [@lesly.zerna](https://community.deeplearning.ai/u/lesly.zerna)\
**Post date:** [August 11, 2026, 2:47pm UTC](https://community.deeplearning.ai/t/l7-mcp-chatbot-py-fails-with-no-module-named-mcp-server-fastmcp/894529/3 "2026-08-11T14:47:12Z")

</div>

same as here [Code fix for Error Code 400 in labs](https://community.deeplearning.ai/t/code-fix-for-error-code-400-in-labs/894175)

---

<div class="post-metadata">

**Author:** ![lesly.zerna](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/lesly.zerna/32/47465_2.png) [@lesly.zerna](https://community.deeplearning.ai/u/lesly.zerna)\
**Post date:** [August 11, 2026, 9:34pm UTC](https://community.deeplearning.ai/t/l7-mcp-chatbot-py-fails-with-no-module-named-mcp-server-fastmcp/894529/4 "2026-08-11T21:34:14Z")

</div>

Hi @aravindagn thank you for reporting! I replicated and shared with the team, thanks for sharing a solution!

We’ll be updating this course during these days!

---

<div class="post-metadata">

**Author:** ![lesly.zerna](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/lesly.zerna/32/47465_2.png) [@lesly.zerna](https://community.deeplearning.ai/u/lesly.zerna)\
**Post date:** [August 12, 2026, 5:24pm UTC](https://community.deeplearning.ai/t/l7-mcp-chatbot-py-fails-with-no-module-named-mcp-server-fastmcp/894529/5 "2026-08-12T17:24:13Z")

</div>

updates are ready to deploy, let’s wait news soon!  
And indeed, there has been a major update in mcp, check [here](https://blog.modelcontextprotocol.io/posts/2026-07-28/).

Lesly - DLAI

---

<div class="post-metadata">

**Author:** ![lesly.zerna](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/lesly.zerna/32/47465_2.png) [@lesly.zerna](https://community.deeplearning.ai/u/lesly.zerna)\
**Post date:** [August 13, 2026, 4:48pm UTC](https://community.deeplearning.ai/t/l7-mcp-chatbot-py-fails-with-no-module-named-mcp-server-fastmcp/894529/6 "2026-08-13T16:48:22Z")

</div>

L7 now is working as expected! Thank you everyone for their reports, suggestions and patience!

**Quick status:** the errors you’ve been hitting (`mcp.server.fastmcp` import errors, `McpError` import errors, `tool_use`/`tool_result` mismatches) are due to a breaking update released by [MCP on 2026-07-28](https://blog.modelcontextprotocol.io/posts/2026-07-28/), which changed parts of the SDK the course was originally built against. This isn’t something on your end, the environment genuinely needs a few extra steps beyond what’s shown in the videos to keep working with today’s package versions.

We’ve pushed markdown notes to this notebook with the exact commands needed to get things running again. Please check those notebooks for the updated instructions.

 ![Screenshot 2026-08-13 at 12.42.48 PM](https://global.discourse-cdn.com/dlai/original/3X/a/0/a05d145872c3fd1b539185f415d5c69c5c104ddc.jpeg)

Happy Learning!

Lesly - DLAI

---

<div class="post-metadata">

**Author:** ![lesly.zerna](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/lesly.zerna/32/47465_2.png) [@lesly.zerna](https://community.deeplearning.ai/u/lesly.zerna)\
**Post date:** [August 13, 2026, 4:48pm UTC](https://community.deeplearning.ai/t/l7-mcp-chatbot-py-fails-with-no-module-named-mcp-server-fastmcp/894529/7 "2026-08-13T16:48:34Z")

</div>


