What a server exchange looks like
An MCP session starts with an initialization handshake. The client and server exchange the protocol version they support and their capabilities. The client then asks the server to list what it offers, for example with tools/list, and receives each tool's name, description and JSON Schema for its inputs. When the model decides to use one, the host sends tools/call with arguments, and the server returns content, which can be text, structured data or references to resources.
The protocol also defines capabilities that flow in the other direction. A server can ask the client for model completions through sampling, the client can tell a server which file system locations it may work in through roots, and newer versions of the specification let a server request extra input from the user through elicitation. Specification versions are identified by date, so check which version both your clients and servers support.
Example: a read-mostly ERP connector
Example: a finance team wants its AI assistant to answer questions about invoices and stock held in its ERP. We would build an MCP server that exposes tools such as search_invoices, get_invoice and get_stock_level, each returning only the fields the role needs. A draft_credit_note tool creates a draft but cannot post it; posting stays in the ERP, behind a person's approval. The server runs remotely over Streamable HTTP, users sign in through OAuth so every call carries their own identity and permissions, and each call is logged with the user, tool, arguments and result size. The same server then works in any MCP-compatible client the team adopts later.
Building and testing servers
Official SDKs exist for several languages, including TypeScript and Python, and the MCP Inspector tool lets developers connect to a server and call its tools by hand. Good server design follows the same rules as good tool use:
- A small number of task-shaped tools rather than one tool per API endpoint.
- Clear descriptions, because the model chooses tools from them.
- Inputs validated on the server, never trusted because a model produced them.
- Errors returned as readable messages the model can act on.
- Pagination and size limits so a single call cannot flood the context window.
Security review checklist
Before connecting a server, internal or third-party, we check where it runs, what credentials it holds and how they are scoped, whether write tools exist and what approves them, whether tool descriptions could change after review, and whether outbound network access is limited. Indirect prompt injection through tool results is the main risk, so data returned by tools must never be treated as instructions. Agent access governance covers these controls across many servers.
MCP connects an agent to tools and data. The Agent2Agent (A2A) protocol addresses a different gap: agents talking to other agents. Many multi-agent systems use both. MCP does not replace APIs; a server usually wraps an existing API with permissions and descriptions suited to models. Gepton designs and hardens servers in MCP connector development.