This is a basic example of a Model Context Protocol (MCP) server implementation that demonstrates core functionality including tools and resources.
- Initialize the project (Go to any local folder and launch powershell or cmd):
uv init mcp-server-basic
cd mcp-server-basic uv venv
.venv\Scripts\activate- Install dependencies:
uv add "mcp[cli]"or
uv add -r requirements.txtThe server implements the following features:
add(a: int, b: int): Adds two numberssubtract(a: int, b: int): Subtracts second number from first
greeting://{name}: Returns a personalized greeting
To run the server with the MCP Inspector for development:
uv run mcp dev main.pyTo run the server normally:
uv run mcp runTo install the server in Claude desktop app:
uv run mcp install main.py- Open folder/mcp-server-basic in vs code
- open terminal and run below command :
uv run main.py