1. Conduid
  2. Developer Tools
  3. Codebench MCP
MCP server · Developer Tools

Codebench MCP

A basic JS VM as an MCP server

Unclaimed MIT last commit 7 months ago devtools
59Fair

Scored 4 hours ago · breakdown

About Codebench MCP

Codebench MCP is an MCP server published by mark3labs in the Developer Tools category: a basic JS VM as an MCP server.

The repository has 3 stars and 0 forks, with the last commit 7 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

From source
git clone https://github.com/mark3labs/codebench-mcp

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Codebench MCP

Powered by Claude · Grounded in docs

I know everything about Codebench MCP. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 4 hours ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • ✓Tests presentA test suite exists in the repository.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

v0.3.1v0.3.1 · 9 Jan 2026Changelog d5347549a55527aa1be3dba7ab684f8d670a79fa Bump actions/checkout from 4 to 5 98977c6db02fef3fcc251401c978c22d6d9b633b Bump actions/checkout from 5 to 6 8edc53e1cb340375daab9b7066093d81176cc70e Bump actions/setup-go from 5 to 6…
v0.3.0v0.3.0 · 18 Jun 2025Changelog 66d082b23daf1a7a1908e82dfca8b6e01887c5e0 increase timeout
v0.2.0v0.2.0 · 13 Jun 2025Changelog afa7e787836f59db4bcb45a57a9a1218cc77fdbc cleanup 76898101fcf55d766bceb7b7afc0ccf2821f64f5 cleanup readme 05aa9251e0647d3f2314cca31e521af662188d5e fix http 59370fc634627a7f804f847b42b61911a6811436 handle body…
v0.1.1v0.1.1 · 12 Jun 2025Changelog 5c9e08d21545a90782d08165c2287ad88b4a9825 Bump github.com/mark3labs/mcp-go bcad5cd4695b15c012254c0d8403e6f9d649b2ad ignore c6f32146307418a78e5dd37d47d199ff449f0e6e update README 2dd4ab68b34981c7040c1dd7d754de52d9f014b8 update…
v0.1.0v0.1.0 · 12 Jun 2025Changelog 2e79f631adacbaa181ddf01d60173bfaed38be95 Add features d739114d59c2f0502df5059502793d260f97d372 Implement basic MCP server 5641ac3115a2253a3cd0d22ee1c3ca412907073c Initial commit 8d44575d710ccb70d0ae76de5a5a6aef40713a85 cleanup…

README

JavaScript Executor MCP Server

This MCP server provides JavaScript execution capabilities with a modern runtime.

Features

The executeJS tool provides:

  • Console API: console.log(), console.error(), console.warn() (built-in)
  • HTTP Server: serve() for server creation (via require('http/server'))
  • Fetch API: Modern fetch() with Request, Response, Headers, FormData (global)
  • Timers: setTimeout(), setInterval(), clearTimeout(), clearInterval() (global)
  • Buffer: Buffer, Blob, File APIs for binary data handling (global)
  • Crypto: Cryptographic functions - hashing, encryption, HMAC (via require('crypto'))
  • Cache: In-memory caching with TTL support (via require('cache'))
  • Additional modules: encoding (global), url (global)

Getting Started

Installation

Using Go Install

go install github.com/mark3labs/codebench-mcp@latest

Usage

As a standalone server

codebench-mcp

With module configuration

# Enable only specific modules
codebench-mcp --enabled-modules http,fetch

# Disable specific modules (enable all others)
codebench-mcp --disabled-modules timers

# Set custom execution timeout (in seconds)
codebench-mcp --execution-timeout 600  # 10 minutes

# Show help
codebench-mcp --help

Available modules:

  • http - HTTP server creation and client requests (require('http/server'))
  • fetch - Modern fetch API with Request, Response, Headers, FormData (available globally)
  • timers - setTimeout, setInterval, clearTimeout, clearInterval (available globally)
  • buffer - Buffer, Blob, File APIs for binary data handling (available globally)
  • cache - In-memory caching with TTL support (require('cache'))
  • crypto - Cryptographic functions (hashing, encryption, HMAC) (require('crypto'))
  • encoding - TextEncoder, TextDecoder for text encoding/decoding (available globally)
  • url - URL and URLSearchParams APIs (available globally)

All modules are enabled by default. You can selectively enable or disable modules using CLI flags.

Note: The executeJS tool description dynamically updates to show only the enabled modules and includes detailed information about what each module provides.

As a library in your Go project

package main

import (
	"log"

	"github.com/mark3labs/codebench-mcp/server"
	"github.com/mark3labs/mcp-go/server"
)

func main() {
	// Create a new JavaScript executor server
	jss, err := server.NewJSServer()
	if err != nil {
		log.Fatalf("Failed to create server: %v", err)
	}

	// Serve requests
	if err := server.ServeStdio(jss); err != nil {
		log.Fatalf("Server error: %v", err)
	}
}

