MCP -and-client-Implementation-on-Linux
MCP Server and client Implementation on Linux (Rather then using Claude Desktop)
claude mcp add --transport stdio scholarly360-mcp-server-and-client-implementation-on-linux python mcp_server_explore.py \ --env PATH="Include the virtual environment bin directory (e.g., .venv/bin) in PATH" \ --env VIRTUAL_ENV="Path to the virtual environment (e.g., .venv) if applicable"
How to use
This MCP server setup provides a Linux-oriented workflow for developing and running an MCP server along with a client. The repository demonstrates creating isolated Python environments, installing the MCP CLI extension, and wiring up a simple server script (mcp_server_explore.py) that can interact with an MCP client. The documented approach uses a Python-based runtime with a virtual environment to ensure dependencies are managed separately from the system Python. Tools available include the MCP client/CLI integration (via the mcp[cli] extra) and the ability to run a server script locally for exploration and experimentation. To exercise the workflow, you would typically initialize separate environments for the server and the client, install the required MCP dependencies, and then execute the server or client scripts with the appropriate Python command.
Key capabilities include:
- Creating virtual environments and installing MCP CLI support via uv (uv add "mcp[cli]").
- Preparing separate scripts for server (mcp_server_explore.py) and client (mcp_client_explore.py).
- Running the client with a reference to the server script using the provided uv-based workflow or direct Python invocation.
- Observing interactions between server and client during development to validate MCP protocol exchanges.
How to install
Prerequisites:
- Python 3.10+ installed on your Linux system
- A shell (bash/zsh) available
- Basic familiarity with Python virtual environments
Step-by-step:
-
Install Python virtual environment tooling (if not already available):
- Ensure venv module is available (usually included with Python).
-
Create a server directory and set up a virtual environment: mkdir mcp_server_explore cd mcp_server_explore python3 -m venv .venv source .venv/bin/activate
-
Install MCP CLI dependencies inside the virtual environment: pip install "mcp[cli]"
-
Create a server script (as shown in the repository):
touch mcp_server_explore.py (or copy your server script here)
-
Create a client directory and set up a virtual environment: mkdir ../mcp_client_explore cd ../mcp_client_explore python3 -m venv .venv source .venv/bin/activate
-
Install client dependencies (as shown): pip install mcp python-dotenv anthropic
-
Create a client script (as shown in the repository):
touch mcp_client_explore.py (or copy your client script here)
-
Run the client against the server example: uv run mcp_client_explore.py /workspaces/vsc_dev_mcp_explore/mcp_server_explore/mcp_server_explore.py
Or run directly with Python if you prefer:
python mcp_client_explore.py /workspaces/vsc_dev_mcp_explore/mcp_server_explore/mcp_server_explore.py
Prerequisites recap:
- Python 3.10+ and virtual environments handling (venv)
- Internet connectivity for pip installs
- Basic familiarity with shell commands
Additional notes
Tips and notes:
- Keep server and client in separate virtual environments to avoid dependency conflicts.
- If you change the server script name or path, update the client invocation accordingly.
- The uv-based workflow shown is a convenient way to manage environments and execution, but you can also run Python scripts directly if you prefer standard Python workflows.
- For troubleshooting, ensure that the virtual environment is activated before installing dependencies and running scripts. Mismatched Python versions can cause import errors for mcp[cli] or other dependencies.
- If you see path issues, use absolute paths for both server and client script references in the run command.
- The configuration can be extended with environment variables (e.g., API keys or model IDs) by adding an env block under the mcpServers entry.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP