Tool cheatsheet
Model Context Protocol (MCP) 1 Cheatsheet
Build MCP servers in Python and TypeScript, test them with the Inspector, and connect them to Claude Code and Claude Desktop.
Python server
- Install the Python SDK — Install the SDK with its command-line tools.
- Create a Python server with a tool — Define a function the model can call. The docstring and type hints become the tool's description and schema.
- Expose a resource — Share read-only data that clients can load into context, here with a URI template.
- Expose a prompt template — Offer a reusable prompt that clients can show to users.
- Serve over HTTP — Run the server as a remote endpoint with the streamable HTTP transport instead of stdio.
- Log without breaking stdio — A stdio server must not write to stdout, which carries protocol messages. Log to stderr.
- Test with the dev server — Run the server with the MCP Inspector attached.
- Install into Claude Desktop — Register the server in Claude Desktop's configuration.
TypeScript server
- Install the TypeScript SDK — Install the SDK and Zod, used to describe tool inputs.
- Create a TypeScript server with a tool — Register a tool with a Zod input schema and run the server over stdio.
Testing and debugging
- Inspect a Python server — Open the MCP Inspector in the browser to list and call a server's tools, resources and prompts.
- Inspect a Node.js server — Inspect a built TypeScript server.
- List tools with a raw request — The JSON-RPC message a client sends to ask a server which tools it has.
- Call a tool with a raw request — The JSON-RPC message that calls a tool with arguments.
- Read Claude Desktop's MCP logs (macOS) — Follow the server logs when a server doesn't show up in Claude Desktop.
Connecting to Claude Code
- Add a remote HTTP server — Connect Claude Code to a remote MCP server by URL.
- Add a local stdio server — Run a local server as a subprocess. Everything after -- is the command that starts it.
- Add your own Python server — Register a server you wrote, started with Python.
- Share a server with your team — Store the server in .mcp.json at the project root, so everyone who clones the repository gets it.
- List configured servers — Show the MCP servers Claude Code knows about.
- Show one server's details — Print a server's configuration and status.
- Remove a server — Remove a server from the configuration.
- Check server status inside Claude Code — Type this in a session to see connection status and authenticate with remote servers.
- Configure servers in .mcp.json — A project-level configuration file. It can expand environment variables so secrets stay out of the file.
Connecting to Claude Desktop
- Add a server to Claude Desktop — Add this to claude_desktop_config.json, then restart Claude Desktop. On macOS the file is in ~/Library/Application Support/Claude/.
Related cheatsheets
- Ansible 2 cheatsheet — Run ad-hoc commands and playbooks, manage inventories, roles, collections and secrets with Ansible.
- Argo CD 3 cheatsheet — Install Argo CD, define Applications declaratively, and manage sync, diffs, history and rollbacks with the argocd CLI.
- AWS CLI 2 cheatsheet — Configure credentials and manage S3, EC2, Lambda, logs, containers and secrets with the AWS CLI v2.
- Azure CLI 2 cheatsheet — Sign in and manage resource groups, VMs, web apps, storage, Kubernetes, registries and secrets with the az command.
- Bash and Linux 5 cheatsheet — Everyday shell and Linux commands for files, searching text, permissions, processes and servers.
- Claude API cheatsheet — Call Claude from Python, TypeScript or curl: messages, streaming, thinking, tools, structured output, caching, batches and error handling.