[KongchangAI]
· 2 min read· 1,192 words

Getting Started with Claude Code: Using MCP to Take AI Beyond the Codebase

Getting Started with Claude Code: Using MCP to Take AI Beyond the Codebase

MCP is Anthropic's open protocol that lets AI break free from the codebase and call external tools and services directly.

Model Context Protocol (MCP) is an open protocol from Anthropic that solves the fragmentation problem of integrating AI tools with external systems. By reducing M×N integration complexity to M+N, MCP lets tool providers implement a server once and AI clients call it automatically. It's not a REST API replacement — it's a purpose-built interaction paradigm for AI. Using the MCP SDK, developers can quickly build MCP servers, register tools with names, descriptions, and handlers, and connect to Claude Code via stdio or SSE transport.

Why MCP Matters: Connecting AI to Your Entire Tech Stack

In real-world development, consider an application like an Issue Tracker. The ideal scenario for developers is that others can use its functionality directly — without going through a UI. Especially as AI becomes increasingly widespread, many people prefer to interact with their backend systems through AI rather than clicking through interfaces manually.

The core answer Lydia offers in this comprehensive Claude Code tutorial is the Model Context Protocol (MCP).

Before encountering MCP, most of us used Claude Code strictly within the confines of a code repository — editing files, running commands, reading code. These operations never really escape the repo's boundaries. The value of MCP is that it's a protocol that lets Claude "reach outside the repository" to genuinely interact with the rest of your entire tech stack.

We have to run commands, read code.

What MCP Actually Is: A Standard Interface for AI Tools

Technically, MCP is just a protocol — a specific type of server-side protocol that sits between clients and your backend. Its core idea is straightforward: provide a standardized interface for AI tools.

To understand its significance, you have to return to the root problem. Previously, every tool was reinventing the wheel with its own custom integration approach. Want to integrate with Linear? How exactly do you do that? Call its API directly? Different tools each had their own way of doing things, with no unified standard, making integration costs extremely high.

If we want to integrate with linear, do we call it API?

What MCP does is standardize this across Anthropic, Cursor, and many other tools. In other words, it plays the role of a "universal plug for the AI world."

Lydia mentions a question that once puzzled her: if you're calling a backend anyway, why not just use a REST API? The answer is that MCP isn't trying to replace the technical functionality of REST APIs — it exists as a standard paradigm for AI interaction. This is a crucial conceptual shift: you're not designing an interface for traditional clients, you're designing a unified entry point that AI can understand and invoke.

From a historical perspective, MCP was officially released and open-sourced by Anthropic in November 2024. It draws inspiration from the design philosophy of universal physical connectors like USB-C — before MCP, every AI application needed to write custom integration code for each external data source or tool. Connecting M models to N tools required M×N integration solutions. MCP reduces this to M+N: tool providers only need to implement an MCP server once, and model clients only need to implement an MCP client once, and the two can communicate freely. The protocol is built on JSON-RPC 2.0 and supports three core capability-exposure methods: Tools (functions the AI can actively call), Resources (data sources the AI can read), and Prompts (predefined prompt templates). Major AI development tools including Cursor, Zed, and Claude Desktop already support MCP clients, and the ecosystem is growing rapidly.

What MCP Looks Like in the Real World

For an intuitive sense of how MCP works, observe the behavior when using Claude AI Chat. When you ask it to "draw an Excalidraw diagram," it doesn't directly call some Excalidraw REST API or backend — it calls the MCP that Excalidraw provides.

maybe when you're using Cloud AI Chat or something like that.

This example reveals MCP's operating logic: AI acts as a client, using the standard protocol to invoke external services. Service providers simply need to expose their capabilities according to MCP specifications, and AI can automatically understand and use them. Neither side needs to negotiate custom interface details for each individual integration.

Building in Practice: The MCP SDK and Tool Registration

On the practical development side, Lydia recommends a highly useful NPM package — the Model Context Protocol SDK. She notes that the vast majority of what she needs when building any MCP server comes from this SDK.

The SDK provides several key primitives:

  • Creating a server: Scaffolding the basic skeleton of an MCP service
  • Registering tools: Wrapping your backend capabilities into tools that AI can invoke
  • Connecting a transport: Using server.connect to hook the server into a transport channel

The Complete Tool Registration Flow

Taking a "list issues" tool as an example, registering an MCP tool typically involves these elements:

  1. Name: Here it's named list issues, so Claude knows this tool exists and is available
  2. Description: Clearly explains what this MCP tool can do — this step is critical for AI to invoke it correctly, since AI relies on the description to determine when to use it
  3. Handler: Defines what logic should actually execute when Claude calls this tool

So in this case, we say list issues.

After the handler executes, it needs to return the content type that MCP expects. In this example, it returns a content array with type text, where the content is a stringified version of the issues.

The final step is connecting the server to the transport layer. The example uses stdio server transport, which allows Claude Code to actually establish communication with this MCP server.

On the topic of transport layer selection, MCP supports two primary transport mechanisms: stdio (standard input/output) and SSE (Server-Sent Events). The stdio transport is the preferred choice for local scenarios — Claude Code launches a subprocess and communicates with it through standard input/output, suitable for tools running on the same machine. SSE transport is suited for remote server scenarios, allowing communication with MCP services deployed in the cloud via HTTP long connections. The example uses stdio server transport specifically because it complements how Claude Code works locally — Claude Code starts your MCP server process locally and exchanges JSON-RPC messages with it through a stdio pipe, with no additional network configuration required.

The quality of a tool's description directly determines whether AI can invoke the right tool at the right moment — something that's often underestimated in practice. Since AI relies entirely on descriptions to understand a tool's purpose and applicable scenarios, descriptions should clearly state: what the tool does, what parameters it accepts, when it should be used, and what the return value means. Beyond text descriptions, tool input parameters are typically defined using JSON Schema, specifying the type, whether each parameter is required, and its meaning — essentially giving the AI a "calling manual" that enables it to automatically construct properly formatted invocation requests during reasoning, without any human intervention.

Conclusion: The Paradigm Shift MCP Brings to Development

MCP's significance lies not in introducing complex new technology, but in establishing a unified standard for "AI invoking external capabilities." For developers, this means:

  • Your application can serve not just human users, but also become a service that AI can directly invoke
  • The previously fragmented, siloed approach to integrations converges under a single universal protocol
  • With the MCP SDK, the barrier to wrapping existing backend capabilities into AI tools is dramatically lowered

For developers and founders who want their products to ride the AI wave, understanding and implementing MCP is fast becoming a foundational skill.

#MCP#Model Context Protocol#Claude Code#AI tool integration#MCP server#MCP SDK#Anthropic
Share:

Related articles