qforge-dev/qcode
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.
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 executetimeout
(number, optional): Timeout in milliseconds (default: 30000)
Returns:
success
(boolean): Whether the execution was successfuloutput
(string): Standard output from the code executionerror
(string): Error message if execution failedexecutionTime
(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.