Ceangail an t-àidseant agad
Seòladh an fhrithealaiche: https://asi.express/mcp. Còmhdhail: Streamable HTTP (POST, freagairtean JSON). Gun chlàradh a-steach, gun iuchair.
A' chiad ghairm: search_capabilities le {"query": "weather", "limit": 3}. Tillidh e results (liosta de suas ri 3 comasan), count (àireamh) agus loidhne inbhe. Chan fheum thu na h-innealan eile a leughadh an toiseach.
Air a chur fo dheuchainn air 2026-11-22, air an t-siostam riochdachaidh, leis na tionndaidhean leabharlainn a tha air an ainmeachadh anns gach earrann.
'S e innealan treas-phàrtaidh a th' ann an innealan o sholaraichean eile: leugh dè nì inneal mus leig thu le d' àidseant a ruith, agus na suidhich 'Ceadaich an-còmhnaidh' airson innealan a nì gnìomhan.
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())Toradh ris a bheil dùil: 11 ainmean innealan, search_capabilities nam measg, an uair sin cunntas agus suas ri 3 toraidhean.
OpenAI Agents SDK (openai-agents 0.25.0)
Chan fheum thu iuchair OpenAI airson ceangal agus na h-innealan a liostadh; feumaidh tu tè airson modail a ruith. Nuair a tha iuchair air a suidheachadh, cuiridh an lorgadh (tracing) dàta gu treas phàrtaidh: suidhich OPENAI_AGENTS_DISABLE_TRACING=1 mura h-eil thu ag iarraidh sin.
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())Gus am frithealaiche a thoirt do dh'àidseant: Agent(name="x", mcp_servers=[srv]). Cha do ruith an deuchainn modail; 's e an ceangal, an liostadh agus a' ghairm gu h-àrd na chaidh a dhearbhadh.
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())Tha dà nì teacsa san fhreagairt: an JSON an toiseach, an uair sin loidhne inbhe. Parsaich a' chiad fhear a-mhàin.
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)
Air a dhearbhadh tron inneal-atharrachaidh MCP a tha MCPServerAdapter aig CrewAI fhèin a' pasgadh. Cha b' urrainnear crewai_tools fhèin a luchdadh air a' choimpiutair deuchainn, mar sin chan eilear a' cumail a-mach dad mun chlas pasgaidh sin.
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))Dèan cinnteach nach eil liosta nan innealan falamh: thèid frithealaiche a dh'fhàilligeas a leum thairis gu sàmhach.
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}}}'Sreath dearbhte: initialize, notifications/initialized, tools/list, an uair sin a' ghairm gu h-àrd. Cha chum am frithealaiche seisean, mar sin chan fheumar bann-cinn Mcp-Session-Id. Gabhar ris a' ghairm leatha fhèin cuideachd; cuir -m 30 ris gus am feitheamh a chuingealachadh.
Claude Code (claude 2.1.330)
Sàbhail seo mar fhaidhle, mar eisimpleir asi-mcp.json:
{"mcpServers": {"asi": {"type": "http", "url": "https://asi.express/mcp"}}}An uair sin tòisich Claude Code le claude --mcp-config asi-mcp.json. Nochdaidh am frithealaiche asi mar air a cheangal, agus nochdaidh na h-innealan aige mar mcp__asi__search_capabilities is mar sin air adhart.
Chaidh am foirm seo a chur fo dheuchainn air an t-siostam riochdachaidh air 2026-11-22.
Bu chòir don aon innteart ann am faidhle .mcp.json pròiseict, no air a chur ris le claude mcp add --transport http asi https://asi.express/mcp, obrachadh cuideachd (iarraidh Claude Code ort frithealaiche pròiseict aontachadh). Cha do rinn sinn deuchainn air na foirmean seo air an t-siostam riochdachaidh.
Cha tèid cliantan eile a chur ris an seo ach às dèidh dhaibh deuchainn a thoirt seachad air an t-siostam riochdachaidh.