qcode

qforge-dev/qcode

3.2

If you are the rightful owner of qcode and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

QCode is a Model Context Protocol (MCP) server designed to execute JavaScript code securely in a Node.js environment.

Tools
1
Resources
0
Prompts
0

QCode - JavaScript Code Interpreter MCP Server

A Model Context Protocol (MCP) server that provides JavaScript code execution capabilities. This server allows AI assistants to execute JavaScript code in a secure Node.js environment and return the results.

Features

  • JavaScript Execution: Execute JavaScript code in an isolated Node.js environment
  • Timeout Protection: Configurable execution timeouts to prevent runaway code
  • Error Handling: Comprehensive error reporting with execution details
  • Temporary File Management: Automatic cleanup of temporary files
  • Execution Metrics: Returns execution time for performance monitoring

Installation

npm install -g @qforge/qcode

Usage

With Claude Desktop

Add to your Claude Desktop configuration file:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "qcode": {
      "command": "qcode"
    }
  }
}

With Other MCP Clients

The server communicates via stdio and can be integrated with any MCP-compatible client.

Available Tools

execute_javascript

Execute JavaScript code in a Node.js environment.

Parameters:

  • code (string, required): The JavaScript code to execute
  • timeout (number, optional): Timeout in milliseconds (default: 30000)

Returns:

  • success (boolean): Whether the execution was successful
  • output (string): Standard output from the code execution
  • error (string): Error message if execution failed
  • executionTime (number): Time taken to execute in milliseconds

Example:

console.log("Hello, World!");
console.log("Current time:", new Date().toISOString());

const numbers = [1, 2, 3, 4, 5];
const sum = numbers.reduce((a, b) => a + b, 0);
console.log("Sum:", sum);

Security Considerations

  • Code is executed in a temporary directory with limited scope
  • Each execution creates a new isolated process
  • Automatic timeout protection prevents infinite loops
  • Temporary files are automatically cleaned up after execution

Development

Building from Source

git clone <repository-url>
cd qcode
npm install
npm run build

Running in Development

npm run watch

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.