Simple MCP Server

Simple MCP Server

A minimal MCP server providing tools for time, calculations, sandboxed file operations, and safe URL fetching over stateless HTTP.

Category
Visit Server

README

Simple MCP Server

A small Node.js and TypeScript MCP server that exposes time, calculation, restricted filesystem, and public URL fetching tools over stateless Streamable HTTP.

Requirements

  • Node.js 20 or newer
  • npm

Setup and start

npm install
npm run build
npm start

The default MCP endpoint is http://127.0.0.1:3000/mcp. A health check is available at http://127.0.0.1:3000/health.

For explicit local configuration:

$env:MCP_WORKSPACE_ROOT = "C:\path\to\allowed\workspace"
$env:MCP_ALLOW_WRITE = "false"
$env:MCP_HTTP_HOST = "127.0.0.1"
$env:MCP_HTTP_PORT = "3000"
npm start

Tools and resources

Tool Description
get_current_time Get the current time in an IANA time zone.
calculate Evaluate a side-effect-free mathematical expression.
read_text_file Read a UTF-8 file under the configured workspace.
list_directory List a directory under the configured workspace.
write_text_file Write a UTF-8 file when MCP_ALLOW_WRITE=true.
fetch_url Fetch a public HTTP(S) URL with SSRF, timeout, and size checks.

Resources are available at server://info and workspace://config.

Configuration

Variable Default Purpose
MCP_WORKSPACE_ROOT Current directory Filesystem sandbox root.
MCP_ALLOW_WRITE false Enables write_text_file.
MCP_MAX_FILE_BYTES 1048576 Maximum file read/write size.
MCP_FETCH_TIMEOUT_MS 10000 Whole-request timeout, including redirects and body reads.
MCP_MAX_RESPONSE_BYTES 2097152 Maximum fetched response body size.
MCP_HTTP_HOST 127.0.0.1 HTTP listen address.
MCP_HTTP_PORT 3000 HTTP listen port.
MCP_HTTP_PATH /mcp MCP endpoint path.
MCP_API_KEY Empty Bearer token. Required for non-loopback listen addresses.
SIMPLE_MCP_API_KEY Empty Alias for MCP_API_KEY, matching the Codex client variable.
MCP_ALLOWED_HOSTS Empty Optional comma-separated Host header allowlist.

Connect an external agent

For access from another machine, bind the server to all interfaces and configure a strong API key:

$env:MCP_HTTP_HOST = "0.0.0.0"
$env:MCP_HTTP_PORT = "3000"
$env:MCP_API_KEY = "replace-with-a-long-random-secret"
$env:MCP_ALLOWED_HOSTS = "mcp.example.com"
npm start

Configure a URL-based MCP client such as Codex:

[mcp_servers.simple-toolbox]
url = "https://mcp.example.com/mcp"
bearer_token_env_var = "SIMPLE_MCP_API_KEY"

Set SIMPLE_MCP_API_KEY in the Agent process environment to the same value as the server's MCP_API_KEY. For local development, use http://127.0.0.1:3000/mcp; for remote access, put the service behind an HTTPS reverse proxy. Do not expose plain HTTP or enable filesystem writes on an untrusted network.

Development

npm run dev
npm test
npm run test:smoke

npm run test:smoke builds the project, starts it on a random local port, verifies Bearer authentication, completes a Streamable HTTP MCP handshake, lists tools and resources, and calls the calculator tool.

The server is stateless: each MCP POST request creates an isolated server transport. Standalone GET/SSE and DELETE session operations return HTTP 405. This is appropriate for the current request-response tools, but not for server-initiated notifications or resumable long-running streams.

The network guard rejects localhost, private, link-local, multicast, and reserved IP address ranges. DNS rebinding protection at the outbound socket connection layer is outside this simple server's scope; deploy behind an egress proxy when stronger network isolation is required.

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
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
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
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

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