Scroll to navigation

MCP(1) User Manual MCP(1)

NAME

mcp - Model Context Protocol development tools

SYNOPSIS

mcp [OPTIONS] COMMAND [ARGS]...

DESCRIPTION

mcp is a command-line interface for working with the Model Context Protocol (MCP). MCP allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction.

The mcp command provides tools for developing, running, and installing MCP servers.

COMMANDS

version

mcp version [OPTIONS]

Show the MCP version.

Show this message and exit.

dev

mcp dev [OPTIONS] FILE_SPEC

Run an MCP server with the MCP Inspector.

Python file to run, optionally with :object suffix
Directory containing pyproject.toml to install in editable mode
–with TEXT
Additional packages to install
Show this message and exit.

The dev command launches the server with the official MCP Inspector (@modelcontextprotocol/inspector), which provides a web-based interface for testing and interacting with your MCP server during development. Requires Node.js and npm to be installed on your system.

run

mcp run [OPTIONS] FILE_SPEC

Run an MCP server.

Python file to run, optionally with :object suffix
Transport protocol to use (stdio or sse)
Show this message and exit.

The server can be specified in two ways:

1.
Module approach: server.py - runs the module directly, expecting a server.run() call.
2.
Import approach: server.py:app - imports and runs the specified server object.

Note: This command runs the server directly. You are responsible for ensuring all dependencies are available. For dependency management, use mcp install or mcp dev instead.

install

mcp install [OPTIONS] FILE_SPEC

Install an MCP server in the Claude desktop app.

Python file to run, optionally with :object suffix
Custom name for the server (defaults to server’s name attribute or file name)
Directory containing pyproject.toml to install in editable mode
–with TEXT
Additional packages to install
Environment variables in KEY=VALUE format
Load environment variables from a .env file
Show this message and exit.

Environment variables are preserved once added and only updated if new values are explicitly provided. Requires the Claude desktop application to be installed on your system.

FILE SPECIFICATION

Both dev and run commands accept a file specification that can optionally include a server object name:

Runs the file directly. The file must be a valid Python file.
Runs the specified server object from the file.

If no object is specified, the command will automatically try common server object names: mcp, server, or app.

EXAMPLES

Display the installed MCP version.
Run an MCP server from server.py, auto-detecting the server object.
Run the `mcp' server object from server.py.
Run a server using stdio transport.
Run a server with the MCP Inspector for development.
Run a server in the current directory as editable with additional dependencies.
Install a server in Claude with custom name, environment variables, and variables from a .env file.

AUTHORS

Written by Anthropic, PBC.

BUGS

Submit bug reports online at: https://github.com/modelcontextprotocol/python-sdk/issues

June 27, 2026 mcp 1.28.0