MCP Sandbox
概述
内容详情
替代品
什么是 MCP 工具服务器?
MCP 工具服务器是一个集成了多种人工智能工具的服务平台,基于 Model Context Protocol 标准构建。它允许用户通过统一的接口访问各种功能,包括代码执行、化学化合物查询、网络搜索、数据分析等。服务器支持本地工具部署和远程工具连接,为开发者提供灵活的工具集成方案。如何使用 MCP 工具服务器?
用户可以通过两种主要方式使用该服务:1) 通过内置的 Agent 框架调用工具,2) 通过 HTTP API 直接执行代码。服务器支持会话管理,每个会话都有独立的执行环境,可以保持状态和变量。适用场景
适用于需要集成多种AI工具的应用场景,如科研数据分析、化学信息查询、网络信息检索、自动化任务处理等。特别适合需要组合使用多个工具完成复杂任务的场景。主要功能
本地工具集成
支持在本地部署和运行自定义工具,通过简单的装饰器语法定义工具函数
远程工具连接
可以通过 SSE (Server-Sent Events) 连接远程 MCP 服务,扩展工具能力
会话管理
支持多会话隔离,每个会话有独立的代码执行环境和变量空间
流式响应
工具执行结果以流式方式返回,支持实时显示执行进度和中间结果
化学信息查询
集成 PubChem 数据库,支持通过化合物名称搜索化学信息
网络搜索
提供网络搜索功能,能够获取最新的网络信息和相关数据
优势
统一的工具调用接口,简化多工具集成
支持本地和远程工具混合使用
流式响应提供更好的用户体验
会话隔离确保任务执行的独立性
基于标准 MCP 协议,具有良好的扩展性
局限性
需要一定的技术知识进行工具部署和配置
远程工具依赖网络连接稳定性
会话管理需要手动维护会话生命周期
部分高级功能需要了解具体的工具使用方法
如何使用
环境准备
确保服务器运行在 Docker 环境中,配置好所需的 CPU 和内存资源
工具配置
在 config/server_list.json 中配置需要使用的工具,包括本地工具路径和远程 SSE 链接
启动服务
在容器中运行部署脚本启动所有配置的工具服务
调用工具
通过 Agent 框架或 HTTP API 调用工具,管理会话生命周期
使用案例
化学化合物查询
查询特定化学化合物的详细信息
网络价格查询
搜索最新产品价格信息
数据分析任务
执行复杂的数据处理和分析任务
常见问题
如何添加新的本地工具?
在 server 目录下创建新的工具目录,使用 @mcp.tool() 装饰器定义工具函数,然后在 config/server_list.json 中添加对应的 Python 文件路径。
会话超时时间如何设置?
在创建 StreamToolManager 时可以通过 timeout 参数设置会话超时时间,默认超时时间为180秒。
如何处理工具执行错误?
工具执行错误会在返回结果中包含错误信息,可以通过检查返回结果中的 error 字段来处理异常情况。
如何释放会话资源?
调用 close_session() 方法可以释放当前会话占用的资源,包括内存和变量空间。
支持哪些类型的远程工具连接?
支持通过 SSE (Server-Sent Events) 协议连接的远程 MCP 服务,需要在配置文件中提供完整的 SSE 链接。
相关资源
MCP 协议官方文档
Model Context Protocol 的官方文档和规范说明
Docker 部署指南
Docker 容器化部署的详细指南
PubChem 数据库 API
PubChem 化学数据库的 API 文档
示例代码库
包含工具示例和配置模板的代码库
安装
复制以下命令到你的Client进行配置
注意:您的密钥属于敏感信息,请勿与任何人分享。
🚀 工具导入说明
本说明文档详细介绍了工具的导入方式、服务的运行方法以及服务的调用方式,帮助你顺利使用相关工具和服务。
🚀 快速开始
✨ 本地client导入
在 server 目录下新建目录,每个目录有一个用 fastmcp 装饰的工具实例。以 server/PubChem-MCP-Server/pubchem_server.py 为例,里面定义了一个 mcp 工具:
@mcp.tool()
async def search_pubchem_by_name(name: str, max_results: int = 5) -> List[Dict[str, Any]]:
logging.info(f"Searching for compounds with name: {name}, max_results: {max_results}")
"""
Search for chemical compounds on PubChem using a compound name.
Args:
name: Name of the chemical compound
max_results: Maximum number of results to return (default: 5)
Returns:
List of dictionaries containing compound information
"""
try:
results = await asyncio.to_thread(search_by_name, name, max_results)
return results
except Exception as e:
return [{"error": f"An error occurred while searching: {str(e)}"}]
文件定义好之后需要在 config/server_list.json 中指定对应的 py 文件路径(在这里是 server/PubChem-MCP-Server/pubchem_server.py),同时一些简单的 mcp 服务可以直接在 mcp_server.py 文件中定义,默认会从中导入。
✨ sse client 导入
在 config/server_list.json 里面加入需要的 sse 链接即可,示例如下:
[
"server/Agents-Server/agents_server.py",
"server/BASE-TOOL-Server/base_tool_server.py",
"https://dpa-uuid1750659890.app-space.dplink.cc/sse?token=b42b991d062341fba15a9f7975e190b0"
]
✨ 运行服务
建议服务跑在 docker 镜像下,我们有一个自己的 docker 镜像,启动参考脚本如下:
docker run -d \
--name backend_server_shenshi \
--cpuset-cpus="64-95" \
-p 30004:30004 \
-v #Agent对应的目录:/mnt \
fastapi-server \
tail -f /dev/null
这里指定 CPU 是为了提升多核性能,提高并发性。在容器中运行脚本:
bash deploy_server.sh
💻 使用示例
基础用法
使用 Agent 框架下自带的 tool manager 执行代码(推荐):
class StreamToolManager(BaseToolManager):
def __init__(self, url, session_id:str = None, timeout:int=180):
super().__init__(url)
self.session_id = str(uuid4()) if not session_id else session_id
# self.session_id = str("test_id2")
self.timeout = timeout
async def submit_task(self, code:str):
...
async def recieve_task_process(self, ):
...
async def execute_code_async_stream(self, tool_call: str,):
submit_status = await self.submit_task(tool_call)
if submit_status["status"] == "fail":
yield {"output":""}
return
async for item in self.recieve_task_process():
yield item
async def close_session(self):
async with httpx.AsyncClient() as client:
resp = await client.post(
f"{self.server_url}/del_session",
params={"session_id": self.session_id}
)
return resp.json()
使用说明:
- 需要自己维护好自己
session id下的tool manager,每个session id对应的tool manager会有一个独立的代码执行空间,历史的函数和变量都会保留。 - 在整个
session infer结束后,如果你不需要这个session,需要手动删除(close_session()函数),释放你这个session的代码执行内存和变量。 - 通过
execute_code_async_stream来执行代码,代码执行结果会流式出现,分别包含以下几种情况:- agent 直接调用工具,工具正常返回,会流式返回所有调用的工具,和最终代码执行结果,工具返回的时候,
other_info里面会有函数名:结果的字典,代码返回的时候main_stream_type是code_result,stream_state有start,running,end三种。
- agent 直接调用工具,工具正常返回,会流式返回所有调用的工具,和最终代码执行结果,工具返回的时候,
{
"main_stream_type": "tool_result",
"sub_stream_type": "",
"content": "",
"from_sandbox": true,
"stream_state": "start",
"other_info": {}
},
{
"main_stream_type": "tool_result",
"sub_stream_type": "",
"content": "",
"from_sandbox": true,
"stream_state": "running",
"other_info": {
"web_search": {
"tool_result": {
"organic": [
{
"title": "Buy iPhone 15 and iPhone 15 Plus - Apple",
"link": "https://www.apple.com/shop/buy-iphone/iphone-15",
"snippet": "BuyFrom $799.00Footnote**Pay with Apple Pay or other payment methods. Finance ...",
"sitelinks": [
{
"title": "Buy iPhone 15",
"link": "https://www.apple.com/shop/buy-iphone/iphone-15/6.1-inch-display-128gb-black-unlocked"
}
],
"position": 1
},
{
"title": "Buy iPhone - Apple",
"link": "https://www.apple.com/shop/buy-iphone",
"snippet": "Shop the latest iPhone models and accessories. Save with Apple Trade In, carrier offers, and flexible monthly payment options. Get expert help today.",
"position": 2
},
{
"title": "iPhone - Apple",
"link": "https://www.apple.com/iphone/",
"snippet": "The ultimate iPhone ... From $999 or $41.62/mo. for 24 mo ... Learn more Buy ... Apple Intelligence.",
"position": 3
},
{
"title": "Apple Store - Find a Store",
"link": "https://www.apple.com/retail/",
"snippet": "Activation required. AT&T iPhone 15 Special Deal: Buy an iPhone 15 128 GB and get $441.36 in bill credits applied over 36 months. Buy an iPhone 15 256 GB and ...",
"position": 4
},
{
"title": "Apple iPhone 15: Order, Price, Colors, Features - Verizon",
"link": "https://www.verizon.com/smartphones/apple-iphone-15/",
"snippet": "You'll pay $0.00/mo after a credit of $20.27/mo on your billed price of $20.27/mo per device for 36 mos. Full retail price $729.99. Your total payments will ...",
"position": 5
},
{
"title": "iPhone - Buying iPhone - Apple",
"link": "https://www.apple.com/iphone/buy/",
"snippet": "Purchase your next iPhone from the Apple Store. Get answers about carriers ... Greatest price. From $599. Buy \u00b7 Learn more \u00b7 View in AR. 6.1\u2033. Super Retina ...",
"position": 6
},
{
"title": "Amazon.com: Apple iPhone 15 Pro Max, 256GB, Natural Titanium",
"link": "https://www.amazon.com/Apple-iPhone-15-Pro-Max/dp/B0CMZD7VCV",
"snippet": "List Price: $829.00$829.00 Details. The List Price is the suggested retail price of a new product as provided by a manufacturer, supplier, or seller. Except ...",
"rating": 3.9,
"ratingCount": 1511,
"position": 7
},
{
"title": "Interesting to see the USD price difference of the iPhone 15 Pro ...",
"link": "https://www.reddit.com/r/iphone/comments/16kl59k/interesting_to_see_the_usd_price_difference_of/",
"snippet": "1K votes, 332 comments. For fun I priced out a top-spec 15 Pro Max in Turkey and it comes out to US$3458.88. Cheap!",
"date": "Sep 17, 2023",
"position": 8
},
{
"title": "Apple",
"link": "https://www.apple.com/",
"snippet": "Discover the innovative world of Apple and shop everything iPhone, iPad, Apple Watch, Mac, and Apple TV, plus explore accessories, entertainment, ...",
"position": 9
}
],
"peopleAlsoAsk": [
{
"question": "What is the iPhone 15 going to cost?",
"snippet": "New or existing customer Retail price: $729.99. One-time activation fee of $35.",
"title": "Apple iPhone 15: Order, Price, Colors, Features - Verizon",
"link": "https://www.verizon.com/smartphones/apple-iphone-15/"
},
{
"question": "How much will Apple pay for an iPhone 15?",
"snippet": "Get $45\u2013$600 for your trade-in. Get 3% Daily Cash back with Apple Card.",
"title": "Buy iPhone 15 and iPhone 15 Plus - Apple",
"link": "https://www.apple.com/shop/buy-iphone/iphone-15"
},
{
"question": "How much will I get for an iPhone 15?",
"snippet": "Get \u00a330-\u00a3595 when you trade in an iPhone. 1\nYour device\nEstimated trade-in value 1\niPhone 15 Pro Max\nUp to \u00a3595\niPhone 15 Pro\nUp to \u00a3535\niPhone 15 Plus\nUp to \u00a3420\niPhone 15\nUp to \u00a3385",
"title": "Apple Trade In - Apple (UK)",
"link": "https://www.apple.com/uk/shop/trade-in"
},
{
"question": "How much did the iPhone 15 originally cost?",
"snippet": "Pricing and Availability iPhone 15 and iPhone 15 Plus will be available in pink, yellow, green, blue, and black in 128GB, 256GB, and 512GB storage capacities, starting at $799 (U.S.) or $33.29 (U.S.) per month, and $899 (U.S.) or $37.45 (U.S.) per month, respectively.",
"title": "Apple debuts iPhone 15 and iPhone 15 Plus",
"link": "https://www.apple.com/newsroom/2023/09/apple-debuts-iphone-15-and-iphone-15-plus/"
}
],
"relatedSearches": [
{
"query": "Apple IPhone 13"
},
{
"query": "Iphone 15 price official apple store usa"
},
{
"query": "Iphone 15 price official apple store near me"
},
{
"query": "iPhone 15 Pro Max"
},
{
"query": "iPhone 15 price in USA"
},
{
"query": "iPhone 15 Pro Max price"
},
{
"query": "iPhone 15 Pro Max price in USA"
},
{
"query": "iPhone 14"
},
{
"query": "iPhone 15 Pro price in USA"
}
]
},
"tool_elapsed_time": 2.1127848625183105
}
}
},
{
"main_stream_type": "code_result",
"sub_stream_type": "",
"content": "{'tool_result': {'organic': [{'title': 'Buy iPhone 15 and iPhone 15 Plus - Apple', 'link': 'https://www.apple.com/shop/buy-iphone/iphone-15', 'snippet': 'BuyFrom $799.00Footnote**Pay with Apple Pay or other payment methods. Finance ...', 'sitelinks': [{'title': 'Buy iPhone 15', 'link': 'https://www.apple.com/shop/buy-iphone/iphone-15/6.1-inch-display-128gb-black-unlocked'}], 'position': 1}, {'title': 'Buy iPhone - Apple', 'link': 'https://www.apple.com/shop/buy-iphone', 'snippet': 'Shop the latest iPhone models and accessories. Save with Apple Trade In, carrier offers, and flexible monthly payment options. Get expert help today.', 'position': 2}, {'title': 'iPhone - Apple', 'link': 'https://www.apple.com/iphone/', 'snippet': 'The ultimate iPhone ... From $999 or $41.62/mo. for 24 mo ... Learn more Buy ... Apple Intelligence.', 'position': 3}, {'title': 'Apple Store - Find a Store', 'link': 'https://www.apple.com/retail/', 'snippet': 'Activation required. AT&T iPhone 15 Special Deal: Buy an iPhone 15 128 GB and get $441.36 in bill credits applied over 36 months. Buy an iPhone 15 256 GB and ...', 'position': 4}, {'title': 'Apple iPhone 15: Order, Price, Colors, Features - Verizon', 'link': 'https://www.verizon.com/smartphones/apple-iphone-15/', 'snippet': \"You'll pay $0.00/mo after a credit of $20.27/mo on your billed price of $20.27/mo per device for 36 mos. Full retail price $729.99. Your total payments will ...\", 'position': 5}, {'title': 'iPhone - Buying iPhone - Apple', 'link': 'https://www.apple.com/iphone/buy/', 'snippet': 'Purchase your next iPhone from the Apple Store. Get answers about carriers ... Greatest price. From $599. Buy \u00b7 Learn more \u00b7 View in AR. 6.1\u2033. Super Retina ...', 'position': 6}, {'title': 'Amazon.com: Apple iPhone 15 Pro Max, 256GB, Natural Titanium', 'link': 'https://www.amazon.com/Apple-iPhone-15-Pro-Max/dp/B0CMZD7VCV', 'snippet': 'List Price: $829.00$829.00 Details. The List Price is the suggested retail price of a new product as provided by a manufacturer, supplier, or seller. Except ...', 'rating': 3.9, 'ratingCount': 1511, 'position': 7}, {'title': 'Interesting to see the USD price difference of the iPhone 15 Pro ...', 'link': 'https://www.reddit.com/r/iphone/comments/16kl59k/interesting_to_see_the_usd_price_difference_of/', 'snippet': '1K votes, 332 comments. For fun I priced out a top-spec 15 Pro Max in Turkey and it comes out to US$3458.88. Cheap!', 'date': 'Sep 17, 2023', 'position': 8}, {'title': 'Apple', 'link': 'https://www.apple.com/', 'snippet': 'Discover the innovative world of Apple and shop everything iPhone, iPad, Apple Watch, Mac, and Apple TV, plus explore accessories, entertainment, ...', 'position': 9}], 'peopleAlsoAsk': [{'question': 'What is the iPhone 15 going to cost?', 'snippet': 'New or existing customer Retail price: $729.99. One-time activation fee of $35.', 'title': 'Apple iPhone 15: Order, Price, Colors, Features - Verizon', 'link': 'https://www.verizon.com/smartphones/apple-iphone-15/'}, {'question': 'How much will Apple pay for an iPhone 15?', 'snippet': 'Get $45\u2013$600 for your trade-in. Get 3% Daily Cash back with Apple Card.', 'title': 'Buy iPhone 15 and iPhone 15 Plus - Apple', 'link': 'https://www.apple.com/shop/buy-iphone/iphone-15'}, {'question': 'How much will I get for an iPhone 15?', 'snippet': 'Get \u00a330-\u00a3595 when you trade in an iPhone. 1\\nYour device\\nEstimated trade-in value 1\\niPhone 15 Pro Max\\nUp to \u00a3595\\niPhone 15 Pro\\nUp to \u00a3535\\niPhone 15 Plus\\nUp to \u00a3420\\niPhone 15\\nUp to \u00a3385', 'title': 'Apple Trade In - Apple (UK)', 'link': 'https://www.apple.com/uk/shop/trade-in'}, {'question': 'How much did the iPhone 15 originally cost?', 'snippet': 'Pricing and Availability iPhone 15 and iPhone 15 Plus will be available in pink, yellow, green, blue, and black in 128GB, 256GB, and 512GB storage capacities, starting at $799 (U.S.) or $33.29 (U.S.) per month, and $899 (U.S.) or $37.45 (U.S.) per month, respectively.', 'title': 'Apple debuts iPhone 15 and iPhone 15 Plus', 'link': 'https://www.apple.com/newsroom/2023/09/apple-debuts-iphone-15-and-iphone-15-plus/'}], 'relatedSearches': [{'query': 'Apple IPhone 13'}, {'query': 'Iphone 15 price official apple store usa'}, {'query': 'Iphone 15 price official apple store near me'}, {'query': 'iPhone 15 Pro Max'}, {'query': 'iPhone 15 price in USA'}, {'query': 'iPhone 15 Pro Max price'}, {'query': 'iPhone 15 Pro Max price in USA'}, {'query': 'iPhone 14'}, {'query': 'iPhone 15 Pro price in USA'}]}, 'tool_elapsed_time': 2.1127848625183105}\n",
"from_sandbox": true,
"stream_state": "running",
"other_info": {}
},
{
"main_stream_type": "tool_result",
"sub_stream_type": "",
"content": "",
"from_sandbox": true,
"stream_state": "end",
"other_info": {}
},
2. agent 调用其他 agent 作为工具,此时会流式返回其他 agent 的 text 和工具调用结果。
{
"main_stream_type": "tool_result",
"sub_stream_type": "text",
"content": ">\n\n",
"from_sandbox": true,
"stream_state": "running",
"other_info": {}
},
{
"main_stream_type": "tool_result",
"sub_stream_type": "tool_result",
"content": "",
"from_sandbox": true,
"stream_state": "start",
"other_info": {}
},
{
"main_stream_type": "tool_result",
"sub_stream_type": "tool_result",
"content": "",
"from_sandbox": true,
"stream_state": "running",
"other_info": {
"web_search": {
"tool_result": {
"organic": [
{
"title": "Buy iPhone 16 and iPhone 16 Plus - Apple",
"link": "https://www.apple.com/shop/buy-iphone/iphone-16",
"snippet": "iPhone 16, Ultramarine finish, back exterior, top rounded corners, advanced dual-camera system, flash, microphone. From $799 or $33.29/mo. per month for 24 mo. ...",
"position": 1
},
{
"title": "iPhone 16 and iPhone 16 Plus - Apple",
"link": "https://www.apple.com/iphone-16/",
"snippet": "iPhone 16 and iPhone 16 Plus. Built for Apple Intelligence. Camera Control. 48MP Fusion camera. Five vibrant colors. A18 chip.",
"position": 2
},
{
"title": "Buy iPhone 16 Plus 128GB Black - Apple",
"link": "https://www.apple.com/shop/buy-iphone/iphone-16/6.7-inch-display-128gb-black-unlocked",
"snippet": "iPhone 16 Plus 128GB Black. $929.00. One-time payment. Get 3% Daily Cash with Apple Card. Add to Bag. Order now. Pick up, in store: Today at Apple Knox Street.",
"position": 3
},
{
"title": "Buy iPhone 16 Plus 128GB White - Apple",
"link": "https://www.apple.com/shop/buy-iphone/iphone-16/6.7-inch-display-128gb-white-unlocked",
"snippet": "Get $45 - $600 off a new iPhone 16 or iPhone 16 Plus when you trade in an iPhone 8 or newer. 0% financing available. Buy now with free shipping.",
"sitelinks": [
{
"title": "Model. Which Is Best For You...",
"link": "https://www.apple.com/shop/buy-iphone/iphone-16/6.7-inch-display-128gb-white-unlocked#:~:text=Model.%20Which%20is%20best%20for%20you%3F"
},
{
"title": "Connectivity. Choose A...",
"link": "https://www.apple.com/shop/buy-iphone/iphone-16/6.7-inch-display-128gb-white-unlocked#:~:text=Connectivity.%20Choose%20a%20carrier."
},
{
"title": "What's In The Box",
"link": "https://www.apple.com/shop/buy-iphone/iphone-16/6.7-inch-display-128gb-white-unlocked#:~:text=What%27s%20in%20the%20Box"
}
],
"position": 4
},
{
"title": "Buy iPhone 16 Plus 256GB Black - Apple",
"link": "https://www.apple.com/shop/buy-iphone/iphone-16/6.7-inch-display-256gb-black-unlocked",
"snippet": "Get $45 - $600 off a new iPhone 16 or iPhone 16 Plus when you trade in an iPhone 8 or newer. 0% financing available. Buy now with free shipping.",
"sitelinks": [
{
"title": "Model. Which Is Best For You...",
"link": "https://www.apple.com/shop/buy-iphone/iphone-16/6.7-inch-display-256gb-black-unlocked#:~:text=Model.%20Which%20is%20best%20for%20you%3F"
},
{
"title": "Connectivity. Choose A...",
"link": "https://www.apple.com/shop/buy-iphone/iphone-16/6.7-inch-display-256gb-black-unlocked#:~:text=Connectivity.%20Choose%20a%20carrier."
},
{
"title": "What's In The Box",
"link": "https://www.apple.com/shop/buy-iphone/iphone-16/6.7-inch-display-256gb-black-unlocked#:~:text=What%27s%20in%20the%20Box"
}
],
"position": 5
},
{
"title": "Buy iPhone - Apple",
"link": "https://www.apple.com/shop/buy-iphone",
"snippet": "Shop the latest iPhone models and accessories. Save with Apple Trade In, carrier offers, and flexible monthly payment options. Get expert help today.",
"position": 6
},
{
"title": "iPhone - Apple",
"link": "https://www.apple.com/iphone/",
"snippet": "Designed for Apple Intelligence. Discover the iPhone 16e along with iPhone 16 Pro, iPhone 16, and iPhone 15 ... Greatest price. From $599 or $24.95/mo ...",
"position": 7
},
{
"title": "Buy iPhone 16 and iPhone 16 Plus - Education - Apple",
"link": "https://www.apple.com/us-edu/shop/buy-iphone/iphone-16",
"snippet": "iPhone 16, Ultramarine finish, back exterior, top rounded corners, advanced dual-camera system, flash, microphone. From $799 or $33.29/mo. per month for 24 mo. ...",
"sitelinks": [
{
"title": "Model. Which Is Best For You...",
"link": "https://www.apple.com/us-edu/shop/buy-iphone/iphone-16#:~:text=Model.%20Which%20is%20best%20for%20you%3F"
},
{
"title": "Connectivity. Choose A...",
"link": "https://www.apple.com/us-edu/shop/buy-iphone/iphone-16#:~:text=Connectivity.%20Choose%20a%20carrier."
},
{
"title": "Applecare+ Coverage. Protect...",
"link": "https://www.apple.com/us-edu/shop/buy-iphone/iphone-16#:~:text=AppleCare%2B%20coverage.%20Protect%20your%20new%20iPhone."
}
],
"position": 8
},
{
"title": "Apple introduces iPhone 16 and iPhone 16 Plus",
"link": "https://www.apple.com/newsroom/2024/09/apple-introduces-iphone-16-and-iphone-16-plus/",
"snippet": "iPhone 16 and iPhone 16 Plus are built for Apple Intelligence, and feature Camera Control, the Action button, a 48MP Fusion camera, and the A18 chip.",
"date": "Sep 9, 2024",
"position": 9
},
{
"title": "Buy iPhone 16 Plus 256GB Pink - Apple",
"link": "https://www.apple.com/shop/buy-iphone/iphone-16/6.7-inch-display-256gb-pink-unlocked",
"snippet": "Latest iPhone. Greatest price. From $599. 6.1\u2033. Super Retina XDR display footnote \u00b9. \u2014 No ProMotion technology. \u2014 ...",
"sitelinks": [
{
"title": "Model. Which Is Best For You...",
"link": "https://www.apple.com/shop/buy-iphone/iphone-16/6.7-inch-display-256gb-pink-unlocked#:~:text=Model.%20Which%20is%20best%20for%20you%3F"
},
{
"title": "Connectivity. Choose A...",
"link": "https://www.apple.com/shop/buy-iphone/iphone-16/6.7-inch-display-256gb-pink-unlocked#:~:text=Connectivity.%20Choose%20a%20carrier."
},
{
"title": "What's In The Box",
"link": "https://www.apple.com/shop/buy-iphone/iphone-16/6.7-inch-display-256gb-pink-unlocked#:~:text=What%27s%20in%20the%20Box"
}
],
"position": 10
}
],
"peopleAlsoAsk": [
{
"question": "How much is the iPhone 16 Plus at the Apple Store?",
"snippet": "BuyFrom $899.00**Pay with Apple Pay or other payment methods. Finance$37.45/mo.",
"title": "Buy iPhone 16 Plus 128GB Black - Apple",
"link": "https://www.apple.com/shop/buy-iphone/iphone-16/6.7-inch-display-128gb-black-unlocked"
},
{
"question": "How much will the iPhone 16 Plus be?",
"snippet": "Tariffs for iPhone 16 Plus:\nMonthly phone payment\n\u00a322.24\nCash price\n\u00a3800.64\nCredit amount\n\u00a3800.64\nInterest rate (fixed)\n0%\nAPR representative\n0%",
"title": "iPhone 16 Plus | Pay Monthly Deals & Contracts - Tesco Mobile",
"link": "https://www.tescomobile.com/shop/apple/iphone-16-plus"
},
{
"question": "How to get iPhone 16 cheapest?",
"snippet": "Signing up for Boost Mobile's $60 per month Unlimited Premium plan saves you $500 on the iPhone 16E, and the Infinite Access plan for $65 a month saves up to $1,000 on the other models, which will net you the basic iPhone 16, 16 Plus and 16 Pro for free and the 16 Pro Max for less than $6 per month.",
"title": "Best iPhone 16 Deals: Grab a New Phone for Free Thanks to ... - CNET",
"link": "https://www.cnet.com/deals/best-iphone-16-deals/"
},
{
"question": "How much is an iPhone 16 Plus 256GB in the USA?",
"snippet": "BuyFrom $999.00**Pay with Apple Pay or other payment methods.",
"title": "Buy iPhone 16 Plus 256GB Black - Apple",
"link": "https://www.apple.com/shop/buy-iphone/iphone-16/6.7-inch-display-256gb-black-unlocked"
}
],
"relatedSearches": [
{
"query": "Apple iphone 16 plus price official site unlocked"
},
{
"query": "Apple iphone 16 plus price official site usa"
}
]
},
"tool_elapsed_time": 1.5962419509887695
}
}
},
高级用法
使用 Http 请求直接调用 execute 端点:
import requests
import time
url = "http://127.0.0.1:30004"
test_code = f"""
from tools import *
link = "https://www2.census.gov/library/publications/2001/demo/p60-214.html"
query = "Does this document mention any towns with 0% poverty rate for 65+ population and the specified income figures?"
result = web_parse_qwen(link, query)
print(result)
"""
headers = {
"Content-Type": "application/json"
}
def code_tool(code:str):
start_time = time.time() # 记录开始时间
payload = {
"code":code
}
resp = requests.post(
f"{url}/execute",
headers=headers,
json=payload
)
# print(resp.json())
print(resp.content)
response = resp.json()
elapsed = time.time() - start_time # 计算总耗时
response['total_time'] = elapsed
response['server_time'] = resp.elapsed.total_seconds()
return response
code_tool(test_code)
print([test_code])
替代品
K
Klavis
Klavis AI是一个开源项目,提供在Slack、Discord和Web平台上简单易用的MCP(模型上下文协议)服务,包括报告生成、YouTube工具、文档转换等多种功能,支持非技术用户和开发者使用AI工作流。
TypeScript
8.2K
5分
M
MCP
微软官方MCP服务器,为AI助手提供最新微软技术文档的搜索和获取功能
10.0K
5分
A
Aderyn
Aderyn是一个开源的Solidity智能合约静态分析工具,由Rust编写,帮助开发者和安全研究人员发现Solidity代码中的漏洞。它支持Foundry和Hardhat项目,可生成多种格式报告,并提供VSCode扩展。
Rust
5.9K
5分
D
Devtools Debugger MCP
Node.js调试器MCP服务器,提供基于Chrome DevTools协议的完整调试功能,包括断点设置、单步执行、变量检查和表达式评估等
TypeScript
5.4K
4分
S
Scrapling
Scrapling是一个自适应网页抓取库,能自动学习网站变化并重新定位元素,支持多种抓取方式和AI集成,提供高性能解析和开发者友好体验。
Python
7.9K
5分
M
Mcpjungle
MCPJungle是一个自托管的MCP网关,用于集中管理和代理多个MCP服务器,为AI代理提供统一的工具访问接口。
Go
0
4.5分

