mcp-v8
mcp-v8
README
mcp-v8: V8 JavaScript MCP Server
A Rust-based Model Context Protocol (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.
Features
- V8 JavaScript Execution: Run arbitrary JavaScript code in a secure, isolated V8 engine.
- Heap Snapshots: Persist and restore V8 heap state between runs, supporting both S3 and local file storage.
- MCP Protocol: Implements the Model Context Protocol for seamless tool integration with Claude, Cursor, and other MCP clients.
- Configurable Storage: Choose between S3 or local directory for heap storage at runtime.
Installation
Install mcp-v8 using the provided install script:
curl -fsSL https://raw.githubusercontent.com/r33drichards/mcp-js/main/install.sh | sudo bash
This will automatically download and install the latest release for your platform to /usr/local/bin/mcp-v8 (you may be prompted for your password).
Advanced users: If you prefer to build from source, see the Build from Source section at the end of this document.
Command Line Arguments
mcp-v8 supports the following command line arguments:
--s3-bucket <bucket>: Use AWS S3 for heap snapshots. Specify the S3 bucket name. (Conflicts with--directory-path)--directory-path <path>: Use a local directory for heap snapshots. Specify the directory path. (Conflicts with--s3-bucket)
Note: You must specify either --s3-bucket or --directory-path. If neither is provided, the server defaults to S3 with the bucket name test-mcp-js-bucket.
Quick Start
After installation, you can run the server directly. Choose one of the following options:
# Use S3 for heap storage (recommended for cloud/persistent use)
mcp-v8 --s3-bucket my-bucket-name
# Use local filesystem directory for heap storage (recommended for local development)
mcp-v8 --directory-path /tmp/mcp-v8-heaps
Integration
Claude for Desktop
- Install the server as above.
- Open Claude Desktop → Settings → Developer → Edit Config.
- Add your server to
claude_desktop_config.json:
{
"mcpServers": {
"js": {
"command": "/usr/local/bin/mcp-v8 --s3-bucket my-bucket-name"
}
}
}
- Restart Claude Desktop. The new tools will appear under the hammer icon.
Cursor
- Install the server as above.
- Create or edit
.cursor/mcp.jsonin your project root:
{
"mcpServers": {
"js": {
"command": "/usr/local/bin/mcp-v8 --directory-path /tmp/mcp-v8-heaps"
}
}
}
- Restart Cursor. The MCP tools will be available in the UI.
Example Usage
- Ask Claude or Cursor: "Run this JavaScript:
1 + 2" - Use heap snapshots to persist state between runs.
Heap Storage Options
You can configure heap storage using the following command line arguments:
- S3:
--s3-bucket <bucket>- Example:
mcp-v8 --s3-bucket my-bucket-name - Requires AWS credentials in your environment.
- Example:
- Filesystem:
--directory-path <path>- Example:
mcp-v8 --directory-path /tmp/mcp-v8-heaps
- Example:
Note: Only one storage backend can be used at a time. If both are provided, the server will return an error.
Limitations
While mcp-v8 provides a powerful and persistent JavaScript execution environment, there are limitations to its runtime.
- No
async/awaitor Promises: Asynchronous JavaScript is not supported. All code must be synchronous. - No
fetchor network access: There is no built-in way to make HTTP requests or access the network. - No
console.logor standard output: Output fromconsole.logor similar functions will not appear. To return results, ensure the value you want is the last line of your code. - No file system access: The runtime does not provide access to the local file system or environment variables.
- No
npm installor external packages: You cannot install or import npm packages. Only standard JavaScript (ECMAScript) built-ins are available. - No timers: Functions like
setTimeoutandsetIntervalare not available. - No DOM or browser APIs: This is not a browser environment; there is no access to
window,document, or other browser-specific objects.
Build from Source (Advanced)
If you prefer to build from source instead of using the install script:
Prerequisites
- Rust (nightly toolchain recommended)
- (Optional) AWS credentials for S3 storage
Build the Server
cd server
cargo build --release
The built binary will be located at server/target/release/server. You can use this path in the integration steps above instead of /usr/local/bin/mcp-v8 if desired.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。