home / mcp / akshayarav mcp server

Akshayarav MCP Server

My implementation of an MCP server using Python. This is just a way for me to learn about the technology and how it works.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "akshayarav-mcp": {
      "command": "python3",
      "args": [
        "src/mcp_server.py"
      ],
      "env": {
        "PYTHONPATH": "{project_path}/src"
      }
    }
  }
}

You run a lightweight MCP server locally to connect an AI model to a set of simple tools. This server speaks the MCP protocol over stdio, letting you send JSON-RPC style requests and receive responses from a Python process. It’s designed to be easy to extend and to serve as a learning model for MCP internals while remaining practical for experimenting with tools like reading and writing files or listing directories.

How to use

You will start the MCP server locally from your project and connect to it from an MCP client. Use the local stdio configuration to launch the Python process that runs the MCP server and supplies the available tools to the client. Once running, the client can request greetings, read and write files, list directories, and perform basic directory operations through the server.

How to install

Prerequisites you need on your machine before starting are Python 3 and a working shell. You will also create and activate a virtual environment to isolate dependencies.

# Create virtual environment
python3 -m venv mcp-venv
# Activate virtual environment
source mcp-venv/bin/activate  # On macOS/Linux
# or
mcp-venv\Scripts\activate     # On Windows
# Install required packages
pip install -r requirements.txt
# Test server starts correctly
python3 src/mcp_server.py

Additional notes

Configuration for integrating with a client app can include environment variables. For example, when launching the server from a desktop configuration, you might set PYTHONPATH to point at your source directory so the server can find its modules.

Configuration example and testing workflow

This example shows how to configure the local MCP server for a client that wants to start the server via a stdio command and an environment variable.

Security and debugging considerations

Run the server in a trusted environment, keep the virtual environment isolated, and avoid exposing the local MCP server to untrusted networks during development. Use standard debugging practices to inspect requests and responses from the client to ensure the tools behave as expected.

Troubleshooting tips

If the server fails to start, verify that the Python interpreter is accessible as python3, the virtual environment is activated, and the required dependencies in requirements.txt are installed. Check that the path to src/mcp_server.py is correct and that there are no syntax errors or missing modules.

Examples and usage with the client

You can request a greeting, read a file, or list a directory through the MCP client once the server is running. Use the client’s available endpoints to interact with the tools exposed by the MCP server.

Testing with MCP Inspector

If you want to validate the MCP server using a dedicated inspector tool, install the inspector globally and run it against your local Python process to exercise the server end-to-end.

Unit tests

Run unit tests to ensure the server components behave as expected during development.

Available tools

greeting

Returns a greeting message from the MCP server

read_file

Reads contents of a file within allowed paths

write_file

Writes content to files at allowed locations

list_directory

Lists files and directories within a given directory

create_directory

Creates a new directory