cheat-sheets

Model Context Protocol (MCP)

An open protocol that lets AI clients (Claude Code, Claude Desktop, IDEs, Open WebUI and others) call tools and read data exposed by servers. Use it to give an agent controlled access to files, Git hosts, databases and your homelab.

Documentation: modelcontextprotocol.io · Claude Code MCP docs · Reference servers

Verification: claude mcp commands were checked against claude --help. Protocol concepts and the config shape are from the official docs. Package names of third-party servers change; confirm each before use (marked (unverified)).

Concepts #

TERMMEANING
Client / hostThe app the user talks to (Claude Code, Claude Desktop)
ServerA process that exposes capabilities
ToolsActions the model can call
ResourcesData the client can read
PromptsReusable prompt templates the server offers
Transport stdioClient launches the server locally and talks over stdin and stdout
Transport streamable HTTPRemote server over HTTP; the current remote transport
Transport SSEOlder remote transport, deprecated in favour of HTTP

Add Servers in Claude Code #

COMMANDDESCRIPTION
claude mcp add --transport http NAME URLRemote HTTP server
claude mcp add NAME -e KEY=VALUE -- COMMAND ARGSLocal stdio server (everything after -- is the command)
claude mcp add -s project NAME ...Write to .mcp.json so the team shares it
claude mcp add-json NAME 'JSON'From a JSON definition
claude mcp list / claude mcp get NAMEInspect and health check
claude mcp login NAMEComplete OAuth for a server
claude mcp remove NAMERemove
/mcp (in a session)Status, authenticate, enable or disable

Scopes: local (default, you in this project), project (.mcp.json, shared), user (all your projects).

Config File #

.mcp.json in the project root (Claude Code) and the mcpServers block in Claude Desktop’s config use the same shape.

json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/srv/DATA_DIR"]
    },
    "example-remote": {
      "type": "http",
      "url": "https://mcp.example.com/mcp"
    },
    "example-local": {
      "command": "/usr/local/bin/SERVER_BINARY",
      "env": { "API_TOKEN": "${API_TOKEN}" }
    }
  }
}

Reference environment variables rather than pasting tokens. Do not commit secrets in .mcp.json.

Common Servers #

SERVERPURPOSE
@modelcontextprotocol/server-filesystemRead and write a limited set of directories
@modelcontextprotocol/server-memorySimple knowledge-graph memory (unverified)
@modelcontextprotocol/server-fetchFetch web pages (unverified: the reference fetch server is Python, run through uvx)
GitHub’s MCP serverIssues, pull requests and repos (unverified: see the github/github-mcp-server repo)
Context7Current library documentation (unverified)
Playwright MCPBrowser automation (unverified)

Safety #

  • A server runs with your privileges (stdio) or holds your tokens (remote). Install only servers you trust and pin versions.
  • Restrict filesystem servers to specific directories, not / or $HOME.
  • Prefer read-only credentials. Tool output can contain prompt injection, so keep write access narrow.
  • Debug a server with the MCP Inspector: npx @modelcontextprotocol/inspector (unverified).

See Also #

Search all sheets

Tip: / or Ctrl/Cmd+K to open, Esc to close.