Skip to main content
Glama
amoghmadireddi

mcp-intro

mcp-intro

A minimal Model Context Protocol server built with the official Python SDK (mcp 2.x). It exposes two tools, one resource, and one prompt so you can see each MCP primitive working end to end.

Contents

Path

Description

server.py

The MCP server. Defines the add and greet tools, a config://version resource, and a summarize prompt, then runs over stdio.

client_demo.py

A pure-Python client that spawns server.py over stdio and calls every primitive. Useful for a quick smoke test with no Node required.

requirements.txt

Python dependencies — just mcp[cli], which pulls in the SDK and the mcp command-line tool.

.gitignore

Ignores the virtualenv and Python bytecode.

.venv/

Local virtual environment (not committed).

Related MCP server: MCP Server Basic Example

What the server provides

  • Tools

    • add(a: int, b: int) -> int — returns a + b.

    • greet(name: str) -> str — returns "Hello, {name}!".

  • Resource

    • config://version — returns the server version string ("1.0.0").

  • Prompt

    • summarize(text: str) — a reusable prompt template that asks the model to summarize text in one sentence.

Setup

Requires Python 3.13+ (the checked-in .venv uses 3.13).

cd /Users/amoghmadireddi/pl/mcp-intro

# Create the virtualenv if it does not already exist
python3 -m venv .venv

# Install dependencies
./.venv/bin/python -m pip install -r requirements.txt

Running the server

The server speaks the stdio transport, so it is normally launched by an MCP client rather than run by hand. To start it directly:

./.venv/bin/python server.py

It will sit waiting for MCP protocol messages on stdin/stdout — this is expected. Press Ctrl+C to stop.

Quick smoke test (pure Python)

./.venv/bin/python client_demo.py

Expected output:

tools: ['add', 'greet']
add(2, 3) -> 5
greet('Ada') -> Hello, Ada!
resources: ['config://version']
config://version -> 1.0.0
prompts: ['summarize']
summarize(...) -> Summarize the following text in one sentence:

MCP is a protocol.

Using it interactively (MCP Inspector)

The mcp CLI (installed via mcp[cli]) can launch the server with a web-based inspector for poking at tools, resources, and prompts:

./.venv/bin/mcp dev server.py

Requires Node.jsmcp dev shells out to npx to run the MCP Inspector. On macOS: brew install node.

Then open the URL it prints (it includes an auth token and usually opens your browser automatically). Click Connect, then from the inspector you can:

  • call add with e.g. a = 2, b = 3 and see 5

  • call greet with name = "Ada" and see Hello, Ada!

  • read the config://version resource

  • render the summarize prompt with some text

Using it from an MCP client

Register the server with any MCP-capable client (Claude Desktop, Claude Code, etc.) by pointing it at the virtualenv's Python and server.py.

Example client config entry:

{
  "mcpServers": {
    "mcp-intro": {
      "command": "/Users/amoghmadireddi/pl/mcp-intro/.venv/bin/python",
      "args": ["/Users/amoghmadireddi/pl/mcp-intro/server.py"]
    }
  }
}

For Claude Code specifically:

claude mcp add mcp-intro -- /Users/amoghmadireddi/pl/mcp-intro/.venv/bin/python /Users/amoghmadireddi/pl/mcp-intro/server.py

Once connected, the client can list and call the add / greet tools, read the config://version resource, and use the summarize prompt.

Extending it

Add a new tool by writing a function and decorating it:

@mcp.tool()
def multiply(a: int, b: int) -> int:
    """Multiply two numbers."""
    return a * b

The type hints define the input schema and the docstring becomes the tool description shown to clients.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    A demonstration MCP server that provides calculator tools for arithmetic operations, personalized greeting resources, and code review prompt templates. Enables users to perform basic math calculations, generate dynamic greetings, and access reusable code review templates through the Model Context Protocol.
  • A
    license
    Not graded
    quality
    D
    maintenance
    A foundational Model Context Protocol server demonstrating core functionality through basic arithmetic tools and personalized greeting resources. It serves as a template for developers learning to build and deploy MCP-enabled AI applications.
    GPL 3.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    Demonstrates core MCP server functionality with basic arithmetic operations (addition and subtraction) and personalized greeting generation. Serves as an educational template implementing example tools and dynamic resources for MCP server development with Python.
  • F
    license
    Not graded
    quality
    D
    maintenance
    A simple MCP server demonstrating resources, tools, and prompts, including a greeting resource, an addition tool, and a calculation prompt.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/amoghmadireddi/mcp-intro'

If you have feedback or need assistance with the MCP directory API, please join our Discord server