mcpField
M
MCP Server Basic Example

MCP Server Basic Example

Local
github.com/ugundharDeveloper Tools0Updated 78w ago

About MCP Server Basic Example

MCP Server Basic Example is a basic implementation demonstrating an MCP server's tools and resources. It provides arithmetic tools and a personalized greeting resource for development and connection to MCP clients.

Key features

  1. 01Add two integers
  2. 02Subtract one integer from another
  3. 03Return a personalized greeting resource
  4. 04Run with MCP Inspector

Use cases

  1. 01Test arithmetic tools through an MCP client
  2. 02Develop and inspect a basic MCP server

MCP support

The server exposes two arithmetic tools and a greeting resource to MCP clients. The README describes running it with MCP Inspector and installing it in Claude Desktop.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP Server Basic Example

This is a basic example of a Model Context Protocol (MCP) server implementation that demonstrates core functionality including tools and resources.

Setup Steps

  1. Initialize the project (Go to any local folder and launch powershell or cmd):
uv init mcp-server-basic
cd mcp-server-basic
  1. Create virtual environment and activate it

  uv venv
  .venv\Scripts\activate
  1. Install dependencies:
uv add "mcp[cli]"

or

uv add -r requirements.txt

Features

The server implements the following features:

Tools
  • add(a: int, b: int): Adds two numbers
  • subtract(a: int, b: int): Subtracts second number from first
Resources
  • greeting://{name}: Returns a personalized greeting

Running the Server

To run the server with the MCP Inspector for development:

uv run mcp dev main.py

To run the server normally:

uv run mcp run

To install the server in Claude desktop app:

uv run mcp install main.py

MCP connect in VS code

  • Open folder/mcp-server-basic in vs code
  • open terminal and run below command :
uv run main.py
  • Click Cntrl+Shift+I to launch chat in vs code
  • Do login with Github and setup
  • Folow the below steps (two way to add mcp configuration for vs code user settings):

#hello from mcp

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.