MCP-WXO Project
Project Setup
This project uses:
- Project Directory:
~/bob/mcp-wxo(/Users/amandawinkles/bob/mcp-wxo) - Python Virtual Environment:
~/wxo-adk/wxO-adk(/Users/amandawinkles/wxo-adk/wxO-adk) - Python Version: 3.13.12
Activating the Virtual Environment
To activate the virtual environment, run:
source ~/wxo-adk/wxO-adk/bin/activate
Or from the project directory:
source /Users/amandawinkles/wxo-adk/wxO-adk/bin/activate
Deactivating the Virtual Environment
To deactivate the virtual environment:
deactivate
Project Structure
This is the root directory for the MCP-WXO project. All project files should be placed here.
Factorial MCP Server
This project includes an MCP (Model Context Protocol) server with two mathematical tools for factorial calculations:
Tools
-
factorial_value: Calculates and returns the exact value of n! (factorial of n)
- Input: A non-negative integer
n - Output: The exact factorial value
- Example:
factorial_value(5)returns120
- Input: A non-negative integer
-
factorial_digits: Returns the number of decimal digits in n!
- Input: A non-negative integer
n - Output: The number of digits in n!
- Example:
factorial_digits(100)returns158 - Useful for very large factorials that are too big to display
- Input: A non-negative integer
Installation
-
Activate the virtual environment:
source ~/wxo-adk/wxO-adk/bin/activate
-
Install dependencies:
pip install -e .
Running the Server
To start the MCP server:
python server.py
The server will start and listen for MCP tool requests.
Testing
Run the test suite to verify the implementation:
pytest test_server.py -v
Usage Examples
Using factorial_value
# Calculate 5!
factorial_value(5) # Returns: 120
# Calculate 10!
factorial_value(10) # Returns: 3628800
# Calculate 20!
factorial_value(20) # Returns: 2432902008176640000
Using factorial_digits
# Get digit count for 5!
factorial_digits(5) # Returns: 3 (because 5! = 120 has 3 digits)
# Get digit count for 100!
factorial_digits(100) # Returns: 158
# Get digit count for 1000!
factorial_digits(1000) # Returns: 2568
Implementation Details
- Both tools share a common helper function
calculate_factorial()to avoid code duplication factorial_valueuses Python's built-inmath.factorial()for exact computationfactorial_digitsuses logarithms for efficient calculation without computing the full factorial- Comprehensive error handling for negative numbers and invalid input types
- Full test coverage with pytest
Error Handling
Both tools validate input and raise appropriate errors:
TypeError: If the input is not an integerValueError: If the input is a negative number (factorial is undefined for negative numbers)
Metadata
Release files for mcp-wxo 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mcp_wxo-0.1.0.tar.gz | 4.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_wxo-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.7 kB
Release files / mcp_wxo-0.1.0.tar.gz
| Download URL | mcp_wxo-0.1.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f964f20bfc5e69023ce85341e824fba98ad3b5a1c4605b7c8a0f3870873c9676
|
|
BLAKE2b-256 checksum How to use checksums |
44d092b5089acc16ba041c1613dee985785e5fbb1046ef062317697e581698bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / mcp_wxo-0.1.0-py3-none-any.whl
| Download URL | mcp_wxo-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e83527cef52b8ba05e2dbbb4643c9234e59e500b531526e0deec3a641a7bc7f
|
|
BLAKE2b-256 checksum How to use checksums |
07f1db3880df27bb4315dca8480d4aa336a3dfd7a741403dc2313b34cb8c0a0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Security for mcp-wxo 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.