mathcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mathcpCalculate pi to 100 digits"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mathcp
A small, stateless MCP server for some of mathematics' most interesting constants, hosted on Cloudflare Workers.
What it exposes
list_interesting_numberslists the available constants.get_interesting_numberreturns a constant, its defining formula, a decimal approximation, and why it matters.The
mathcp://pi/methodsresource lists ten methods for calculating π, including each formula and its convergence characteristics.calculate_piaccepts a method identifier and a number of decimal digits (0–10,000), then returns the arbitrary-precision result and method metadata.find_prime_numbersuses MCP elicitation to ask exactly two questions (the minimum and maximum), then returns every prime in that inclusive range.investigate_prime_patternscalculates verified primes and successive prime gaps, then uses MCP sampling to ask the client's language model for a cautious pattern analysis. Ranges are limited to a span of 2,000 integers to keep the sampling request bounded. This tool requires a client that supports sampling.Prompt templates provide three different ways to explore a maths topic:
mc_escheruses symmetry, tessellation, recursion, and visual metaphors. Example: “Explain hyperbolic geometry using a repeating tiled world.”ada_lovelaceturns an idea into an algorithm with pseudocode and a traced example. Example: “Turn Euclid's algorithm into a small program and trace one example.”srinivasa_ramanujansearches small examples for patterns before carefully separating conjecture from proof. Example: “Investigate patterns in the partition numbers for small integers.”
GET /describes the service.GET /healthprovides a conventional health check./mcpis the Streamable HTTP MCP endpoint.
The initial catalogue includes pi, Euler's number, the golden ratio, and the imaginary unit. The code is deliberately data-driven so another constant can be added in one place.
Related MCP server: GitHub OAuth MCP Server
Develop locally
npm install
npm run check
npm test
npm run devRun the same MCP server locally over stdio:
npm run mcp:localFor Codex, register the executable directly so npm does not write status text to the MCP protocol stream:
codex mcp add mathcp-local -- \
node \
--import /absolute/path/to/mathcp/node_modules/tsx/dist/loader.mjs \
/absolute/path/to/mathcp/src/stdio.tsCopy the example secrets file and set a long random bearer token before starting the local server:
cp .dev.vars.example .dev.varsThe local MCP endpoint is normally http://localhost:8787/mcp. Clients must send
the configured token in the Authorization header:
Authorization: Bearer <your-token>Deploy to Cloudflare
Authenticate Wrangler, then deploy:
npx wrangler login
npx wrangler secret put AUTH_TOKEN
npm run deployWrangler prints the deployed Worker URL. Append /mcp when configuring an MCP
client, for example https://mathcp.<account>.workers.dev/mcp. Configure the MCP
client to send the same bearer header. The root description and /health remain
public; /mcp requires authentication in both local and deployed environments.
This server cannot be deployed
Maintenance
Related MCP Connectors
Cloudflare Workers MCP server: ai-agent-scratchpad
Cloudflare Workers MCP server: interactive-api-playground
9 remote MCP servers on Cloudflare Workers for AI agents. Free tier + Pro API keys.
Cloudflare Workers MCP server: ai-eval
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA lightweight MCP server built with Hono and Cloudflare Workers that provides a tool for prime factorization. It serves as a minimal implementation for deploying remote MCP servers to serverless edge environments.6 npm1MIT
- FlicenseNot gradedqualityDmaintenanceA remote MCP server deployed on Cloudflare Workers with GitHub OAuth authentication, providing tools for mathematical operations and GitHub API access.-
- FlicenseNot gradedqualityDmaintenanceA universal MCP server providing calculator and API calling tools, deployable on Cloudflare Workers.-
- FlicenseNot gradedqualityCmaintenanceA remote MCP server deployed on Cloudflare Workers with OAuth login, enabling tools like math operations to be called via natural language.-