ភ្ជាប់ agent របស់អ្នក
អាសយដ្ឋានម៉ាស៊ីនមេ: https://asi.express/mcp។ Transport: Streamable HTTP (POST, ចម្លើយ JSON)។ មិនចាំបាច់ចូលគណនី មិនចាំបាច់ key។
ការហៅដំបូង: search_capabilities ជាមួយ {"query": "weather", "limit": 3}។ វាត្រឡប់ results (បញ្ជីសមត្ថភាពរហូតដល់ 3), count (ចំនួនមួយ) និងបន្ទាត់ស្ថានភាពមួយ។ អ្នកមិនចាំបាច់អាន tool ផ្សេងទៀតជាមុនទេ។
បានសាកល្បងនៅ 2026-11-22 លើ production ជាមួយកំណែ library ដែលបានបញ្ជាក់ក្នុងផ្នែកនីមួយៗ។
ឧបករណ៍ពីអ្នកផ្ដល់សេវាផ្សេងទៀតគឺជារបស់ភាគីទីបី៖ សូមអានថាឧបករណ៍មួយធ្វើអ្វី មុនពេលអ្នកអនុញ្ញាតឱ្យភ្នាក់ងាររបស់អ្នកដំណើរការវា ហើយកុំកំណត់ «អនុញ្ញាតជានិច្ច» សម្រាប់ឧបករណ៍ដែលធ្វើសកម្មភាព។
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())លទ្ធផលរំពឹងទុក: ឈ្មោះ tool ចំនួន 11 រួមទាំង search_capabilities បន្ទាប់មកចំនួនមួយ និងលទ្ធផលរហូតដល់ 3។
OpenAI Agents SDK (openai-agents 0.25.0)
មិនត្រូវការ OpenAI key ដើម្បីភ្ជាប់ និងរាយបញ្ជី tool ទេ ប៉ុន្តែការដំណើរការ model ត្រូវការវា។ ពេលកំណត់ key រួច 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: Agent(name="x", mcp_servers=[srv])។ ការសាកល្បងមិនបានដំណើរការ model ទេ ការភ្ជាប់ ការរាយបញ្ជី និងការហៅខាងលើគឺជាអ្វីដែលបានបញ្ជាក់។
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 ខ្លួនឯងមិនអាច load បាននៅលើកុំព្យូទ័រសាកល្បង ដូច្នេះមិនមានការអះអាងអំពី wrapper class នោះទេ។
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))ពិនិត្យថាបញ្ជី tool មិនទទេ: ម៉ាស៊ីនមេដែលបរាជ័យត្រូវបានរំលងដោយស្ងាត់ៗ។
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 បន្ទាប់មកការហៅខាងលើ។ ម៉ាស៊ីនមេមិនរក្សាទុក session ទេ ដូច្នេះមិនត្រូវការ header 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 បង្ហាញថាបានភ្ជាប់ ហើយ tool របស់វាលេចឡើងជា mcp__asi__search_capabilities ជាដើម។
ទម្រង់នេះត្រូវបានសាកល្បងលើ production នៅ 2026-11-22។
ធាតុដូចគ្នានៅក្នុងឯកសារ .mcp.json របស់គម្រោង ឬដែលបន្ថែមដោយ claude mcp add --transport http asi https://asi.express/mcp គួរតែដំណើរការដែរ (Claude Code សុំឱ្យអ្នកអនុម័តម៉ាស៊ីនមេរបស់គម្រោង)។ យើងមិនទាន់បានសាកល្បងទម្រង់ទាំងនេះលើ production ទេ។
client ផ្សេងទៀតត្រូវបានបន្ថែមនៅទីនេះ លុះត្រាតែវាឆ្លងកាត់ការសាកល្បងលើ production។