Cipher
Cipher是一个专为编程AI代理设计的开源记忆层框架,通过MCP协议与各种IDE和AI编码助手集成,提供自动记忆生成、团队记忆共享和双系统记忆管理等核心功能。
TypeScript
0
5分
N
Nexus
Nexus是一个AI工具聚合网关,支持连接多个MCP服务器和LLM提供商,通过统一端点提供工具搜索、执行和模型路由功能,支持安全认证和速率限制。
Rust
0
4分

Duckduckgo MCP Server
已认证
DuckDuckGo搜索MCP服务器,为Claude等LLM提供网页搜索和内容抓取服务
Python
57.0K
4.3分

Firecrawl MCP Server
Firecrawl MCP Server是一个集成Firecrawl网页抓取能力的模型上下文协议服务器,提供丰富的网页抓取、搜索和内容提取功能。
TypeScript
96.4K
5分

Figma Context MCP
Framelink Figma MCP Server是一个为AI编程工具(如Cursor)提供Figma设计数据访问的服务器,通过简化Figma API响应,帮助AI更准确地实现设计到代码的一键转换。
TypeScript
55.8K
4.5分

Minimax MCP Server
MiniMax Model Context Protocol (MCP) 是一个官方服务器,支持与强大的文本转语音、视频/图像生成API交互,适用于多种客户端工具如Claude Desktop、Cursor等。
Python
45.5K
4.8分

Exa Web Search
已认证
Exa MCP Server是一个为AI助手(如Claude)提供网络搜索功能的服务器,通过Exa AI搜索API实现实时、安全的网络信息获取。
TypeScript
40.2K
5分

Baidu Map
已认证
百度地图MCP Server是国内首个兼容MCP协议的地图服务,提供地理编码、路线规划等10个标准化API接口,支持Python和Typescript快速接入,赋能智能体实现地图相关功能。
Python
39.0K
4.5分

Edgeone Pages MCP Server
EdgeOne Pages MCP是一个通过MCP协议快速部署HTML内容到EdgeOne Pages并获取公开URL的服务
TypeScript
25.5K
4.8分

Context7
Context7 MCP是一个为AI编程助手提供实时、版本特定文档和代码示例的服务,通过Model Context Protocol直接集成到提示中,解决LLM使用过时信息的问题。
TypeScript
72.0K
4.7分
