Use MCP servers with GPT, Gemini, DeepSeek or a local model

MCP servers connect to the agent harness, not to the model, so any model that can call tools can use them. In OHarness you declare a server once in ~/.oharness/mcp.json and its tools are offered to whichever model is running, switched mid-session or not.

Updated

Deze pagina is in het Engels geschreven. De termen die erin worden uitgelegd zijn de termen waarop in het Engels wordt gezocht, en een vertaalde vakterm is een andere term.

Why the model does not matter

An MCP server exposes tools. The harness connects to it, lists those tools, and presents them to the model in the same tool-calling format as its built-in ones — namespaced as mcp__<server>__<tool>. The model only ever sees tool definitions; it never speaks MCP itself. That is why the same server works under Claude, GPT, Gemini, DeepSeek or a local Qwen.

Declare a server

Both transports are built in — stdio for a local process, Streamable HTTP for a remote server — with no MCP SDK underneath. Put the declaration in ~/.oharness/mcp.json:

{
  "mcpServers": {
    "fs": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
    },
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": { "authorization": "Bearer ${env:GITHUB_TOKEN}" },
      "allowedTools": ["search_*", "get_*"]
    }
  }
}

${env:NAME} is resolved when the server starts, so the file never holds the secret and can be shared or committed. A variable that is not set is named before the connection is attempted. allowedTools narrows what a server may offer.

Use it with any model

oharness -m openai/gpt-5.4-mini

Inside the session, /mcp shows each server and its tool count. Switch with /model google/gemini-3.6-flash or /model ollama/qwen3-coder:30b and the same tools are still there. In the browser and desktop app, the **+** menu in the composer lists connectors and connects one with a click; remote servers that need OAuth open the login in your browser.

Keep MCP tools on a leash

MCP tools pass through the same permission rules as built-in ones, matched by name. Read-only tools can be allowed and writes kept behind a prompt:

{
  "allow": ["mcp__github__get_*", "mcp__github__search_*"],
  "ask":   ["mcp__github__create_*"],
  "deny":  ["mcp__github__delete_*"]
}

Coding agent permissions covers where these rules live and why deny beats everything.

What varies by model

Whether a model uses tools well. Small local models may ignore a tool or pass malformed arguments; OHarness validates arguments before a tool runs and returns the error to the model, which usually recovers. If a model repeatedly fails with a server's tools, it is the model, not the server.

Common questions

Can I use MCP with GPT or Gemini?

Yes, through a harness that has an MCP client. MCP servers connect to the harness, which offers their tools to the model through ordinary tool calling. OHarness does this for OpenAI, Gemini, Anthropic, DeepSeek and any OpenAI-compatible or local model.

Does a local model support MCP?

A local model that supports tool calling can use MCP tools when it runs inside a harness with an MCP client. The model never speaks MCP; OHarness connects to the server and presents its tools to the model.

Where does OHarness read MCP server configuration?

From ~/.oharness/mcp.json under an mcpServers key. Servers added from the browser or desktop connector menu are written there too.

Which MCP transports does OHarness support?

stdio and Streamable HTTP, through its own JSON-RPC client rather than an MCP SDK. Remote servers that require OAuth are logged into through the browser, with tokens stored alongside provider credentials.

Related