mathcp

mathcp

A stateless MCP server for mathematical constants, hosted on Cloudflare Workers, enabling listing constants, calculating pi to arbitrary precision, finding primes in a range, and investigating prime gaps.

Category
Visit Server

README

mathcp

A small, stateless MCP server for some of mathematics' most interesting constants, hosted on Cloudflare Workers.

What it exposes

  • list_interesting_numbers lists the available constants.
  • get_interesting_number returns a constant, its defining formula, a decimal approximation, and why it matters.
  • The mathcp://pi/methods resource lists ten methods for calculating π, including each formula and its convergence characteristics.
  • calculate_pi accepts a method identifier and a number of decimal digits (0–10,000), then returns the arbitrary-precision result and method metadata.
  • find_prime_numbers uses MCP elicitation to ask exactly two questions (the minimum and maximum), then returns every prime in that inclusive range.
  • investigate_prime_patterns calculates 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_escher uses symmetry, tessellation, recursion, and visual metaphors. Example: “Explain hyperbolic geometry using a repeating tiled world.”
    • ada_lovelace turns 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_ramanujan searches 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 /health provides a conventional health check.
  • /mcp is 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.

Develop locally

npm install
npm run check
npm test
npm run dev

Run the same MCP server locally over stdio:

npm run mcp:local

For 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.ts

Copy the example secrets file and set a long random bearer token before starting the local server:

cp .dev.vars.example .dev.vars

The 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 deploy

Wrangler 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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured