home / mcp / mcp basic server

MCP Basic Server

MCP Server and Client Implementation using custom client

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "jatindera-mcpbasic": {
      "command": "python",
      "args": [
        "mcp_server.py"
      ]
    }
  }
}

You can run a Python-based MCP server and its client to manage model context locally. This setup lets you start the server in one terminal and interact with it from a separate client session, enabling practical testing and development workflows.

How to use

Start the MCP server in a dedicated terminal, then open a second terminal to run the MCP client. Use the client to send requests to the running server and receive responses that help you manage model context. Begin with creating some context entries, querying existing ones, updating metadata, or removing entries as you iterate your workflow. Remember to keep the server running in one session while you perform client operations in another.

How to install

Prerequisites: Python 3.x.

Create a virtual environment in your project directory.

python -m venv venv

Activate the virtual environment.

# Windows
venv\Scripts\activate

# macOS/Linux
source venv/bin/activate

Install required packages inside the virtual environment.

pip install -r requirements.txt

Run the MCP server in one terminal.

python mcp_server.py

In a separate terminal, run the MCP client to interact with the running server.

python mcp_client.py

Notes

The server and client scripts are designed to be run locally for development and testing. Ensure you keep the server running while you issue client requests to avoid connection errors.