MCP Model Context Protocol in TypeScript: build portable tools across Claude, GPT, and local models

Most MCP tutorials start with npm install @anthropic-ai/sdk and by the third code block they already have business logic coupled to the Anthropic client. You read that right: they teach you the portability protocol using code that isn't portable. And that completely changes how you end up designing your tools when you need to move them.

My thesis is simple and I'll defend it from the design level: the central mistake when implementing MCP tools isn't syntactic or a configuration issue — it's coupling. You put logic inside the SDK handler, and what should be a universal contract becomes code that only works with one provider. The official MCP Specification describes a model-agnostic protocol. Almost nobody designs it that way from day one.

What the MCP spec says — and what it deliberately doesn't

Before any code, it's worth reading the spec for what it actually is: a communication contract, not an implementation framework.