Skip to main content

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

  1. 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) returns 120
  2. 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) returns 158
    • Useful for very large factorials that are too big to display

Installation

  1. Activate the virtual environment:

    source ~/wxo-adk/wxO-adk/bin/activate
    
  2. 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_value uses Python's built-in math.factorial() for exact computation
  • factorial_digits uses 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 integer
  • ValueError: 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)

Source distribution for mcp-wxo 0.1.0
File Size Uploaded Provenance
mcp_wxo-0.1.0.tar.gz 4.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-wxo 0.1.0
File Interpreter ABI Platform
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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page