# xAI SDK local MCP server error: Server URL resolves to internal IP

## The problem

Connecting to a local MCP server with the mcp helper fails with: Server URL resolves to internal IP: http://YOUR_HOST:8181/mcp/sse. What is the correct way to use a local MCP server with the xAI SDK? My MCP server runs locally for development and is reachable from my machine. I would rather not expose it publicly just to test the integration.

## The verified fix

Local MCP servers are not supported through the mcp helper function, which is why you get that internal IP error. The docs are being clarified on this. You can still use tools from a locally running MCP server, but you have to write a bit more code: extract the tool definitions from the server yourself and pass them in as regular tools. Source: https://github.com/xai-org/xai-sdk-python/issues/66