ines312692/simple-mcp-project
If you are the rightful owner of simple-mcp-project 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 simple Model Control Protocol (MCP) server implementation that provides basic mathematical and text manipulation tools.
Simple MCP Project
A simple Model Control Protocol (MCP) server implementation that provides basic mathematical and text manipulation tools.
Overview
This project implements a simple MCP server that exposes:
- Mathematical operations (addition, subtraction)
- Text manipulation tools (reverse text, convert to uppercase)
- Sample data resource
The server is built using the MCP library and can be run as a command-line tool.
Installation
Requirements
- Python 3.10 or higher
- MCP library (version 0.1.0 or higher)
Install from source
# Clone the repository
git clone https://github.com/yourusername/simple-mcp-project.git
cd simple-mcp-project
# Install the package
pip install -e .
Usage
Running the server
After installation, you can run the server using the provided command-line tool:
my-mcp-server
Available Tools
The server provides the following tools:
Mathematical Operations
-
add: Add two numbers
- Parameters:
a(first number),b(second number) - Returns: Sum of the two numbers
- Parameters:
-
subtract: Subtract two numbers
- Parameters:
a(first number),b(second number) - Returns: Result of subtracting
bfroma
- Parameters:
Text Manipulation
-
reverse_text: Reverse a string
- Parameters:
text(string to reverse) - Returns: Reversed string
- Parameters:
-
uppercase_text: Convert text to uppercase
- Parameters:
text(string to convert) - Returns: Uppercase version of the input string
- Parameters:
Available Resources
- Sample Data: Access sample project data
- URI:
data://sample - Returns: JSON object with project information
- URI:
Project Structure
simple-mcp-project/
├── src/
│ └── mcp/
│ ├── __init__.py # Package initialization
│ ├── server.py # Main MCP server implementation
│ ├── resources/ # Resource implementations
│ │ ├── __init__.py
│ │ └── data.py # Sample data resource
│ └── tools/ # Tool implementations
│ ├── __init__.py
│ ├── calculator.py # Mathematical operations
│ └── text_tools.py # Text manipulation tools
├── tests/ # Test directory
│ ├── __init__.py
│ └── test_tools.py # Tests for tools
├── pyproject.toml # Project metadata and build configuration
├── requirements.txt # Project dependencies
└── README.md # This file
Development
Running Tests
pytest
License
[Add your license information here]
Contributing
[Add contribution guidelines here]