vishnuvardhanreddy31/simple-mcp-server
If you are the rightful owner of simple-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 henry@mcphub.com.
A basic Model Context Protocol (MCP) server for learning and demonstration purposes.
Simple MCP Server
A basic Model Context Protocol (MCP) server for learning and demonstration purposes. This server provides simple tools that can be integrated with Cline and other MCP clients.
Features
This MCP server provides the following tools:
- echo_message: Echo back a message (useful for testing)
- get_current_time: Get the current date and time
- calculate_sum: Calculate the sum of a list of numbers
- count_words: Count words and characters in text
- reverse_string: Reverse a text string
Installation
- Make sure you have Python 3.8+ installed
- Install the required dependencies:
pip install -r requirements.txt
Running the Server
To test the server directly:
python simple_mcp_server.py
The server will start and listen for MCP messages via stdin/stdout.
Integration with Cline
To use this server with Cline or other MCP clients, you need to configure the client to connect to this server.
For Cline in VS Code
- Open your Cline configuration (usually in VS Code settings)
- Add this server configuration:
{ "servers": { "simple-learning-server": { "type": "stdio", "command": "python", "args": ["path/to/simple_mcp_server.py"] } } }
For Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"simple-learning-server": {
"command": "python",
"args": ["d:\\projects\\MCP_Servers\\simple_mcp_server.py"]
}
}
}
Note: Replace the path with the actual absolute path to your simple_mcp_server.py file.
For Cline (VS Code Extension)
- Open VS Code
- Go to Cline settings
- Add a new MCP server with:
- Name:
simple-learning-server - Command:
python - Args:
["D:\\projects\\MCP_Servers\\simple_mcp_server.py"]
- Name:
Testing the Server
You can test the server by:
- Adding it to your MCP client
- Asking questions like:
- "Echo the message 'Hello MCP!'"
- "What time is it?"
- "Calculate the sum of 1, 2, 3, 4, 5"
- "Count the words in 'This is a test sentence'"
- "Reverse the string 'Hello World'"
Understanding MCP
This server demonstrates key MCP concepts:
- Tools: Functions that the AI can call to perform tasks
- Resources: Information that can be retrieved (like server info)
- STDIO Transport: Communication method between client and server
- JSON-RPC: Protocol used for communication
Next Steps
To learn more about MCP:
- Read the MCP documentation
- Explore the MCP SDK
- Try modifying this server to add your own tools
- Look at more complex MCP server examples
Troubleshooting
If the server doesn't work:
- Check that Python 3.10+ is installed
- Verify all dependencies are installed:
pip install -r requirements.txt - Check the MCP client logs for error messages
- Ensure the file path in the configuration is correct and absolute
Project Structure
simple-mcp-server/
├── simple_mcp_server.py # Main server implementation
├── requirements.txt # Python dependencies
├── README.md # This file
├── .vscode/
│ └── mcp.json # VS Code MCP configuration
└── .github/
└── copilot-instructions.md # Copilot instructions
How It Works
- The server uses the FastMCP framework for easy tool definition
- Each tool is decorated with
@mcp.tool()and includes proper documentation - Logging is configured to use stderr (never stdout for MCP servers)
- The server communicates via stdio transport with MCP clients
Testing Tools
You can test each tool by asking your MCP client:
- "Echo the message 'Hello MCP!'"
- "What time is it?"
- "Calculate the sum of 1, 2, 3, 4, 5"
- "Count the words in 'This is a test message'"
- "Reverse the string 'Hello World'"
Development
To modify or extend this server:
- Add new tools using the
@mcp.tool()decorator - Ensure all tools have proper type hints and docstrings
- Test your changes by running the server
- Remember to never use stdout for logging or debug output