เชื่อมต่อเอเจนต์ของคุณ
ที่อยู่เซิร์ฟเวอร์: https://asi.express/mcp Transport: Streamable HTTP (POST, คำตอบเป็น JSON) ไม่ต้องลงชื่อเข้าใช้ ไม่ต้องใช้คีย์
การเรียกครั้งแรก: search_capabilities พร้อม {"query": "weather", "limit": 3} ซึ่งจะส่งกลับ results (รายการความสามารถไม่เกิน 3 รายการ), count (ตัวเลข) และบรรทัดสถานะ คุณไม่จำเป็นต้องอ่านเครื่องมืออื่นก่อน
ทดสอบเมื่อ 2026-11-22 บน production ด้วยเวอร์ชันไลบรารีที่ระบุไว้ในแต่ละส่วน
เครื่องมือจากผู้ให้บริการรายอื่นเป็นของบุคคลที่สาม: อ่านว่าเครื่องมือนั้นทำอะไรก่อนที่จะให้เอเจนต์ของคุณเรียกใช้ และอย่าตั้งค่า "อนุญาตเสมอ" สำหรับเครื่องมือที่ดำเนินการต่าง ๆ
Python, MCP SDK (mcp 1.30.0)
import asyncio
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client
async def main():
async with streamablehttp_client("https://asi.express/mcp") as (r, w, _):
async with ClientSession(r, w) as s:
await s.initialize()
print([t.name for t in (await s.list_tools()).tools])
res = await s.call_tool("search_capabilities", {"query": "weather", "limit": 3})
print(res.structuredContent["count"], len(res.structuredContent["results"]))
asyncio.run(main())ผลลัพธ์ที่คาดหวัง: ชื่อเครื่องมือ 11 รายการ รวมถึง search_capabilities ตามด้วยจำนวนและผลลัพธ์ไม่เกิน 3 รายการ
OpenAI Agents SDK (openai-agents 0.25.0)
ไม่ต้องใช้คีย์ OpenAI ในการเชื่อมต่อและแสดงรายการเครื่องมือ แต่การรันโมเดลต้องใช้คีย์ เมื่อตั้งค่าคีย์ไว้ tracing จะส่งข้อมูลไปยังบุคคลที่สาม: ตั้งค่า OPENAI_AGENTS_DISABLE_TRACING=1 หากคุณไม่ต้องการเช่นนั้น
import asyncio
from agents.mcp import MCPServerStreamableHttp
async def main():
async with MCPServerStreamableHttp(name="asi", params={"url": "https://asi.express/mcp"},
cache_tools_list=True, client_session_timeout_seconds=30) as srv:
print([t.name for t in await srv.list_tools()])
res = await srv.call_tool("search_capabilities", {"query": "weather", "limit": 3})
print(res.structuredContent["count"])
asyncio.run(main())วิธีมอบเซิร์ฟเวอร์ให้เอเจนต์: Agent(name="x", mcp_servers=[srv]) การทดสอบไม่ได้รันโมเดล สิ่งที่พิสูจน์แล้วคือการเชื่อมต่อ การแสดงรายการ และการเรียกด้านบน
LangChain / LangGraph (langchain-mcp-adapters 0.3.2)
import asyncio, json
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain_mcp_adapters.tools import load_mcp_tools
async def main():
client = MultiServerMCPClient({"asi": {"transport": "streamable_http", "url": "https://asi.express/mcp"}})
async with client.session("asi") as s:
tools = await load_mcp_tools(s)
tool = [t for t in tools if t.name == "search_capabilities"][0]
out = await tool.ainvoke({"query": "weather", "limit": 3})
text = out[0]["text"] if isinstance(out, list) else out # the JSON is the FIRST text item; a status line follows
print(json.loads(text)["count"])
asyncio.run(main())คำตอบมีรายการข้อความสองรายการ: JSON ก่อน แล้วตามด้วยบรรทัดสถานะ ให้ parse เฉพาะรายการแรก
LlamaIndex (llama-index-tools-mcp 0.4.8)
import asyncio
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec
async def main():
client = BasicMCPClient("https://asi.express/mcp") # a URL ending /mcp = Streamable HTTP
tools = await McpToolSpec(client=client, allowed_tools=["search_capabilities"]).to_tool_list_async()
res = await client.call_tool("search_capabilities", {"query": "weather", "limit": 3})
print(res.structuredContent["count"])
asyncio.run(main())CrewAI (crewai 1.6.1 with mcpadapt 0.1.20)
พิสูจน์ผ่าน MCP adapter ที่ MCPServerAdapter ของ CrewAI เองห่อหุ้มไว้ ไม่สามารถโหลด crewai_tools บนเครื่องทดสอบได้ จึงไม่ได้กล่าวอ้างถึงคลาส wrapper นั้น
from mcpadapt.core import MCPAdapt
from mcpadapt.crewai_adapter import CrewAIAdapter
with MCPAdapt({"url": "https://asi.express/mcp", "transport": "streamable-http"}, CrewAIAdapter(), 30) as tools:
print([t.name for t in tools]) # check the list is not empty: a failed server is skipped quietly
search = [t for t in tools if t.name.endswith("search_capabilities")][0]
print(search.run(query="weather", limit=3))ตรวจสอบว่ารายการเครื่องมือไม่ว่างเปล่า: เซิร์ฟเวอร์ที่ล้มเหลวจะถูกข้ามไปอย่างเงียบ ๆ
Plain HTTP (curl)
curl -sS -X POST https://asi.express/mcp \
-H 'content-type: application/json' -H 'accept: application/json, text/event-stream' \
--data '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_capabilities","arguments":{"query":"weather","limit":3}}}'ลำดับที่พิสูจน์แล้ว: initialize, notifications/initialized, tools/list แล้วตามด้วยการเรียกด้านบน เซิร์ฟเวอร์ไม่เก็บเซสชัน จึงไม่ต้องใช้เฮดเดอร์ Mcp-Session-Id การเรียกเพียงอย่างเดียวก็ได้รับการยอมรับเช่นกัน เพิ่ม -m 30 เพื่อจำกัดเวลารอ
Claude Code (claude 2.1.330)
บันทึกสิ่งนี้เป็นไฟล์ เช่น asi-mcp.json:
{"mcpServers": {"asi": {"type": "http", "url": "https://asi.express/mcp"}}}จากนั้นเริ่ม Claude Code ด้วย claude --mcp-config asi-mcp.json เซิร์ฟเวอร์ asi จะแสดงว่าเชื่อมต่อแล้ว และเครื่องมือของเซิร์ฟเวอร์จะปรากฏเป็น mcp__asi__search_capabilities เป็นต้น
รูปแบบนี้ทดสอบบน production เมื่อ 2026-11-22
รายการเดียวกันในไฟล์ .mcp.json ของโปรเจกต์ หรือที่เพิ่มด้วย claude mcp add --transport http asi https://asi.express/mcp ก็น่าจะใช้งานได้เช่นกัน (Claude Code จะขอให้คุณอนุมัติเซิร์ฟเวอร์ของโปรเจกต์) เรายังไม่ได้ทดสอบรูปแบบเหล่านี้บน production
ไคลเอนต์อื่นจะถูกเพิ่มที่นี่หลังจากผ่านการทดสอบบน production แล้วเท่านั้น