MCP Sandbox
概要
コンテンツ詳細
代替品
MCPツールサーバーとは?
MCPツールサーバーは、Model Context Protocol標準に基づいて構築された、さまざまな人工知能ツールを統合したサービスプラットフォームです。ユーザーは統一されたインターフェースを通じて、コード実行、化学化合物検索、ウェブ検索、データ分析などのさまざまな機能にアクセスできます。サーバーはローカルツールのデプロイとリモートツールの接続をサポートし、開発者に柔軟なツール統合ソリューションを提供します。MCPツールサーバーをどのように使用するか?
ユーザーは、このサービスを2つの主要な方法で使用できます: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ドキュメントです。
サンプルコードライブラリ
ツールのサンプルと構成テンプレートを含むコードライブラリです。
インストール
以下のコマンドをクライアントにコピーして設定
注意:あなたのキーは機密情報です。誰とも共有しないでください。
🚀 ツール導入説明
このドキュメントでは、ツールの導入方法、サービスの実行方法、およびサービスの呼び出し方法について説明します。
🚀 クイックスタート
以下の手順に従って、ツールを導入し、サービスを実行し、呼び出すことができます。
✨ 主な機能
- ローカルクライアントとSSEクライアントの導入方法を提供します。
- Dockerイメージでのサービス実行方法を提供します。
- AgentフレームワークのTool Managerを使用したコード実行方法と、HTTPリクエストによるサービス呼び出し方法を提供します。
📦 インストール
ローカルクライアントの導入
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クライアントの導入
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には、独立したコード実行空間があり、過去の関数や変数は保持されます。
- セッション推論が終了した後、そのセッションが不要になった場合は、手動で削除する必要があります(close_session()関数を使用)。これにより、そのセッションのコード実行メモリと変数が解放されます。
- execute_code_async_streamを使用してコードを実行すると、コードの実行結果がストリーム形式で表示されます。以下のようなケースがあります。
- Agentが直接ツールを呼び出し、ツールが正常に返される場合、呼び出されたすべてのツールと最終的なコード実行結果がストリーム形式で返されます。ツールが返されるとき、other_infoには関数名と結果の辞書が含まれ、コードが返されるとき、main_stream_typeはcode_resultになります。stream_stateにはstart、running、endの3種類があります。
{
"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": {}
},
- Agentが他のAgentをツールとして呼び出す場合、他のAgentのテキストとツール呼び出し結果がストリーム形式で返されます。
{
"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エンドポイントを直接呼び出す
HTTPリクエストを使用して、コード実行リクエストをターゲットサービスに送信します。ここでは、ツールサービスが30004ポートにデプロイされていると仮定します。
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
9.2K
5ポイント
M
MCP
Microsoft公式のMCPサーバーで、AIアシスタントに最新のMicrosoft技術ドキュメントの検索と取得機能を提供します。
9.7K
5ポイント
A
Aderyn
アデリンは、Rustで書かれたオープンソースのSolidityスマートコントラクト静的分析ツールで、開発者やセキュリティ研究者がSolidityコードの脆弱性を発見するのを支援します。FoundryとHardhatプロジェクトをサポートし、複数の形式のレポートを生成でき、VSCode拡張機能も提供します。
Rust
5.2K
5ポイント
D
Devtools Debugger MCP
Node.jsデバッガーMCPサーバーは、Chrome DevToolsプロトコルに基づく完全なデバッグ機能を提供します。ブレークポイントの設定、ステップ実行、変数のチェック、式の評価などが含まれます。
TypeScript
5.6K
4ポイント
S
Scrapling
Scraplingは適応型ウェブページのスクレイピングライブラリで、ウェブサイトの変化を自動的に学習し、要素を再配置します。複数のスクレイピング方法とAI統合をサポートし、高性能な解析と開発者に優しい体験を提供します。
Python
8.4K
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ポイント

Edgeone Pages MCP Server
EdgeOne Pages MCPは、MCPプロトコルを通じてHTMLコンテンツをEdgeOne Pagesに迅速にデプロイし、公開URLを取得するサービスです。
TypeScript
16.5K
4.8ポイント

Context7
Context7 MCPは、AIプログラミングアシスタントにリアルタイムのバージョン固有のドキュメントとコード例を提供するサービスで、Model Context Protocolを通じてプロンプトに直接統合され、LLMが古い情報を使用する問題を解決します。
TypeScript
45.8K
4.7ポイント

Gmail MCP Server
Claude Desktop用に設計されたGmail自動認証MCPサーバーで、自然言語でのやり取りによるGmailの管理をサポートし、メール送信、ラベル管理、一括操作などの完全な機能を備えています。
TypeScript
12.6K
4.5ポイント

Baidu Map
認証済み
百度マップMCPサーバーは国内初のMCPプロトコルに対応した地図サービスで、地理コーディング、ルート計画など10個の標準化されたAPIインターフェースを提供し、PythonとTypescriptでの迅速な接続をサポートし、エージェントに地図関連の機能を実現させます。
Python
25.2K
4.5ポイント

Gitlab MCP Server
認証済み
GitLab MCPサーバーは、Model Context Protocolに基づくプロジェクトで、GitLabアカウントとのやり取りに必要な包括的なツールセットを提供します。コードレビュー、マージリクエスト管理、CI/CD設定などの機能が含まれます。
TypeScript
13.5K
4.3ポイント

Unity
認証済み
UnityMCPはUnityエディターのプラグインで、モデルコンテキストプロトコル (MCP) を実装し、UnityとAIアシスタントのシームレスな統合を提供します。リアルタイムの状態監視、リモートコマンドの実行、ログ機能が含まれます。
C#
16.3K
5ポイント

Magic MCP
Magic Component Platform (MCP) はAI駆動のUIコンポーネント生成ツールで、自然言語での記述を通じて、開発者が迅速に現代的なUIコンポーネントを作成するのを支援し、複数のIDEとの統合をサポートします。
JavaScript
14.8K
5ポイント

Sequential Thinking MCP Server
MCPプロトコルに基づく構造化思考サーバーで、思考段階を定義することで複雑な問題を分解し要約を生成するのに役立ちます。
Python
21.3K
4.5ポイント
