一个简单明了的例子,用于实现和理解Anthropic MCP(在AWS Bedrock上)。
<a href="https://glama.ai/mcp/servers/cuhom1oc17"> <img width="380" height="200" src="https://gips1.baidu.com/it/u=3455584315,1795604871&fm=3081&app=3081&f=PNG?w=760&h=400" /> </a>对于多个MCP服务器的管理,可以参考这个小型项目Q-2001~
本项目展示了如何实现并使用Anthropic的模型上下文协议(MCP)与AWS Bedrock。它提供了一个客户端实现,可以通过AWS Bedrock的运行时服务与支持MCP的工具进行交互。
fetch_url_mcp_server.py,展示不同的传输类型使用默认stdio设置运行服务器(无需传输参数):
uv run fetch_url_mcp_server.py
# 客户端
uv run client_stdio.py
使用默认端口(8000)上的可流式传输HTTP传输运行:
python fetch_url_mcp_server.py --transport streamable-http
# 客户端
uv run client_streamablehttp.py
使用自定义端口上的可流式传输HTTP传输运行:
python fetch_url_mcp_server.py --transport streamable-http --port 8080
欢迎提交问题和拉取请求以改进实现。
MIT许可证