@maru

MCP v2 and Stateless HTTP — The New Standard for AI Agent Tool Integration
The way AI agents integrate with external tools or databases has historically varied by model, creating significant overhead for developers. The Model Context Protocol (MCP) is rapidly establishing itself as the standard interface to resolve this fragmentation. In particular, the recently released stateless HTTP-based spec candidate and TypeScript SDK v2.0 are eliminating the burden of complex session management, driving a transition toward lightweight, stateless architectures. In this post, we explore the essential shifts in the MCP ecosystem and practical integration patterns that full-stack developers should pay attention to right now.
Transitioning to Stateless HTTP: The End of Session Management and Infinite Scalability
The original MCP specification relied on a session-based approach where clients and servers maintained persistent connections. This made horizontal scaling across multiple servers extremely difficult when moving beyond local development environments into production with increasing traffic.
The newly released 2026-07-28 spec candidate introduces a stateless HTTP transport model to solve these limitations. The key is the complete removal of the complex initial handshake process and the session identifier Mcp-Session-Id.
Now, MCP servers operate independently like standard REST APIs without needing to store state. Developers can freely deploy MCP servers behind round-robin load balancers for flexible scaling based on traffic, making it easy to operate AI tools as stable service layers in cloud-native environments.
Integrating TypeScript SDK v2.0 and Standard Schema v1.0
The core change in the new official TypeScript SDK v2.0 is the full standardization of the tool data validation layer. Previously, developers had to write JSON schemas manually or rely on dedicated adapter packages; now, the SDK has integrated Standard Schema v1.0, the common validation specification for the JavaScript ecosystem, directly into the module.
Thanks to this, you only need to define schemas using tools already widely used in the project, such as Zod, Valibot, or ArkType, and the SDK automatically converts them into runtime validation and static type inference code. This drastically reduces complex validation boilerplate, significantly improving the developer experience.
Below is a simple example of passing a Zod schema directly into the tool configuration block using the @modelcontextprotocol/server package.
import { McpServer } from "@modelcontextprotocol/server";
import { z } from "zod";
const server = new McpServer({
name: "weather-mcp-server",
version: "2.0.0",
});
// Standard Schema v1.0 지원으로 Zod 스키마가 직접 호환됩니다.
server.tool(
"get_weather",
{
city: z.string().describe("날씨를 조회할 도시 이름"),
unit: z.enum(["celsius", "fahrenheit"]).default("celsius"),
},
async ({ city, unit }) => {
return {
content: [{ type: "text", text: `${city}의 현재 온도는 24도(${unit})입니다.` }],
};
}
);As seen here, SDK v2.0 provides flexibility that is no longer tied to specific schema libraries. Developers can quickly build secure MCP tool servers by integrating familiar validation libraries without needing to rewrite existing runtime validation logic.
Client Integration with Vercel AI SDK and LangChain.js
Leading AI frameworks in the JavaScript/TypeScript ecosystem, Vercel AI SDK and LangChain.js, now provide first-class support for the latest MCP specifications, dramatically simplifying client integration.
For the Vercel AI SDK, the @ai-sdk/mcp package provides createMCPClient, which simplifies this process significantly. Clients created by specifying a remote HTTP server URL can dynamically transform server tools into standard AI SDK tool formats without complex handshakes.
Below is a representative integration pattern for dynamically injecting a remote HTTP-based MCP tool into an agent using the Vercel AI SDK.
import { createMCPClient } from '@ai-sdk/mcp';
import { generateText } from 'ai';
const mcpClient = await createMCPClient({
transport: { type: 'http', url: 'https://api.example.com/mcp' }
});
const { text } = await generateText({
model: myModel, // 사전 정의된 AI 모델 객체
tools: await mcpClient.tools(),
prompt: '사용 가능한 도구를 사용해 배송 상태를 조회해줘.'
});Once this code executes, the SDK internally fetches the remote server's tool specifications and immediately connects them to the model's tool-calling cycle.
The LangChain.js camp has also introduced the @langchain/mcp-adapters package to enhance flexibility in multi-agent workflows. This lightweight adapter converts remote and local MCP tool interfaces into native LangChain Tool classes in real-time. This allows developers to instantly inject and utilize external MCP tools without modifying complex existing workflows or state machine structures.
From UI Rendering to Local Execution: MCP Apps and Code Mode
Architectural innovation is moving beyond simple text responses, with agents now capable of rendering UIs directly for users or executing code locally. The most notable shifts in the recent agent ecosystem can be summarized as the MCP Apps pattern led by Vercel and the Code Mode pattern from Cloudflare.
Vercel's MCP Apps involve agent tools returning sandboxed HTML UI resources instead of plain text. Because conversational interfaces are rendered in real-time within an iframe inside the browser, it provides a rich, visual user experience instantly. However, since the client browser must dynamically render external code, developers are responsible for implementing strict iframe security policies.
Conversely, the Code Mode proposed by Cloudflare focuses on dramatically reducing latency and API costs. Previously, inefficient round-trips were required where the model had to communicate repeatedly to combine tools and pass back results. In Code Mode, the model leverages MCP APIs provided by the client to write TypeScript code that can be executed locally in one go, taking control to execute it directly. While this approach replaces multiple network round-trips with a single code generation step, it carries a security burden: you must build a robust, isolated sandbox infrastructure to safely execute arbitrary code written by the model.
Conclusion: Building Lightweight and Simple Stateless AI Infrastructure
MCP is moving beyond a simple local development tool to become the standard specification for stateless agents capable of horizontal scaling in large-scale cloud infrastructure. This evolution—stripping away the hassle of session maintenance and moving to standard HTTP specs and TypeScript SDK v2.0—provides a clear milestone for engineers designing scalable AI applications.
As a full-stack developer, instead of implementing disparate tool integration logic for every framework, it is now best to focus on building a standardized MCP layer. I encourage you to experience firsthand the high productivity and stability that a simple yet robust stateless architecture offers.
Reference Links