MCP.so
Sign In

MCP Server Demo in python

@Perteghella

Basic information

Category

Other

Transports

stdio

Author

Perteghella

About MCP Server Demo in python

Simple implementation of a Model Communication Protocol (MCP) server using Python over the network using sse transport

MCP Server Demo in python config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "MCP-Server-python": {
      "command": "python3",
      "args": [
        "-m",
        "venv",
        ".venv"
      ]
    }
  }
}

MCP Server Demo in python tools

Tool list not available yet

This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

Overview

What is MCP Server Demo in python?

The MCP Server Demo in python is a basic demonstration implementation of a Model Communication Protocol (MCP) server using Python. It is designed for testing and development purposes, running by default with uvicorn on port 8000 and supporting both stdio (default) and sse transports for network exposure.

How to use MCP Server Demo in python?

Create and activate a virtual environment, install dependencies from requirements.txt, then start the server with python3 server.py. Verify it is running on port 8000 using curl http://0.0.0.0:8000/sse. To integrate with tools like Cursor or Claude, configure a mcp.json file with transport "sse" and URL "http://localhost:8000/sse".

Key features of MCP Server Demo in python

  • Adds and subtracts numbers via add() and subtract()
  • Provides a greeting endpoint get_greeting()
  • Input validation and type error handling
  • Handles edge cases with large numbers
  • Exposes SSE transport for network access
  • Includes a comprehensive pytest test suite

Use cases of MCP Server Demo in python

  • Testing the basic functionality of an MCP server
  • Demonstrating how to expose an MCP server over a network
  • Integrating with MCP clients like Cursor or Claude
  • Developing and debugging MCP client implementations
  • Learning MCP server setup and configuration

Frequently asked questions

1

What transports does the server support?

By default it uses `stdio` transport. To expose it over the network, configure it to use `sse` transport.

2

How do I expose the server over the network?

Set the transport to `sse` (for example, in the `mcp.json` configuration) so the server listens on port 8000 with uvicorn.

3

How can I verify the server is running?

Use `curl http://0.0.0.0:8000/sse` to test the SSE endpoint, or check active connections with `netstat -n | grep 8000`.

4

How do I run the test suite?

After installing dependencies, run `pytest -v` or `pytest --cov=.` for verbose output or coverage report.

5

How do I integrate this server with Cursor or Claude?

Create a `mcp.json` file with an `mcpServers` entry using `"transport": "sse"` and `"url": "http://localhost:8000/sse"`.

Comments

More Other MCP servers