Building MCP Servers
Build a CRM MCP server on the current SDKs (Python mcp 2.x, with a TypeScript twin): the smallest server, type hints as the tool schema, rejecting bad input, resources and prompts, running it under the Inspector, and testing it before a model does.
Last updated
After this section you can
- Build an MCP server on the current Python SDK and read the tool schema it derives from your type hints
- Make bad input fail loudly with Literal and Field limits, and say what still needs authorization on the server
- Run the server under the Inspector and test it with an in-memory client before any model calls it
Building MCP Servers: From Eight Lines to Tested
Type hints become the tool schema, bad input fails loudly, and a test finds the first mistake before a model does.
An MCP server is ordinary functions with a decorator. The SDK reads each signature and docstring, publishes it as the tool a model sees, and rejects calls that do not fit. This page builds one for Acme’s CRM on mcp 2.x, revision 2026-07-28, and tests it without a model.
Captured from mcp 2.2.0 and 2.3.0, trimmed (step 2). The host sends the model name, description and inputSchema (Inside a Tool Call); outputSchema is for the client.