Reorganize community environments - Move lean_proof_env, router_env, and philosophical_rlaif_env.py to environments/community/ - Add comprehensive README for community environments - This organizes community-contributed environments into a dedicated community folder for better maintainability and discoverability

This commit is contained in:
Shannon Sands 2025-05-23 13:31:13 +10:00
parent 945ea30c3a
commit e85a170c34
53 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1,36 @@
from mcp.server.fastmcp import FastMCP
import logging
import os
# Setup logging to a file
# Adjust the log file path if necessary, perhaps to be relative to this script's location
# or a dedicated logs directory.
log_file_path = os.path.join(os.path.dirname(__file__), 'math_server_official.log')
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s - %(levelname)s - %(name)s - %(message)s',
handlers=[
logging.FileHandler(log_file_path, mode='w'), # 'w' to overwrite each run
logging.StreamHandler()
]
)
logger = logging.getLogger(__name__)
mcp = FastMCP("Official Math Server 🚀")
@mcp.tool()
def add(a: int, b: int) -> int: # Changed return type hint to int
"""Add two numbers and return the result"""
logger.info(f"Executing add tool with a={a}, b={b}")
return a + b
@mcp.tool()
def multiply(a: int, b: int) -> int: # Changed return type hint to int
"""Multiply two numbers and return the result"""
logger.info(f"Executing multiply tool with a={a}, b={b}")
return a * b
if __name__ == "__main__":
logger.info(f"Starting Official MCP math_server.py with STDIO transport... Log file: {log_file_path}")
mcp.run(transport="stdio") # Ensure stdio transport is used as in server_stdio.py