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
- Interactive Mode: Direct command line REPL interface for interacting with the server
- Named Pipe Interface: Use named pipes for communication with external processes
Installation
# Clone the repository
git clone https://github.com/yannbam/fresh-js-mcp.git
cd fresh-js-mcp
# Install dependencies
npm install
# Build the project
npm run build
Usage
# Start the MCP server in standard mode
npm start
# Start in interactive REPL mode
node dist/index.js --interactive
# Start with named pipe interface
node dist/index.js --pipe
# See all options
node dist/index.js --help
Operating Modes
The server supports three operating modes:
- Standard MCP Mode (default): Communicates via stdio using the Model Context Protocol
- Interactive Mode: Provides a REPL interface for direct user interaction
- Pipe Mode: Uses named pipes for communication with external processes
See the examples directory for detailed instructions on using these modes.
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
# Run in development mode with hot reloading
npm run dev
# Lint the code
npm run lint
# Run tests
npm test
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
JavaScript MCP Server
Project Details
- yannbam/fresh-js-mcp
- Last Updated: 3/26/2025
Recomended MCP Servers
Collection of apple-native tools for the model context protocol.
AI to AI comms with koboldcpp from Claude/other MCP compatible apps
A TypeScript implementation of a flight & stay search MCP server that uses the Duffel API to search...
Google Forms MCP
Search Stock News MCP offers real-time stock news search with customizable filters via Tavily API, using type-safe operations...
An MCP server inspired by devocs.io
🚀 All-in-one MCP server with AI search, RAG, and multi-service integrations (GitLab/Jira/Confluence/YouTube) for AI-enhanced development workflows. Folk from...
Manage context based on courses, assignments, exams, etc. with knowledge graph based MCP Server
Gemini ➜ OpenAI API proxy. Serverless!





