Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Building an MCP Server in TypeScript: Zod Schemas, Tool/Resource Registration and Node.js
For an MCP server in TypeScript you pick the v2 SDK (@modelcontextprotocol/server 2.4.0), which supports 2026-07-28, register tools with Zod 4 schemas and serve them over stdio and Streamable HTTP with serveStdio and createMcpHandler. Comparing the same Bookstore server with its C# version, we see with real output how schemas give different answers to the same input, the Zod 3 incompatibility, distribution with npx and the supply chain risk.
Remote MCP Servers in ASP.NET Core: Streamable HTTP, Stateless Mode, State Handles and Authorization
In ASP.NET Core you build a remote MCP server with WithHttpTransport and MapMcp, run it in stateless mode and protect it as an OAuth resource server: tokens must be issued for this server, and state handles must be bound to the user. With curl output we look at protected resource metadata, the audience error, the cost of statelessness with two instances, asking for confirmation via MRTR with a signed requestState, and Mcp-Method/Mcp-Name header validation.
Building an MCP Server in C#: ModelContextProtocol SDK 2.x, [McpServerTool] and stdio
You build an MCP server in C# with the ModelContextProtocol 2.x package, the Generic Host and the [McpServerTool] attributes; on the stdio transport, logs must go to stderr. We build the Bookstore tools with services from DI, structured output, resources and prompts, test them with MCP Inspector, and see with real output how polluting stdout turns into a one-minute timeout and how culture settings corrupt tool output.