Sub topic 1
What MCP is and why it fits team tooling
Your team probably already has scripts, internal APIs, and dashboards that answer questions like "who owns the billing service?" or "what is deployed to staging?" AI assistants can't use those tools unless someone connects them. The Model Context Protocol (MCP) is an open standard for making that connection once and reusing it across many AI applications. This chapter explains what MCP is, what problem it solves, and when it is a good fit for team tooling. The later chapters build a working server.
Prerequisites
This chapter assumes you have the following:
- Working knowledge of Python or TypeScript. The examples use Python.
- A basic understanding of JSON and JSON Schema (the JSON-based format for describing the shape of data).
- Comfort running commands in a terminal.
- A basic idea of how LLM tool calling works: the model is shown a list of functions, and it can ask the application to call one with arguments.
- Experience calling an internal HTTP API or CLI tool, since those are the things you will wrap.
You don't need prior MCP experience.
The problem MCP solves
Tool calling lets a model request that an application run a function. Each AI application historically did this its own way. One expected a custom plugin format, another a particular SDK, and a third a bespoke configuration. If your team has five internal tools and four AI applications, you could end up writing and maintaining twenty integrations. Each new tool or application multiplies the work.
This is the "N times M" integration problem. MCP reduces it to "N plus M". You wrap each tool once as an MCP server. Each AI application implements the MCP client side once. Any compliant application can then talk to any compliant server.
The idea is similar to the Language Server Protocol, which lets any editor use any language's tooling through one interface. MCP does the same for AI applications and external capabilities.
What MCP actually is
MCP is a specification, not a product. It defines:
- A message format. Messages are JSON-RPC 2.0, a simple request and response convention built on JSON. A client sends a request such as "list your tools", and the server sends back a response with a matching ID.
- A session lifecycle. The client and server begin by agreeing on a protocol version and declaring which features each side supports. Chapter 3 covers this.
- A small set of capabilities a server can offer: tools, resources, and prompts.
- Transports, which are the ways bytes move between client and server. The two standard ones are stdio (a local subprocess) and Streamable HTTP (a network service).
The protocol is open, and official SDKs exist for several languages, including Python and TypeScript. Because the wire format is plain JSON-RPC, you can implement it in any language, but the SDKs handle the protocol details so you only write the tool logic.
MCP does not make a model smarter, and it does not execute anything on its own. It is a standard way to describe capabilities and request their use. Your server code still does the real work, and your server code is responsible for doing it safely.
The three things a server can offer
An MCP server exposes capabilities in three categories. They differ mainly in who decides when they are used.
| Capability | What it is | Who controls use | Team example |
|---|---|---|---|
| Tool | A function the model can ask to call, with typed arguments | The model, usually with user approval | `get_service_owner(service)` |
| Resource | Read-only data addressed by a URI | The application or user chooses what to attach | `runbook://billing` |
| Prompt | A reusable instruction template | The user selects it explicitly | An "incident summary" template |
Tools are the center of most servers, and the next chapters spend the most time on them. A tool can have side effects, such as triggering a deploy, so it needs the most care. A resource is passive context, so it is a good fit for documents and reference data. A prompt packages a workflow so that everyone on the team starts from the same wording.
Choosing among them is a design decision you will practice later. A short rule of thumb: if the model should decide to act, make it a tool. If a person or application should decide what context to supply, make it a resource. If a person should kick off a standard workflow, make it a prompt.
How small a server can be
To make the idea concrete, here is a complete server. It uses FastMCP, a helper in the official Python SDK, which you install with pip install "mcp[cli]".
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("team-tools")
OWNERS = {"billing": "payments-team", "search": "discovery-team"}
@mcp.tool()
def get_service_owner(service: str) -> str:
"""Return the team that owns a service, given its short name."""
if service not in OWNERS:
raise ValueError(f"Unknown service: {service}")
return OWNERS[service]
if __name__ == "__main__":
mcp.run() # stdio transport by defaultThree things are worth noticing, and later chapters examine each one:
- The type hint
service: strand the docstring become the tool's input schema and description. The model reads those to decide when and how to call the tool. mcp.run()serves the tool over stdio. The AI application launches this script as a subprocess and talks to it through its standard input and output.- The function body is ordinary Python. In a real server, the dictionary lookup would be a call to your service catalog.
You don't need to run this yet. Chapter 5 walks through it step by step.
Why MCP fits team tooling
MCP is not only for public products. Several properties make it a good match for internal tools.
One integration serves everyone. A server you write for the platform team works in whichever MCP-capable application each teammate prefers. You don't have to standardize on one assistant before you can share tools.
Tools stay where the knowledge lives. The people who understand the deploy API write the server that wraps it. They decide which operations are exposed, what the arguments are, and what the descriptions say. Other teams get a safe, documented surface instead of ad hoc scripts.
It forces a clean contract. Each tool has a name, a description, and a typed schema. Writing that contract is useful even without a model, because it documents what the operation takes and returns.
Access control has a natural home. The server is a single choke point between the model and your systems. It can enforce allowed values, limit what a token can do, and require confirmation for risky actions. Chapter 13 covers this in detail.
Local and shared modes both work. You can start with a local stdio server on your own machine, then move the same tool logic to a Streamable HTTP service that the whole team connects to.
When MCP is not the right tool
MCP adds a moving part, so use it deliberately.
- If a single application needs one fixed function and you control that application's code, a direct function-calling integration may be simpler.
- If the job is a deterministic automation with no model involved, a script or CI job is more appropriate.
- If an operation is dangerous and irreversible, wrapping it in MCP does not make it safe. It makes it easier for a model to reach, so the safeguards matter more.
- MCP tool definitions consume the model's context window. A server with dozens of overlapping tools can make the model choose worse, which chapter 10 addresses.
Roadmap for the rest of the tutorial
The remaining chapters follow the order of building a server: roles and lifecycle, transports, your first tool, schemas, error handling, resources and prompts, design, testing with the MCP Inspector, connecting a host, security, and deployment. By the end you will have a server that exposes a few team tools, has been tested, and is ready to share.
Exercise
Your team has four internal tools and three AI applications. How many custom integrations would you maintain without a shared protocol, and how many implementations with MCP? What changes when you add a fifth tool?
Show answer
Without a shared protocol you need 4 x 3 = 12 integrations. With MCP you write 4 servers and the 3 applications each implement the client side once, so 4 + 3 = 7. Adding a fifth tool costs 5 x 3 = 15 minus 12 = 3 more custom integrations without MCP, but only one new server with MCP, because every existing client can already connect to it.
Exercise
For each need, choose tool, resource, or prompt: (a) let the model trigger a rollback of a staging deploy, (b) give the model the text of the billing runbook, (c) give teammates a standard template for writing incident summaries.
Show answer
(a) Tool, because the model requests an action with side effects and it should be gated by approval. (b) Resource, because it is read-only reference data addressed by a URI. (c) Prompt, because a person explicitly selects a reusable instruction template.