MCP JS
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.
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
Maintainer
Works with
Installation
Manual Installation
npx mcp-jsConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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 bashChoose 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 8080Add 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"]
}
}
}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 --statelessRestart 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.
MCP JS Alternatives — Similar Coding Agents Servers
Looking for alternatives to MCP JS? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
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.
Set Up MCP JS in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.