- Home
- MCP servers
- Mcpserver
Mcpserver
- python
0
GitHub Stars
python
Language
6 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"justineqinlao-mcpserver": {
"command": "python",
"args": [
"server.py"
]
}
}
}You can run a lightweight MCP server locally to expose a set of tools and prompts that you can access from MCP clients. This setup uses FastMCP to expose Python-based tools and a demo server with resources and prompts, making it easy to experiment, automate tasks, and integrate with other systems.
How to use
Choose how you want to run the MCP server. You have two local entry points: a minimal tool server and a demo server with resources and prompts. Start the server you need, then connect your MCP client to it using the appropriate configuration. The tools and endpoints exposed are designed to be straightforward to call from your client, enabling you to run operations like greeting users, performing arithmetic, or listing files.
How to install
Prerequisites you need before starting are Ubuntu 22.04 or newer, Python 3.12 or newer, and Git. Optional tooling can speed up dependency management.
Step 1: Install system prerequisites
sudo apt update
sudo apt install -y python3.12 python3.12-venv git
Step 2: Create and activate a virtual environment
python3.12 -m venv venv
source venv/bin/activate
Step 3: Install dependencies
pip install --upgrade pip
pip install "mcp[cli]>=1.25.0"
Step 3b: Optional enhanced setup with uv
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv venv
source venv/bin/activate
uv pip install "mcp[cli]>=1.25.0"
Step 4: Run the minimal tool server
source venv/bin/activate
python server.py
Step 5: Run the example server with resources and prompts
source venv/bin/activate
python main.py
Additional content
The two local entry points expose different capabilities. The minimal tool server provides the tools greet_user, add_numbers, and list_files. The example server adds a tool, a named resource, and a prompt to demonstrate richer interactions. You can connect your MCP client to either server depending on whether you need a simple tool surface or a more feature-rich demo.
Configuration and notes
If your MCP client supports a settings file, you can point it to your running server. Create a configuration block that references the Python runtime and the script you want to execute. Use absolute paths for the runtime and script if your client requires them.
Example MCP client configuration you can adapt to your environment is shown below.
{
"mcpServers": {
"my_mcp_server": {
"command": "/absolute/path/to/your/project/venv/bin/python",
"args": [
"/absolute/path/to/your/project/server.py"
]
}
}
}
Troubleshooting and tips
If you need to switch machines, recreate the virtual environment and reinstall the MCP CLI tools. Keep your venv out of version control by using a proper ignore setup. If you want to share configurations, export the mcpSettings.json with the correct absolute paths for your new environment.
Available tools
greet_user
Returns a greeting string when given a name, demonstrating a simple callable tool.
add_numbers
Adds two integers and returns the result, illustrating a basic numeric operation tool.
list_files
Lists files in a directory, showing how to access filesystem information through the MCP interface.