Allows execution of JavaScript code in one-time script execution mode with comprehensive error handling and formatted stack traces.
Supports module importing from Node.js, allowing access to Node.js built-in modules and functionality.
Provides dynamic importing and usage of npm packages within JavaScript execution environments.
Maintains stateful REPL sessions across multiple interactions with tools to create, execute in, list, and delete sessions.
Enables running TypeScript code with automatic transpilation, supporting both one-time execution and stateful REPL sessions.
JavaScript MCP Server
A JavaScript execution server for the Model Context Protocol (MCP), allowing AI models to run JavaScript code through MCP tool calls.
Features
- JavaScript Execution: Run JavaScript code in one-time script execution mode
- REPL Sessions: Maintain stateful REPL sessions across multiple interactions
- TypeScript Support: Run TypeScript code with automatic transpilation
- NPM Integration: Import and use npm packages dynamically
- Module Importing: Import modules from Node.js and local files
- Error Handling: Comprehensive error handling with formatted stack traces
Installation
Usage
Available Tools
- execute: Run JavaScript code once and return the result
- createSession: Create a new REPL session
- executeInSession: Execute code in an existing session
- listSessions: List all active REPL sessions
- deleteSession: Delete a REPL session
Development
Architecture
The JavaScript MCP server follows a layered architecture:
- MCP Protocol Layer: Handles client communication
- JavaScript Execution Layer: Executes code in isolated environments
- Resource Management Layer: Manages packages and TypeScript
- Session Management Layer: Maintains REPL sessions with state persistence
License
MIT
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Allows AI models to run JavaScript/TypeScript code through Model Context Protocol tool calls, supporting both one-time script execution and stateful REPL sessions with npm package integration.
Related MCP Servers
- -securityAlicense-qualityA TypeScript implementation of a Model Context Protocol server that provides a frictionless framework for developers to build and deploy AI tools and prompts, focusing on developer experience with zero boilerplate and automatic tool registration.Last updated -6TypeScriptMIT License
- -securityFlicense-qualityA server that enables AI assistants to execute JavaScript code with persistent context through stateful REPL sessions, file operations, and package management features.Last updated -TypeScript
- -securityFlicense-qualityA Model Context Protocol implementation for managing and serving AI prompts with a TypeScript-based architecture in a monorepo structure.Last updated -28,526,5832TypeScript
- AsecurityAlicenseAqualityA TypeScript-based Model Context Protocol toolkit that enables AI to interact with code files, manage translations, build projects, and search for files and code content.Last updated -33435TypeScriptMIT License