---
title: "Use the Model Context Protocol to give · Agent Wranglers"
url: https://agentwranglers.se/playbook/stack/ai-software/mcp-for-tools
updated: 2026-10-21
licence: "All rights reserved"
---

# Use the Model Context Protocol to give agents your tools

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

- Level: Recommended
- Chapter: [AI software](https://agentwranglers.se/playbook/stack/ai-software)
- Rule: Offer tools and data to outside AI agents as a Model Context Protocol server, built on an official MCP SDK.
- Cost: Open source. The protocol is open and the official SDKs are MIT or Apache-2.0 licensed, free to use.
- How: MCP is an open protocol, and its current revision is dated 2026-07-28. Its first revision came out in November 2024, so it fails the five-year test. We accept that because no older standard does this job, and a decision record should say so. Anthropic gave MCP to the Agentic AI Foundation under the Linux Foundation in December 2025. The TypeScript, Python, C#, Go, Rust and Ruby SDKs are Tier 1. In October 2026 the Python `mcp` package had about 65 million weekly downloads. The TypeScript 1.x package had about 39 million, and its 2.x successor `@modelcontextprotocol/server` had about 8 million. The Python and TypeScript 1.x packages are MIT licensed, and the 2.x server is Apache-2.0. Shape each tool as [Design tools like a small public API](https://agentwranglers.se/playbook/ai-features/structured-output-and-tools/tool-design) says. Choose something else when only your own app calls the model. Then pass the tools straight to the provider SDK, with no server in between.
- Check: A test starts the server with the SDK's own client, lists the tools and calls each one once. Every call returns a result that matches the tool's output schema.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### TypeScript example

```ts
import { McpServer } from '@modelcontextprotocol/server';
import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
import * as z from 'zod/v4';

const server = new McpServer({ name: 'example-orders', version: '1.0.0' });

server.registerTool(
  'order_status',
  { description: 'Status of one order by its number', inputSchema: z.object({ orderNumber: z.string() }) },
  async ({ orderNumber }) => ({ content: [{ type: 'text', text: await lookUpStatus(orderNumber) }] }),
);

await server.connect(new StdioServerTransport());
```

### Python example

```python
from mcp.server import MCPServer

mcp = MCPServer("example-orders")

@mcp.tool()
def order_status(order_number: str) -> str:
    """Status of one order by its number."""
    return look_up_status(order_number)
```

## Sources

- [MCP specification](https://modelcontextprotocol.io/specification/latest)
- [MCP SDKs](https://modelcontextprotocol.io/docs/sdk)

## Related rules

- [Describe your MCP tools honestly](https://agentwranglers.se/playbook/website/ready-for-ai-agents/mcp-and-tool-discovery) in Website
- [Design tools like a small public API](https://agentwranglers.se/playbook/ai-features/structured-output-and-tools/tool-design) in AI features

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/stack/ai-software/mcp-for-tools">Agent Wranglers software choices playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Use pgvector in PostgreSQL before a separate vector database](https://agentwranglers.se/playbook/stack/ai-software/pgvector-first)
- Next: [Use your test runner to run evals on a fixed example set](https://agentwranglers.se/playbook/stack/ai-software/evals-in-test-runner)
- [AI software](https://agentwranglers.se/playbook/stack/ai-software)
