ChatGPT supports external tools through two mechanisms depending on the interface you are using: GPT Actions (for custom GPTs) and the OpenAI Responses API with tool calling (for developers using the API directly). The IPstack hosted MCP endpoint can be connected via the Streamable HTTP transport.
📌 Note on MCP Support As of early 2026, OpenAI's native MCP client support in ChatGPT is in active rollout. The steps below use the Streamable HTTP remote endpoint, which is the most compatible approach across ChatGPT, GPT Builder, and the Responses API. |
Prerequisites
- A MCP Bearer MCP token with mcp_access_enabled.
7.2 Config for ChatGPT + Codex to run by cli
This approach lets you build a Custom GPT in ChatGPT that can call IPstack tools through GPT Actions.
Step 1: Install npm package - @openai/codex
| npm install -g @openai/codex |
Step 2: Install npm package - mcp-remote
| npm install -g mcp-remote |
Step 3: Create config file in users directory
[mcp_servers.apilayer] startup_timeout_sec = 120 command = "mcp-remote" args = [ "https://mcp.apilayer.com/mcp", "--header", "Authorization:Bearer ${APILAYER_TOKEN}", ]
[mcp_servers.apilayer.env] APILAYER_TOKEN = "Place Your Ipstack MCP token here" |
Step 4: Consume api by codex
Type codex from the terminal in the directory which we trust, or maybe from a newly created directory, like the user wants. /mcp to list mcp etc.
Verify Integration
Once configured. Examples:
- "What country and city is the IP address 8.8.8.8 located in?" (uses ipstack_lookup)
- “Get location details for {IP_ADDRESS}.” (uses ipstack_lookup)
- “What region does IP {IP_ADDRESS} belong to?”
Allow access to tool calls to get the data.