---
title: "MCP servers as agent tools (2026) — Cadenya"
url: "https://cadenya.com/other-content/mcp-servers-as-agent-tools"
description: "How to call a remote MCP server from the OpenAI Agents SDK, the Claude API, the Vercel AI SDK, LangGraph and Spring AI, with tool approval."
---

An agent uses an MCP server as a tool source in two calls: its MCP client lists the server’s tools with `tools/list`, then runs one with `tools/call`, over stdio on a laptop or over Streamable HTTP for a remote MCP server. The latest MCP specification revision, 2026-07-28, makes that HTTP transport stateless, and the OpenAI Agents SDK, the Claude API MCP connector, the Vercel AI SDK, LangGraph and Spring AI each add their own settings for auth, tool filtering and tool approval.

So pick the OpenAI Agents SDK when you want approval policies per MCP tool in Python. Pick the Claude MCP connector when you’d rather write no MCP client at all, the Vercel AI SDK for TypeScript, LangGraph when a paused approval should live in a checkpoint, and Spring AI for a Spring Boot app. And if you’d rather not write the agent loop, Cadenya is a hosted agent loop with approvals, conversation state, resume and model swap built in: it loads a remote MCP server as a tool set, with approval per tool and secrets per tool set. A coding agent can set it up with no account, in a temporary workspace you claim later. [What it offers](#what-does-cadenya-add-to-mcp-servers) is at the end.

Every version and quote below comes from each vendor’s own pages, checked on November 11, 2026.

## How each framework connects to a remote MCP server

How five agent clients and Cadenya call a remote MCP server:

|  | Who calls the MCP server | Transports | Credentials to the server | Picking tools | Approval before a call | Latest release |
| --- | --- | --- | --- | --- | --- | --- |
| OpenAI Agents SDK | Your process (MCPServerStreamableHttp), or the Responses API (HostedMCPTool) | Streamable HTTP, stdio, and SSE | headers in params, such as Authorization: Bearer | tool_filter and create_static_tool_filter | require_approval per server or per tool, plus on_approval_request for hosted tools | openai-agents 0.24.0, October 15, 2026 |
| Claude API MCP connector | Anthropic’s API, inside the Messages request | Streamable HTTP and SSE, at an https:// URL | authorization_token on each server | enabled per tool in mcp_toolset, plus defer_loading for tool search | Client-side MCP helpers let your code run each call | anthropic 2.8.0 (Python), November 10, 2026 |
| Vercel AI SDK | Your process, through createMCPClient | HTTP, SSE, and stdio for local servers | headers or an OAuth authProvider | schemas pulls only the tools you define | toolApproval on streamText, which can read readOnlyHint | @ai-sdk/mcp 2.0.96, November 10, 2026 |
| LangChain and LangGraph | Your process, through MCPAdapter (built on FastMCP) | Inferred from the target: an https URL, a script over stdio, or an MCPConfig dict | ”Bearer tokens, OAuth 2.1, and per-user server auth” | The list from adapter.list_tools() | HumanInTheLoopMiddleware with a checkpointer | langchain 1.5.0 and langgraph 1.2.20 |
| Spring AI | Your Spring Boot app, through spring-ai-starter-mcp-client | stdio, SSE, Streamable HTTP and Stateless Streamable HTTP | A McpSyncHttpClientRequestCustomizer or a WebClient ExchangeFilterFunction, per request | An McpToolFilter bean | Your own loop around ToolCallingManager | 2.0.2, October 23, 2026 |
| Cadenya | The hosted agent loop, from an MCP tool set | A remote MCP URL such as https://mcp.example.com/mcp, synced each hour or just in time | Tool set headers that read secrets from the workspace, the tool set or the objective | Include and exclude filters on name, description and title, plus progressive discovery | Required on every tool or on tools that match a filter, with a memo on deny | SDKs at 1.9.0 for TypeScript, Python, Ruby and Go |

To build the MCP server itself from an OpenAPI spec, see [OpenAPI specs as agent tools and MCP](/other-content/openapi-specs-as-agent-tools-and-mcp). This page covers the client side.

## What changed in the 2026-07-28 MCP revision

“The **current** protocol version is **2026-07-28**,” per the MCP versioning page. The revision before it is 2025-11-25.

**The big change: a remote MCP server no longer holds a session.** The changelog removes “protocol-level sessions and the `Mcp-Session-Id` header” and the `initialize` handshake. For an agent’s MCP client, that means:

1.  **Every POST stands alone.** “Every request now carries its protocol version and client capabilities in `_meta`,” and each POST carries `MCP-Protocol-Version`, `Mcp-Method` and, for `tools/call`, `Mcp-Name` headers.
2.  **Discovery is one call.** Servers “MUST implement” `server/discover`, which returns the server’s protocol versions, capabilities and identity.
3.  **No stream resume.** The revision removes “the `Last-Event-ID` header and SSE event IDs,” so a client “MUST re-issue” a request whose stream breaks.
4.  **Questions come back as results.** A server that needs input returns an `InputRequiredResult`, and the client retries the call with `inputResponses`.
5.  **Long jobs moved to an extension.** Tasks now live in `io.modelcontextprotocol/tasks`.

The old HTTP+SSE transport is now formally Deprecated, so pick Streamable HTTP for a new remote MCP server.

## MCP SDK releases

From each registry:

| SDK | Package | Latest | Released | Needs |
| --- | --- | --- | --- | --- |
| TypeScript | @modelcontextprotocol/client | 2.4.0 | October 23, 2026 | Node 20 or later |
| TypeScript, 1.x line | @modelcontextprotocol/sdk | 1.32.2 | October 23, 2026 | Node 18 or later |
| Python | mcp | 2.3.0 | October 2, 2026 | Python 3.10 or later |
| Java | io.modelcontextprotocol.sdk:mcp | 2.1.0 | October 15, 2026 |  |
| Go | github.com/modelcontextprotocol/go-sdk | v1.8.0 | September 4, 2026 |  |
| Ruby | mcp gem | 1.10.0 | November 11, 2026 | Ruby 2.7 or later |

The Python SDK’s v2.0.0 release shipped on July 28, 2026, and “supports the 2026-07-28 revision of the Model Context Protocol and serves every earlier revision from the same server.” The TypeScript SDK’s 2.x packages serve 2026-07-28 connections too.

## OpenAI Agents SDK MCP: HostedMCPTool, MCPServerStreamableHttp and require\_approval

The OpenAI Agents SDK gives you two ways in. `HostedMCPTool` lets “OpenAI’s Responses API call a publicly reachable MCP server on the model’s behalf,” and the model “invokes them without an extra callback to your Python process.” `MCPServerStreamableHttp` connects from your own process, with the token in a header:

```
async with MCPServerStreamableHttp(
    name="Streamable HTTP Python Server",
    params={
        "url": "http://localhost:8000/mcp",
        "headers": {"Authorization": f"Bearer {token}"},
        "timeout": 10,
    },
    cache_tools_list=True,
    max_retry_attempts=3,
) as server:
    agent = Agent(name="Assistant", mcp_servers=[server])
```

**Tool approval for MCP calls is a setting on the server object.** `MCPServerStdio`, `MCPServerSse` and `MCPServerStreamableHttp` “all accept `require_approval`”: `"always"`, `"never"`, a map per tool, or a callable. From the docs:

```
async with MCPServerStreamableHttp(
    name="Filesystem MCP",
    params={"url": "http://localhost:8000/mcp"},
    require_approval={"always": {"tool_names": ["delete_file"]}},
) as server:
    ...
```

One catch: a local `require_approval` callable “does not receive the specific call’s arguments or call ID.” It decides per tool. For hosted tools, `require_approval` goes in `tool_config`, and an `on_approval_request` callback can return `{"approve": False, "reason": "Escalate to a human reviewer"}`. The SDK works with both `mcp>=1.19.0,<2` and `mcp>=2,<3`.

## Claude API MCP connector: mcp\_servers, mcp\_toolset and authorization\_token

The Claude MCP connector lets you “connect to MCP servers without implementing an MCP client.” You list servers in `mcp_servers`, add a matching `mcp_toolset` to `tools`, and send the `mcp-client-2026-09-15` beta header, which replaces `mcp-client-2025-11-20`. From the docs:

```
curl https://api.anthropic.com/v1/messages \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2026-10-21" \
  -H "anthropic-beta: mcp-client-2025-11-20" \
  -d '{
    "model": "claude-opus-5-5",
    "max_tokens": 1000,
    "messages": [{"role": "user", "content": "What tools do you have available?"}],
    "mcp_servers": [
      {
        "type": "url",
        "url": "https://example-server.modelcontextprotocol.io/sse",
        "name": "example-mcp",
        "authorization_token": "YOUR_TOKEN"
      }
    ],
    "tools": [{"type": "mcp_toolset", "mcp_server_name": "example-mcp"}]
  }'
```

The server’s URL “must start with `https://`.” Each tool takes `enabled` (for allowlists and denylists) and `defer_loading`, which keeps a description out of the prompt until the tool search tool finds it.

The `mcp-client-2026-09-15` header adds a `tools` field with “a pinned copy of the server’s tool list,” so a server that changes its tools mid-conversation doesn’t change what Claude sees.

## MCP tool approval in the Vercel AI SDK, LangGraph and Spring AI

The MCP spec says “there **SHOULD** always be a human in the loop with the ability to deny tool invocations,” and also that clients “**MUST** consider tool annotations to be untrusted unless they come from trusted servers.” So every client treats `readOnlyHint` and `destructiveHint` as input to your policy, not as the policy.

**Vercel AI SDK.** `createMCPClient` from `@ai-sdk/mcp` supports “stateless MCP `2026-07-28`,” and the docs warn that stdio “cannot be deployed to production environments.” Approval is the `toolApproval` option on `streamText`. This policy, adapted from the docs, runs only tools the server marks read-only:

```
const result = streamText({
  model,
  tools,
  toolApproval: ({ toolCall }) => {
    const annotations = (
      toolCall.toolMetadata as McpProviderMetadata | undefined
    )?.annotations;

    return annotations?.readOnlyHint === true
      ? 'not-applicable'
      : { type: 'user-approval', reason: 'Not marked read-only.' };
  },
  prompt,
});
```

**LangChain and LangGraph.** Install `langchain[mcp]` (version 1.4.0 or later), open an `MCPAdapter` on a URL, and pass `await adapter.list_tools()` to `create_agent`. LangChain has a migration guide from the older `langchain-mcp-adapters` package. For approval, `HumanInTheLoopMiddleware` takes `interrupt_on` with a `when` predicate that can read the MCP destructive hint and the call’s arguments. “Human-in-the-loop requires checkpointing to handle interrupts,” and you resume with `Command(resume={"decisions": [{"type": "approve"}]})`.

**Spring AI.** The `spring-ai-starter-mcp-client` 2.0.2 starter depends on Spring Boot 4.1.2, per its POM on Maven Central. Connections live in YAML:

```
spring:
  ai:
    mcp:
      client:
        streamable-http:
          connections:
            server1:
              url: http://localhost:8080
```

The starter exposes MCP tools as a `ToolCallbackProvider`. To gate a call, the tools page lists “gating tool execution on an external approval step” as a reason to set `AdvisorParams.toolCallingAdvisorAutoRegister(false)` and run each call through `ToolCallingManager` yourself.

## MCP OAuth for a remote MCP server: what the client sends

“Authorization is **OPTIONAL** for MCP implementations,” and stdio servers “retrieve credentials from the environment.” On HTTP, a protected remote MCP server follows OAuth 2.1:

1.  **The server publishes where to sign in.** “MCP servers **MUST** implement OAuth 2.0 Protected Resource Metadata (RFC9728).”
2.  **The client names the server.** Clients “**MUST** implement Resource Indicators for OAuth 2.0” (RFC 8707), so each token is issued for one MCP server.
3.  **Every request carries the token.** “Authorization **MUST** be included in every HTTP request from client to server.”
4.  **The server keeps its token to itself.** “MCP servers **MUST NOT** accept or transit any other tokens,” so calls to your own API need a token issued for that API.

Client registration now prefers Client ID Metadata Documents, and Dynamic Client Registration is deprecated. Cadenya’s own MCP server at `https://mcp.cadenya.com/mcp` works this way: app.cadenya.com is the authorization server, and clients register with client ID metadata documents. For the full flow, see [MCP OAuth and per-user auth](/other-content/openapi-specs-as-agent-tools-and-mcp#mcp-oauth-and-per-user-auth-for-remote-mcp-servers). For agents that act as a user, see [AI agents acting on behalf of users](/other-content/ai-agents-acting-on-behalf-of-users).

## What does Cadenya add to MCP servers?

Each client above gives your code an MCP connection, and the loop stays yours. **Cadenya is the agent loop itself, hosted, and a remote MCP server joins it as a tool set.** Here’s what that covers:

1.  **MCP is one of four tool set adapters.** A tool set reads an OpenAPI 3.0 or later spec, an MCP server, HTTP endpoints you define, or Bare tools your app answers.
2.  **Tools synced, not fetched on every run.** Interval syncing caches the server’s tools and checks for changes each hour, so objectives start faster. Just-in-time syncing fits a server that lists different tools for an `admin` and a `member`.
3.  **A header you can verify.** Each sync request carries an `X-Cadenya-Challenge-Token` header, and an account endpoint rotates the token.
4.  **Secrets per tool set.** Put `{{ secrets.MY_SECRET }}` in a tool set header. Cadenya resolves it from the workspace, the tool set, then the objective, and the most specific value wins. An objective secret can hold a short-lived JWT minted for one user.
5.  **Approval per tool.** Require approval for every call, or only for tools that match a filter. The objective emits `toolApprovalRequested`, your backend approves or denies, and a denial carries a memo the agent reads. Several tools can wait at once.
6.  **A smaller context window.** Filter an MCP tool set by name, description and title, and turn on progressive discovery to load tools on demand.
7.  **Conversation state and resume.** Every objective carries a durable event log of its agent loop. Stream new events and resume with the last event ID.
8.  **Model swap with no deploy.** The model is a setting on an agent variation. Connect your own AI provider keys and pay the provider directly.
9.  **An MCP server for your coding agent.** `https://mcp.cadenya.com/mcp` speaks MCP 2026-07-28 over Streamable HTTP and covers the Cadenya API in three tools: `cadenya_discover`, `cadenya_read` and `cadenya_write`. Add it to Claude Code with `claude mcp add --transport http cadenya https://mcp.cadenya.com/mcp`, then sign in or send an API key as a bearer token.

[MCP tool sets](/docs/guides/the-basics/tool-sets#mcp-tool-sets) shows the sync options and the challenge token, and the free plan needs no card.

No account yet? A coding agent can create a temporary workspace with `cadenya workspaces create --temporary`, run its first objectives there, and hand you a link to claim it, as [auth.md](https://cadenya.com/auth.md) explains. To create an account, sign up at [app.cadenya.com/signup](https://app.cadenya.com/signup?utm_source=cadenya.com&utm_medium=article&utm_campaign=mcp-servers-as-agent-tools), then copy your API key from the API keys page at `app.cadenya.com/account/apiKeys`.