# Scientific Calculator MCP Server > **Scientific Calculator MCP Server** is a hosted, multitenant Model Context Protocol (MCP) server run by **MewCP** (https://mewcp.com), giving AI agents managed access to Scientific Calculator. > > MewCP takes care of all MCP infrastructure for you — credential storage, OAuth flows, > token refresh, and production-grade auto-scaling — so your AI agents can connect to > third-party services and run freely without you managing any MCP server yourself. > > To connect your agent to this server you need a MewCP account and your API key: > - MEWCP_KEY — your personal API key (dashboard → Developer) > > Server page: https://mewcp.com/mcp/scientific-calculator > MewCP docs: https://docs.mewcp.com > Full catalog: https://mewcp.com/llms.txt ## About Perform advanced mathematical, statistical and symbolic computations. Solve equations, evaluate expressions and support scientific and engineering calculations. ## How to connect Server Page URL: https://mewcp.com/mcp/scientific-calculator Gateway URL: https://gateway.mewcp.com/personal/mcp Every request to this server requires one header: Authorization: Bearer — your MewCP API key (dashboard → Developer) All connection snippets and ready-to-use code examples are available on the server page and in this document below. --- ## Server documentation # Scientific Calculator MCP Server A Model Context Protocol (MCP) server that provides stateless scientific calculator operations. ## Authentication This is a utility MCP server. No authentication input is required because tools do not access external tenant data. ## Features - `health_check`: Verify server readiness. - `evaluate_expression`: Safely evaluate scientific expressions with optional angle mode and precision controls. - `list_supported_operations`: Return available operators, functions, constants, and angle modes. ## Available Tools ### `health_check` Checks server readiness and basic connectivity. Arguments: - None. Example call: ```json { "tool": "health_check", "arguments": {} } ``` ### `evaluate_expression` Evaluates a scientific expression safely using an allowlisted AST evaluator. Arguments: - `expression` (required, string): Scientific expression to evaluate. - Supports operators: `+`, `-`, `*`, `/`, `//`, `%`, `**`, unary `+x`, unary `-x`. - Supports constants: `pi`, `e`, `tau`. - Supports functions: `abs`, `acos`, `asin`, `atan`, `ceil`, `cos`, `degrees`, `exp`, `factorial`, `floor`, `log`, `log10`, `radians`, `sin`, `sqrt`, `tan`. - Maximum length: 512 characters. - `angle_mode` (optional, string): Trigonometric angle mode. - Allowed values: `radians`, `degrees`. - Default: `radians`. - `precision` (optional, integer): Decimal precision for finite float results. - Allowed range: 0 to 15. - Default: 10. Example call: ```json { "tool": "evaluate_expression", "arguments": { "expression": "sin(pi / 2) + sqrt(16)", "angle_mode": "radians", "precision": 6 } } ``` ### `list_supported_operations` Returns the server's current supported operators, functions, constants, and angle modes. Arguments: - None. Example call: ```json { "tool": "list_supported_operations", "arguments": {} } ``` ## Setup ```bash pip install -r requirements.txt ``` ## Running the Server ```bash # stdio python server.py # sse python server.py --transport sse --host 127.0.0.1 --port 8001 # streamable-http python server.py --transport streamable-http --host 127.0.0.1 --port 8001 ``` ## Example Tool Calls ```json { "tool": "evaluate_expression", "arguments": { "expression": "sin(pi / 2) + sqrt(16)", "angle_mode": "radians", "precision": 6 } } ``` ```json { "tool": "evaluate_expression", "arguments": { "expression": "sin(30)", "angle_mode": "degrees" } } ``` ## Project Structure ```text cl-mcp-scientific-calculator/ |-- server.py |-- requirements.txt |-- README.md `-- scientific_calculator_mcp/ |-- __init__.py |-- cli.py |-- config.py `-- tools.py ``` --- ## Connection snippets ### Python (fastmcp) ```python import asyncio from fastmcp import Client from fastmcp.client.transports import StreamableHttpTransport SERVER_URL = "https://gateway.mewcp.com/personal/mcp" MEWCP_KEY = "YOUR_MEWCP_KEY" transport = StreamableHttpTransport( url=SERVER_URL, headers={ "Authorization": f"Bearer {MEWCP_KEY}", } ) async def main(): client = Client(transport) async with client: await client.ping() tools = await client.list_tools() resources = await client.list_resources() prompts = await client.list_prompts() # Change the tool name and arguments with actual tool and arguments available in server result = await client.call_tool("example_tool", {"param": "value"}) print(result) asyncio.run(main()) ``` ### TypeScript (MCP SDK) ```typescript import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; const SERVER_URL = "https://gateway.mewcp.com/personal/mcp"; const MEWCP_KEY = "YOUR_MEWCP_KEY"; const transport = new StreamableHTTPClientTransport(new URL(SERVER_URL), { requestInit: { headers: { Authorization: `Bearer ${MEWCP_KEY}`, }, }, }); const client = new Client({ name: "mewcp-client", version: "1.0.0", }); await client.connect(transport); const tools = await client.listTools(); console.log("Available tools:", tools.tools.map(t => t.name)); // Change the tool name and arguments to a tool available on your server const result = await client.callTool({ name: "example_tool", arguments: { param: "value" }, }); console.log("Tool result:", result); ``` ### VS Code (settings.json) ```json { "servers": { "mewcp": { "type": "http", "url": "https://gateway.mewcp.com/personal/mcp", "headers": { "Authorization": "Bearer YOUR_MEWCP_KEY" } } } } ``` ### Cursor (mcp.json) ```json { "mcpServers": { "mewcp": { "url": "https://gateway.mewcp.com/personal/mcp", "headers": { "Authorization": "Bearer YOUR_MEWCP_KEY" } } } } ``` ### Claude Desktop (claude_desktop_config.json) ```json "mcpServers": { "mewcp": { "command": "npx", "args": [ "-y", "mcp-remote@latest", "https://gateway.mewcp.com/personal/mcp", "--transport", "http-only", "--header", "Authorization: Bearer YOUR_MEWCP_KEY" ] } } ```