An agent that needs weather data could wrap a weather API in its own tool. Doing that again for every agent and service creates repetitive integration work. An MCP server moves the tool interface to the service: agents connect through an MCP client, discover the available tools, and invoke the ones they need. section 13.0 section 13.1.2
The pieces fit together as follows:
- The agent or application is the MCP host. Its MCP client connects to one or more servers. section 13.1.2
- Each server exposes a collection of tools. The agent discovers them and chooses which to call; the server performs the operation and returns a standardized result. section 13.5
- A remote server commonly uses Streamable HTTP; a local server can use standard input/output, particularly for development or local resources. section 13.1.2
Replace a mock weather tool
Start with an API key from AccuWeather and put it in a project .env file. A Python server built with FastMCP 2 exposes get_weather_conditions(location): it resolves the supplied location through AccuWeather’s location-search endpoint, then requests current conditions. The agent can replace its made-up weather tool with this live tool while retaining its other local capabilities. section 13.3.1 section 13.4 section 13.4.1
async def get_accuweather_tools(): #1
mcp_client = MultiServerMCPClient({ #2
"accuweather": { #3
"url": "http://127.0.0.1:8020/accu-mcp-server",
"transport": "streamable_http"
}
})
return await mcp_client.get_tools() #4
This client configuration identifies the server URL and streamable_http transport; get_tools() retrieves its exposed tool for use by the agent. section 13.4.2
Verify the connection rather than assuming it works: inspect the agent’s tool list for both local and MCP tools, ask a weather question, then check the server terminal or LangSmith trace for the call. MCP Inspector can test a server interactively before agent integration. section 13.4.5 section 13.5
Check whether a service already publishes an MCP server before building one. Public servers can be consumed through OpenAI’s Responses API, but servers restricted to an organization may require a direct FastMCP client or a LangChain/LangGraph integration. Decide how remote calls will be authorized, including whether approval is automatic or interactive. section 13.5 section 13.2.3











