a calculator mcp server, and this service may be published to nacos
Project description
DeepMCP
A flexible and powerful Multi-Computer Programming (MCP) framework for building client-server applications with support for natural language interaction and LLM integration.
Features
- Asynchronous HTTP Server: Support for streaming HTTP communication using modern async patterns
- Mathematical Calculator Tools: Built-in arithmetic operations (addition, subtraction, multiplication, division)
- Dual-Mode Client: Can run as both client and server
- LLM Integration: Connect with OpenAI-compatible APIs for natural language processing
- Simple Fallback Implementation: Minimal version that works without external dependencies
Project Structure
deepmcp/
├── src/
│ ├── deepmcp/
│ │ ├── __init__.py
│ │ ├── client.py # MCP client implementation with LLM integration
│ │ ├── server.py # MCP server implementation with calculator tools
│ │ └── main.py # Main entry point
│ └── tests/
├── pyproject.toml # Project configuration and dependencies
└── minimal_mcp.py # Minimal implementation without external dependencies
Installation
Prerequisites
- Python 3.12 or higher
- uv package manager (recommended for faster installations)
Steps
-
Clone the repository:
git clone <repository-url> cd deepmcp
-
Install dependencies using uv:
uv pip install -e .
If you encounter issues with dependencies, try installing them directly:
uv pip install fastmcp>=2.12.3 mcp>=1.14.0 openai>=1.108.0
Usage
Starting the Server
You can start the server in several ways:
-
Using the command-line script:
deepmcp
-
Running the server module directly:
python -m deepmcp.server
-
Using the client in server mode:
python -m deepmcp.client --server
Starting the Client
To start the client and connect to the server:
python -m deepmcp.client
By default, the client connects to http://localhost:8000. You can specify a different server URL:
python -m deepmcp.client http://your-server-url:port
Using the Minimal Implementation
If you encounter dependency issues with the main implementation, you can use the minimal version that doesn't rely on external packages:
python minimal_mcp.py
This runs a simplified version of the MCP server and client with basic calculator functionality.
Troubleshooting
Common Issues
-
ModuleNotFoundError: No module named 'deepmcp'
- Ensure the package is installed in development mode:
uv pip install -e . - Check that your Python path includes the project directory
- Verify that the
pyproject.tomlhas the correct package discovery configuration
- Ensure the package is installed in development mode:
-
ModuleNotFoundError: No module named 'fastmcp' or other dependencies
- Try reinstalling the dependencies:
uv pip install fastmcp mcp openai - If issues persist, use the minimal implementation:
python minimal_mcp.py
- Try reinstalling the dependencies:
-
Connection Issues
- Ensure the server is running before starting the client
- Check that the client is connecting to the correct host and port
- Verify that no firewall is blocking the connection
LLM Integration
The client integrates with OpenAI-compatible APIs (via OpenRouter in the current implementation). To use this feature, you'll need to configure your API key:
- Open
client.py - Update the
OPENROUTER_API_KEYvariable with your own API key - You can also change the
modelparameter to use a different LLM model
License
This project is licensed under the MIT License.
Contributing
Contributions are welcome! Please fork the repository and submit a pull request with your changes.
Acknowledgements
- Based on the Multi-Computer Programming (MCP) framework
- Uses FastMCP for asynchronous server implementation
- Integrates with OpenAI-compatible APIs for natural language processing
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deepmcp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: deepmcp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3dbbaca2fef88a4814348a935f3adad82843e1cba051f37879b0107af564d0f1
|
|
| MD5 |
3c4564c3110cb87c9578043d3e6e8761
|
|
| BLAKE2b-256 |
2211a346c4576c85f4b785b9beecb656d68121e720995ee60ae9acae3c30d75e
|