vincentporte/basic_mcp_server
If you are the rightful owner of basic_mcp_server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A lightweight, asynchronous MCP server for e-commerce domain tools, ideal for local development and prototyping.
E-commerce MCP Server
A lightweight, asynchronous MCP server exposing essential e-commerce domain tools for customers, orders, and inventory management. Built with FastMCP, this server demonstrates how to structure and deploy an MCP API accessible by large language models (LLMs) or other clients over stdio — ideal for local development and prototyping.
Overview
This project implements an Model Context Protocol server with focused async tools that provide programmatic access to datas. MCP servers standardize the interface between clients (e.g., LLMs) and back-end resources by exposing prompts, resources, and tools.
- Prompts: User-facing templates guiding how LLMs interact with tools and data workflows.
- Resources: Data assets exposed to LLMs, such as databases or documents.
- Tools: Functions enabling LLMs to trigger real-world business logic and retrieve information.
This implementation follows the concepts from the RealPython tutorial on Python MCP Servers.
Project Structure
mcp_servers/main.py: MCP server definition with registered async toolstests/test_server.py: Pytest validating server startup and tool registration
Key Implementation Details
@mcp.tool() Decorator
- Marks functions as MCP tools exposed to clients.
- Converts tool signatures and docstrings into metadata for LLM consumption.
- Ensure all tools have clear, concise docstrings to enable descriptive automatic documentation and better prompting.
list_tools()
- Automatically provided by the MCP framework.
- Lists all registered tools with their names and descriptions.
- No manual implementation needed.
Usage
Installation
Synchronize dependencies with:
uv sync
Running the Server
Start the MCP server locally with unbuffered output to ensure stable stdio communication:
run uv run python -u mcp_servers/main.py
The -u flag ensures unbuffered output, which is necessary for proper stdio communication
Running the Tests
Run the pytest suite to verify the server is working and exposes the expected tools:
pytest -s
The -s command displays the output of print() calls in test.
The test script will launch the server as a subprocess communicating over stdio, then ensure all expected tools are registered and accessible.
Advanced Usage
Get qwen3.8b model
ollama pull qwen3.8b
Run LLM model
ollama serve
ollama run qwen3.8b
Run MCP Server
python -u mcp_servers/streamable.py
Run Client
python -u mcp_clients/ollama_client.py
Notes
- This server uses stdio transport, which is suitable only for local testing with single client connections, lacking network accessibility and authentication. For production use, a different transport method should be used.
- The simulated latency (
asyncio.sleep(1)) mimics asynchronous data retrieval and can be adjusted or removed as needed.
License
This project is provided as-is with no explicit license.
Links
- Python MCP Server: Connect LLMs to Your Data
- Build an MCP Server in Python with FastMCP
- modelcontextprotocol.io - Build an MCP rusteuinrset:Server
- modelcontextprotocol.io - Build an MCP Client
- pypi - MCP lib
- pypi - CLI for MCP Client for Ollama - An easy-to-use command for interacting with Ollama through MCP s Building a 100% Local MCP Client with Ollama: Secure and Private AI Tool Integration