Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Server POCcalculate the area of a circle with radius 5"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server POC
A cutting-edge Proof of Concept (POC) implementation of a Model Context Protocol (MCP) server using Python and modern technologies. This server provides tools and resources that can be accessed by AI assistants and other MCP clients.
๐๏ธ Architecture
The MCP Server follows a modular architecture with clear separation of concerns:
graph TB
subgraph "Client Layer"
AI[AI Assistant/Client]
CLI[CLI Client]
end
subgraph "Transport Layer"
STDIO[STDIO Transport]
HTTP[HTTP Transport - Future]
end
subgraph "MCP Server Core"
SERVER[MCP Server Instance]
HANDLER[Request Handler]
TOOLS[Tools Registry]
RESOURCES[Resources Registry]
end
subgraph "Tool Implementations"
CALC[Calculate Tool]
FETCH[Fetch URL Tool]
SYSINFO[System Info Tool]
PROCESS[Process Data Tool]
FILE[File Operations Tool]
end
subgraph "Resource Providers"
FILE_RES[File Resources]
CONFIG_RES[Config Resources]
end
subgraph "External Services"
HTTP_API[HTTP APIs]
FILE_SYS[File System]
end
AI --> STDIO
CLI --> STDIO
STDIO --> SERVER
SERVER --> HANDLER
HANDLER --> TOOLS
HANDLER --> RESOURCES
TOOLS --> CALC
TOOLS --> FETCH
TOOLS --> SYSINFO
TOOLS --> PROCESS
TOOLS --> FILE
RESOURCES --> FILE_RES
RESOURCES --> CONFIG_RES
FETCH --> HTTP_API
FILE --> FILE_SYS
FILE_RES --> FILE_SYSWorkflow Diagram
sequenceDiagram
participant Client
participant Transport
participant Server
participant Tool
participant Resource
Client->>Transport: Initialize Connection
Transport->>Server: Connection Established
Client->>Server: List Tools Request
Server->>Client: Tools List Response
Client->>Server: List Resources Request
Server->>Client: Resources List Response
Client->>Server: Call Tool Request
Server->>Tool: Execute Tool
Tool->>Server: Tool Result
Server->>Client: Tool Response
Client->>Server: Read Resource Request
Server->>Resource: Fetch Resource
Resource->>Server: Resource Data
Server->>Client: Resource Response๐ Features
Modern Python Stack: Built with Python 3.10+ and async/await patterns
Type Safety: Full type hints with Pydantic models
High Performance: Uses
uvloopfor enhanced async performanceComprehensive Tools: Multiple example tools demonstrating various capabilities
Resource Management: File and configuration resource providers
Testing: Complete test suite with pytest
Configuration: Environment-based configuration management
๐ Prerequisites
Python 3.10 or higher
pip or poetry for package management
Git (for cloning the repository)
๐ ๏ธ Installation
Step 1: Clone the Repository
git clone <repository-url>
cd MCP-serverStep 2: Create Virtual Environment
# Using venv
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Or using conda
conda create -n mcp-server python=3.10
conda activate mcp-serverStep 3: Install Dependencies
# Using pip
pip install -r requirements.txt
# For development (includes testing tools)
pip install -r requirements-dev.txt
# Or using poetry (if you prefer)
poetry installStep 4: Configure Environment
# Copy example environment file
cp .env.example .env
# Edit .env file with your settings (optional)
# nano .env๐งช Testing
Run All Tests
pytestRun Tests with Coverage
pytest --cov=src --cov-report=htmlRun Specific Test
pytest tests/test_server.py::test_calculate_tool -v๐ฏ Usage
Running the Server
Method 1: Direct Python Execution
python -m src.serverMethod 2: Using the Script
python scripts/run_server.pyMethod 3: As a Module
python -m src.serverExample Client Usage
Run the example client to see the server in action:
python examples/example_client.pyAvailable Tools
The server provides the following tools:
calculate: Perform mathematical calculations
Input:
{"expression": "2 + 2"}Output: Calculation result
fetch_url: Fetch content from URLs
Input:
{"url": "https://example.com", "method": "GET"}Output: HTTP response content
get_system_info: Get system information
Input:
{}Output: System details and environment variables
process_data: Process and transform data
Input:
{"data": "hello", "operation": "uppercase"}Operations:
reverse,uppercase,lowercase,count
write_file: Write content to files
Input:
{"filepath": "output.txt", "content": "Hello World"}Output: Confirmation message
Available Resources
Example File:
file://example.txt- Example file resourceServer Configuration:
config://server-config- Current server configuration
๐ Project Structure
MCP-server/
โโโ src/
โ โโโ __init__.py # Package initialization
โ โโโ server.py # Main MCP server implementation
โ โโโ config.py # Configuration management
โโโ tests/
โ โโโ __init__.py
โ โโโ test_server.py # Unit tests
โโโ examples/
โ โโโ example_client.py # Example client implementation
โโโ scripts/
โ โโโ run_server.py # Server runner script
โโโ .env.example # Example environment configuration
โโโ .gitignore # Git ignore rules
โโโ pyproject.toml # Project metadata and dependencies
โโโ pytest.ini # Pytest configuration
โโโ requirements.txt # Production dependencies
โโโ requirements-dev.txt # Development dependencies
โโโ README.md # This file๐ง Configuration
The server can be configured using environment variables:
MCP_SERVER_NAME: Server name (default:mcp-server-poc)MCP_SERVER_VERSION: Server version (default:0.1.0)LOG_LEVEL: Logging level (default:INFO)ENABLE_METRICS: Enable metrics collection (default:true)
๐งฉ Technology Stack
MCP SDK: Official Model Context Protocol SDK for Python
Pydantic: Data validation and settings management
httpx: Modern async HTTP client
aiofiles: Async file operations
uvloop: High-performance event loop
pytest: Testing framework
python-dotenv: Environment variable management
๐ Development
Code Formatting
# Format code with black
black src/ tests/ examples/
# Lint with ruff
ruff check src/ tests/
# Type checking with mypy
mypy src/Adding New Tools
Add tool definition in
list_tools()functionImplement tool logic in
call_tool()functionAdd tests in
tests/test_server.py
Example:
# In list_tools()
Tool(
name="my_new_tool",
description="Description of my tool",
inputSchema={
"type": "object",
"properties": {
"param": {"type": "string"}
},
"required": ["param"]
}
)
# In call_tool()
elif name == "my_new_tool":
param = arguments.get("param")
# Your tool logic here
return [TextContent(type="text", text=f"Result: {result}")]๐ Troubleshooting
Common Issues
Import Errors: Ensure all dependencies are installed
pip install -r requirements.txtPython Version: Ensure Python 3.10+ is being used
python --versionVirtual Environment: Make sure virtual environment is activated
source venv/bin/activatePermission Errors: Check file permissions for write operations
๐ License
See LICENSE file for details.
๐ค Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests
Submit a pull request
๐ Additional Resources
๐ Next Steps
Add more sophisticated tools (database queries, API integrations)
Implement authentication and authorization
Add metrics and monitoring
Support for streaming responses
WebSocket transport support
Resource caching and optimization
Note: This is a POC project. For production use, consider adding:
Proper error handling and logging
Security measures (authentication, input validation)
Rate limiting
Comprehensive monitoring
Documentation generation
CI/CD pipelines
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.