Using InProcessTransport

package main

import (
	"context"
	"log"

	"github.com/mark3labs/codebench-mcp/server"
	"github.com/mark3labs/mcp-go/client"
	"github.com/mark3labs/mcp-go/mcp"
)

func main() {
	// Create the JS server with custom module configuration
	config := server.ModuleConfig{
		EnabledModules: []string{"fetch", "crypto", "buffer"},
	}
	jsServer, err := server.NewJSServerWithConfig(config)
	if err != nil {
		log.Fatalf("Failed to create server: %v", err)
	}

	// Create an in-process client
	mcpClient, err := client.NewInProcessClient(jsServer)
	if err != nil {
		log.Fatalf("Failed to create client: %v", err)
	}
	defer mcpClient.Close()

	// Start the client
	if err := mcpClient.Start(context.Background()); err != nil {
		log.Fatalf("Failed to start client: %v", err)
	}

	// Initialize the client
	initRequest := mcp.InitializeRequest{}
	initRequest.Params.ProtocolVersion = mcp.LATEST_PROTOCOL_VERSION
	initRequest.Params.ClientInfo = mcp.Implementation{
		Name:    "my-app",
		Version: "1.0.0",
	}
	_, err = mcpClient.Initialize(context.Background(), initRequest)
	if err != nil {
		log.Fatalf("Failed to initialize: %v", err)
	}

	// Execute JavaScript code
	callRequest := mcp.CallToolRequest{}
	callRequest.Params.Name = "executeJS"
	callRequest.Params.Arguments = map[string]any{
		"code": `
			console.log("Hello from JavaScript!");
			const result = Math.sqrt(16);
			console.log("Square root of 16 is:", result);
			result;
		`,
	}

	result, err := mcpClient.CallTool(context.Background(), callRequest)
	if err != nil {
		log.Fatalf("Failed to call tool: %v", err)
	}

	if result.IsError {
		log.Printf("JavaScript execution error: %v", result.Content)
	} else {
		log.Printf("JavaScript execution result: %v", result.Content)
	}
}

Usage with Model Context Protocol

To integrate this server with apps that support MCP:

{
  "mcpServers": {
    "javascript": {
      "command": "codebench-mcp"
    }
  }
}

Docker

Running with Docker

You can run the JavaScript Executor MCP server using Docker:

docker run -i --rm ghcr.io/mark3labs/codebench-mcp:latest

Docker Configuration with MCP

To integrate the Docker image with apps that support MCP:

{
  "mcpServers": {
    "javascript": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/mark3labs/codebench-mcp:latest"
      ]
    }
  }
}

Tool Reference

executeJS

Execute JavaScript code with a modern runtime environment.

Parameters:

  • code (required): JavaScript code to execute

Configuration:

  • Default execution timeout: 5 minutes
  • Configurable via --execution-timeout <seconds> CLI flag

Example:

console.log("Hello, World!");

// Basic JavaScript execution
const result = 2 + 3;
console.log('Result:', result);

// Fetch API (available globally when enabled)
const response = await fetch('https://api.example.com/data');
const data = await response.json();

// HTTP server (require import)
const serve = require('http/server');
serve(8000, async (req) => {
  return new Response('Hello World');
});

// Cache operations (require import)
const cache = require('cache');
cache.set('key', 'value');
console.log(cache.get('key'));

// Crypto operations (require import)
const crypto = require('crypto');
const hash = crypto.md5('hello').hex();
console.log('MD5 hash:', hash);

// Timers (available globally)
setTimeout(() => console.log('Hello after 1 second'), 1000);

// Buffer operations (available globally)
const buffer = Buffer.from('hello', 'utf8');
console.log(buffer.toString('base64'));

// URL operations (available globally)
const url = new URL('https://example.com/path?param=value');
console.log('Host:', url.host);
console.log('Pathname:', url.pathname);

Limitations

  • No fs or process modules - File system and process APIs are not available in the runtime
  • Module access varies - Some modules are global (fetch, http), others may need require()
  • Each execution creates a fresh VM - For isolation, each execution starts with a clean state
  • Module filtering - Configuration exists but actual runtime filtering not fully implemented
  • Execution timeout - JavaScript execution is limited by configurable timeout (default: 5 minutes)

Building

go build -o codebench-mcp .

License

See the LICENSE file for details.

README fetched from the repository 4 hours ago. The original is authoritative.

Questions

About Codebench MCP

How do I install Codebench MCP?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Codebench MCP safe to use with an AI agent?

Its trust score is 59 out of 100 (fair). It passes 5 of the 6 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Codebench MCP still maintained?

The last commit was 7 months ago and 5 open issues. That's long enough that you should check whether the maintainer is responding to issues before depending on it.