Building a Minimal Tool-Calling Agent with Local Qwen
A Juejin author documents building an MCP server on macOS and connecting it to a local Qwen2.5 3B model through Ollama. The implementation exposes read_file, search_in_file, and get_weather tools, then uses a client-side ReAct loop to let the model request tools and incorporate their results. The author also records setup and debugging issues involving Python 3.12, MCP SDK 1.30.0, stdio transport, and MCP Inspector.
The article provides a concrete, code-level reference for connecting an MCP server to a locally hosted model and running a minimal tool-calling loop.
古法编程,代码是自己写的,哪怕说成CV工程师,也对业务、代码逻辑理解比较透彻,而现在说AI coding,我要怎么办?所以,我决定手搓MCP。
手搓 MCP 到最简 Agent,我都做了什么?
一次从零开始的实践记录:在 Mac 上手搓 MCP Server、接入本地千问 2.5 3B,最终跑通一个能自主调用工具的最简 Agent。
第一步:搭环境,先踩了三个坑
坑 1:Python 版本太旧
Mac 自带 Python 3.9.6,而 MCP SDK 要求 3.10+。第一次 uv add "mcp[cli]" 直接报错:
#Qwen2.5 3B#Model Context Protocol#Ollama#FastMCP#MCP Inspector