Model Context Protocol (MCP): Connect AI to Your Tools and DataConnecting hosts and building clients · Lesson 9 of 18

Connecting MCP servers to Claude, ChatGPT, IDEs and agents

Article · 15 min · 9 min lecture

Video lecture

Connecting MCP servers to Claude, ChatGPT, IDEs and agents

15 chapters · about 9 min · full transcript

Coming soon

Chapter 1 of 15

Connecting to hosts

  • The host landscape
  • Local vs remote setup
  • MCP from your own code
  • Governance

The narrated lecture is in production

Every chapter is scripted and ready. Browse the chapters and read the full transcript now — the video will appear here when it’s published.

Chapters

The host landscape (September 2026)

MCP support is now broad, but features differ by host (tools only, or also resources, prompts, elicitation, MCP Apps; local stdio, remote HTTP, or both; OAuth support; admin controls). Always check the host's current documentation. Commonly used MCP hosts include:

HostTypical connectionNotes
Claude DesktopLocal stdio servers via claude_desktop_config.json; remote servers as connectorsAlso supports desktop extensions packaging local servers
Claude (web/mobile)Remote servers added as custom connectors (Streamable HTTP + OAuth)Org admins can manage connectors on team/enterprise plans
Claude Codeclaude mcp add (stdio or HTTP), project-scoped .mcp.json/mcp in a session lists servers and tools
ChatGPTRemote MCP servers in apps/connectors (developer mode for custom servers)Check plan availability and current naming
VS Code (GitHub Copilot agent mode).vscode/mcp.json with a servers key and type per entryRequires agent mode for tool calls
Cursor.cursor/mcp.json with mcpServers
Agent SDKs and APIsClaude API MCP connector, OpenAI Responses remote MCP tool, OpenAI Agents SDK, Google ADK, LangGraph adapters, Claude Agent SDKProgrammatic, in your own apps

Local server configuration (stdio)

Most desktop/IDE hosts use the same idea: a command plus args (and optional env). Examples:

{
  "mcpServers": {
    "campaign-analytics": {
      "command": "/absolute/path/to/uv",
      "args": ["run", "--with", "mcp[cli]", "mcp", "run", "/absolute/path/to/server.py"],
      "env": {"ANALYTICS_DSN": "postgresql://readonly@db.internal/analytics"}
    }
  }
}

That shape works for Claude Desktop (claude_desktop_config.json) and Cursor (.cursor/mcp.json). VS Code uses "servers" and adds "type": "stdio". Claude Code needs no file:

claude mcp add campaign-analytics -- uv run --with "mcp[cli]" mcp run /absolute/path/to/server.py

Tips: use absolute paths (hosts start servers from their own working directory), restart the host after editing config (fully quit Claude Desktop), and keep secrets out of files committed to git: reference environment variables or a secret manager.

Remote servers

Remote servers are added by URL (for example https://mcp.example.com/mcp). The host discovers the authorization server via Protected Resource Metadata, runs an OAuth flow in the browser, and stores tokens. For Claude Code: claude mcp add --transport http crm https://mcp.example.com/mcp. Custom connectors in Claude and ChatGPT use the same URL-based approach through their settings UI. Only add remote servers from organizations you trust; the server sees every argument the model sends it.

Using MCP from your own code

Claude API MCP connector (beta at the time of writing): Claude connects to a remote server directly from the Messages API.

import os
import anthropic

client = anthropic.Anthropic()
resp = client.beta.messages.create(
    model=os.environ.get("MODEL", "claude-sonnet-5"),
    max_tokens=4000,
    betas=["mcp-client-2025-11-20"],                  # check current beta name in the docs
    mcp_servers=[{"type": "url", "url": "https://mcp.example.com/mcp", "name": "crm",
                  "authorization_token": os.environ["CRM_MCP_TOKEN"]}],
    tools=[{"type": "mcp_toolset", "mcp_server_name": "crm"}],
    messages=[{"role": "user", "content": "Which deals over £10k are stuck in proposal?"}],
)
print("".join(b.text for b in resp.content if b.type == "text"))

OpenAI Responses API has a remote MCP tool type ({"type": "mcp", "server_label": ..., "server_url": ..., "require_approval": ...}) and the OpenAI Agents SDK offers MCPServerStdio and MCPServerStreamableHttp with approval policies. Google ADK, LangGraph (via adapters) and the Claude Agent SDK (mcp_servers in options) also consume MCP servers. For local servers, prompts or resources, or full control, write your own client (next lesson).

Governance in hosts

  • Prefer org-managed connector lists over individuals adding arbitrary servers.
  • Review each server's tools and scopes before enabling; enable only needed toolsets.
  • Keep "always allow" permissions for read-only tools; require confirmation for writes.
  • Periodically re-review: servers can change tool definitions.

Worked example: rolling one server out to three hosts

A Manchester agency deploys its remote crm server (Streamable HTTP + OAuth via Microsoft Entra ID):

  • Claude (Team plan): admin adds it as an org connector; account managers authenticate once.
  • VS Code (developers): .vscode/mcp.json in the internal tools repo points to the URL.
  • Reporting agent: uses the Claude API MCP connector with a service token scoped to read-only tools.

One server, one audit log, three very different clients. When they renamed a tool, they announced it in a changelog and tested all three hosts first.

Hands-on: connect and verify

  1. Connect your server from module 3 to two hosts (for example Claude Desktop or Claude Code, plus VS Code or Cursor).
  2. In each, confirm the tool list, run the same three prompts, and note differences (does the host show resources? prompts? confirmation dialogs?).
  3. Record which features each host supported.

Pitfalls

  • Relative paths in config; the server silently fails to start.
  • Committing tokens in mcp.json files.
  • Assuming every host supports prompts, resources or elicitation.
  • Letting users connect unknown remote servers to accounts holding sensitive data.

Measuring success

Time for a new user to connect, success rate of first tool call, per-host feature coverage, and number of unmanaged servers in your organization (aim to drive it down).

Key takeaways

  • MCP host support is broad but uneven; verify each host's supported features and transports.
  • Local servers are configured as command plus args; remote servers by URL with OAuth.
  • Use absolute paths, restart hosts after config changes, and keep secrets out of committed config.
  • Your own apps can use MCP via the Claude API connector, OpenAI's remote MCP tool, agent SDKs or a custom client.
  • Govern connectors centrally and require confirmation for write tools.

Check your understanding

Quick questions to lock in the lesson. They don’t count towards your certificate.

  1. A server works when run manually but never appears in Claude Desktop. What is the most common cause?
  2. How are remote MCP servers typically added to hosts?
  3. Which is a sound governance practice for MCP connectors in an organization?

Put it into practice

Connect one server to two different hosts, run the same three prompts in each, and document which MCP features each host supported.

Enrol for free to save your progress

Reading is always free. Enrol to keep your place, take the final assessment and earn a verifiable certificate.