MCP JS

v1.0.0Coding Agentsstable

MCP server that exposes a V8 JavaScript runtime as a tool for AI agents like Claude and Cursor. Supports persistent heap snapshots via S3 or local filesystem, and is ready for integration with modern AI development environments.

mcp-jsmcpai-integration
Share:
43
Stars
0
Downloads
0
Weekly
0/5

What is MCP JS?

MCP JS is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server that exposes a v8 javascript runtime as a tool for ai agents like claude and cursor. supports persistent heap snapshots via s3 or local filesystem, and is ready for integration with modern ...

MCP server that exposes a V8 JavaScript runtime as a tool for AI agents like Claude and Cursor. Supports persistent heap snapshots via S3 or local filesystem, and is ready for integration with modern AI development environments.

This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • MCP server that exposes a V8 JavaScript runtime as a tool fo

Use Cases

Execute JavaScript through V8 runtime in AI agents.
Persist heap snapshots to S3 or local filesystem.
Integrate JavaScript execution in MCP workflows.
r33drichards

Maintainer

LicenseAGPL-3.0
Languagerust
Versionv1.0.0
UpdatedMay 12, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-js

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MCP JS

The mcp-js server (also called mcp-v8) embeds a full V8 JavaScript runtime as an MCP tool, letting AI agents like Claude and Cursor execute arbitrary JavaScript code in a sandboxed environment with optional persistent heap snapshots. It supports stateful sessions where heap state is preserved between executions (stored locally or in S3), stateless one-shot execution, and HTTP mode for remote access. Capabilities such as fetch, filesystem access, npm module imports via URL, WebAssembly, and subprocess execution can be enabled per policy, making it suitable for data processing, scripting automation, and agentic workflows that need reliable code execution.

Prerequisites

  • Linux x86_64/arm64 or macOS Apple Silicon (pre-built binaries available)
  • Nix package manager (optional, for nix run) or direct binary download from GitHub releases
  • AWS S3 credentials if you want to persist heap snapshots to S3 (optional)
  • An MCP-compatible client such as Claude Desktop or Cursor
1

Install the mcp-v8 binary

Download and install the server binary using the provided install script. This places the mcp-v8 binary in /usr/local/bin.

curl -fsSL https://raw.githubusercontent.com/r33drichards/mcp-js/main/install.sh | sudo bash
2

Choose stateful or stateless mode

In stateful mode, JavaScript heap state persists between executions via a local directory or S3. In stateless mode, each execution is independent. Choose based on whether you need long-running sessions with accumulated state.

# Stateful mode with local heap storage
mcp-v8 --directory-path /tmp/mcp-v8-heaps

# Stateless mode
mcp-v8 --stateless

# HTTP server mode
mcp-v8 --stateless --http-port 8080
3

Add the server to your MCP client configuration

Edit your MCP client configuration file to register the mcp-v8 server. Use the full binary path from which mcp-v8 output.

{
  "mcpServers": {
    "mcp-v8": {
      "command": "/usr/local/bin/mcp-v8",
      "args": ["--directory-path", "/tmp/mcp-v8-heaps"]
    }
  }
}
4

Or add via Claude Code CLI

If using Claude Code, you can register the server directly from the command line without editing the config file manually.

# Stateful
claude mcp add mcp-v8 -- mcp-v8 --directory-path /tmp/mcp-v8-heaps

# Stateless
claude mcp add mcp-v8 -- mcp-v8 --stateless
5

Restart your MCP client and test execution

Restart Claude Desktop or your IDE. Ask the AI to run a simple JavaScript snippet to verify the runtime is working.

MCP JS Examples

Client configuration

Example claude_desktop_config.json for mcp-v8 in stateful mode with local heap storage.

{
  "mcpServers": {
    "mcp-v8": {
      "command": "/usr/local/bin/mcp-v8",
      "args": ["--directory-path", "/tmp/mcp-v8-heaps"]
    }
  }
}

Prompts to try

Example prompts to run JavaScript through the V8 runtime.

- "Run this JavaScript: console.log([1,2,3].map(x => x * 2))"
- "Execute a fetch request to https://api.github.com/repos/r33drichards/mcp-js and return the star count."
- "Write and run a JavaScript function that sorts an array of objects by the 'date' field."
- "Run a stateful session: first define a variable x = 42, then in the next call return x * 2."
- "Import the lodash library via URL and use it to chunk an array of 100 numbers into groups of 10."

Troubleshooting MCP JS

Binary not found or permission denied when running mcp-v8

Run 'which mcp-v8' to confirm the binary is in your PATH. On macOS, you may need to allow the binary in System Settings > Security & Privacy if Gatekeeper blocks it. On macOS Apple Silicon, only the arm64 build is supported.

Heap snapshot directory errors in stateful mode

Ensure the directory specified by --directory-path exists and is writable by the user running the MCP server. Create it with 'mkdir -p /tmp/mcp-v8-heaps' if it does not exist.

fetch() or fs.* calls fail inside JavaScript execution

These capabilities are disabled by default and must be enabled via policy flags. Check the mcp-v8 --help output for capability flags like --enable-fetch and --enable-fs to unlock specific runtime globals.

Frequently Asked Questions about MCP JS

What is MCP JS?

MCP JS is a Model Context Protocol (MCP) server that mcp server that exposes a v8 javascript runtime as a tool for ai agents like claude and cursor. supports persistent heap snapshots via s3 or local filesystem, and is ready for integration with modern ai development environments. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MCP JS?

Follow the installation instructions on the MCP JS GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with MCP JS?

MCP JS works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MCP JS free to use?

Yes, MCP JS is open source and available under the AGPL-3.0 license. You can use it freely in both personal and commercial projects.

Browse More Coding Agents MCP Servers

Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mcp-js": { "command": "npx", "args": ["-y", "mcp-js"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use MCP JS?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides