Code Integrations
Use these guides to connect the MCP server to popular SDKs. Each example covers authentication, tool scoping, and best practices for handling responses.
Supported SDKs
- OpenAI Responses (Python & JavaScript)
- Anthropic Messages (Node & Python)
- Vercel AI SDK (Next.js / React)
- LangChain (multi-tool orchestrations)
All samples assume the MCP endpoint https://mcp.api.xweather.com/mcp
and a combined API key stored in XWEATHER_API_KEY
.
Remember to review Filtering & Tool Scoping before rolling out to production so agents only see the functions you intend.