Logo MCP Bun Server

MCP Bun Server

Cộng đồng
carlosedp

Bun Javascript Runtime MCP Server for AI Agents

Nhà phát hànhcarlosedp
Kho mãmcp-bun
Ngôn ngữTypeScript
Bản fork
3
Sao
29
Công cụ có sẵn
18
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    MCP Bun Server cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 18 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    29 sao và 3 bản fork từ kho mã được liên kết.

MCP Bun Server

Bun Version Node.js Version NPM Version

A comprehensive Model Context Protocol (MCP) server implementation optimized for the Bun JavaScript runtime. This server provides AI assistants with powerful tools to execute, optimize, and manage JavaScript/TypeScript projects using Bun's high-performance runtime.

🔄 Runtime Compatibility: The server requires bun to be installed in the environment the MCP server will run (Windows native, Windows WSL2, etc). See more installation details below.

sample usage

Features

🚀 Bun-Optimized Execution

  • Fast Script Execution: Run JavaScript/TypeScript files with Bun's optimized runtime
  • Built-in TypeScript Support: Execute TypeScript directly without compilation
  • Memory Optimization: Use --smol flag for memory-constrained environments
  • Hot Reloading: Development server with --hot flag support

🔧 Development Tools

  • Package Management: Install dependencies with bun install
  • Script Runner: Execute package.json scripts with bun run
  • Build System: Optimize projects with bun build including minification and bundling
  • Test Runner: Fast testing with bun test and coverage reporting

📊 Performance Analytics

  • Project Analysis: Analyze bundle sizes, dependencies, and runtime performance
  • Benchmarking: Compare script performance with different optimization flags
  • Optimization Suggestions: Get recommendations for Bun-specific optimizations

🖥️ Server Management

  • Background Servers: Start and manage long-running Bun/Node.js servers
  • Process Monitoring: Track server status, logs, and performance
  • Hot Reloading Servers: Development servers with file watching capabilities

🔍 Resource Discovery

  • Script Listing: Browse available npm/package.json scripts
  • Project Structure: Understand project dependencies and configuration

Quick Start

Prerequisites

  • Bun v1.0.0 or later (recommended)
  • Node.js v18.0.0 or later (for compatibility)

For MacOS/Linux users, install Bun using the instructions on the Bun website.

For Windows, the installation depends if you develope with WSL2 or not:

Configuration

On VSCode MCP Client

For quick installation, use one of the one-click install buttons below...

Install with UV in VS Code Install with UV in VS Code Insiders

Or use the configs below.

If using globally, add the following to your MCP client configuration on settings.json:

json
{
  ...
  "mcp": {
    "servers": {
      "bun": {
        "command": "bunx",
        "args": ["-y", "mcp-bun@latest"],
        "env": {
          "DISABLE_NOTIFICATIONS": "true"
        }
      }
    }
  }
}

On Windows, this doesn't work properly when using WSL2 if your project lives in the WSL2 filesystem and you run VSCode natively on Windows. This happens because the MCP server runs on Windows and the Bun commands are executed in the WSL2 environment, which can lead to path issues.

In this case, configure the MCP server in the project workspace configuration file which makes the MCP server run in the WSL2 environment and execute the Bun commands there.

Create a file named .vscode/mcp.json in your project root with the following content:

json
{
  "servers": {
    "bun": {
      "command": "bunx",
      "args": ["-y", "mcp-bun@latest"],
      "env": {
        "DISABLE_NOTIFICATIONS": "true"
      }
    }

On Claude Desktop

Configure your Claude Desktop MCP client with the following:

json
{
  "mcpServers": {
    "bun": {
      "command": "bunx",
      "args": ["-y", "mcp-bun@latest"],
      "env": {
        "DISABLE_NOTIFICATIONS": "true",  // Optional: disable permission prompts
      }
    }
  }
}

For Development/Local Installation

Clone the repository to your local machine, install dependencies, and build the project:

bash
git clone https://github.com/carlosedp/mcp-bun.git
cd mcp-bun
bun install
bun run build

Then configure your MCP client to use the local build:

json
{
  "servers": {
    "bun-dev": {
      "command": "bun",
      "args": ["/home/user/mcp-bun/dist/mcp-bun.js"],
      "env": {
        "DISABLE_NOTIFICATIONS": "true"
      }
    },
  }
}

For testing there's also the MCP Inspector available, which allows you to run the server with Bun and inspect the commands being executed:

bash
bun run dev

Available Tools

Core Execution Tools

run-bun-script-file

Execute JavaScript/TypeScript files with Bun runtime optimizations.

Parameters:

  • scriptPath: Path to the script file
  • bunArgs: Optional Bun flags (e.g., --smol, --hot)
  • args: Arguments to pass to the script
  • stdin: Optional standard input
  • cwd: Working directory
  • timeout: Execution timeout

run-bun-eval

Execute JavaScript/TypeScript code directly with Bun eval.

Parameters:

  • code: Code to execute
  • evalDirectory: Execution directory
  • bunArgs: Bun optimization flags
  • stdin: Standard input
  • timeout: Execution timeout

Package Management

run-bun-install

Install dependencies using Bun's fast package manager.

Parameters:

  • packageDir: Directory containing package.json
  • dependency: Specific package to install (optional)

run-bun-script

Execute npm scripts using Bun.

Parameters:

  • packageDir: Directory containing package.json
  • scriptName: Script name to run
  • args: Additional arguments

Build & Optimization

run-bun-build

Build and optimize projects with Bun's bundler.

Parameters:

  • entryPoint: Entry file to build
  • outDir: Output directory
  • target: Build target (browser, bun, node)
  • minify: Enable minification
  • sourcemap: Generate source maps
  • splitting: Enable code splitting

run-bun-test

Execute tests with Bun's fast test runner.

Parameters:

  • testPath: Test file or directory
  • coverage: Enable code coverage
  • watch: Enable watch mode
  • bail: Stop after N failures
  • timeout: Test timeout

Performance Analysis

analyze-bun-performance

Comprehensive project performance analysis.

Parameters:

  • projectDir: Project directory
  • entryPoint: Entry point to analyze
  • options: Analysis options (bundle, dependencies, runtime)

benchmark-bun-script

Benchmark script performance with different optimization flags.

Parameters:

  • scriptPath: Script to benchmark
  • iterations: Number of test runs
  • warmup: Warmup runs

Server Management

start-bun-server

Start optimized Bun servers with hot reloading and watch capabilities.

Parameters:

  • scriptPath: Server script path
  • cwd: Working directory
  • bunArgs: Bun flags
  • optimizations: Hot reload, watch, smol mode options

Additional Server Tools

  • start-node-server: Start Node.js servers for compatibility
  • list-servers: List all running servers with status and logs
  • stop-server: Stop running servers gracefully or forcefully
  • get-server-logs: Retrieve server logs with filtering options

Version Management

get-bun-version

Get current Bun version and revision information.

list-bun-versions

List available Bun installations.

select-bun-version

Select specific Bun version for execution.

Performance Optimization Tips

Memory Optimization

Use the --smol flag for memory-constrained environments:

bash
bun --smol your-script.js

Security Considerations

  • The server prompts for permission before executing any command
  • Scripts run with the same permissions as the MCP server process
  • Use environment variable DISABLE_NOTIFICATIONS=true for automation
  • Be cautious when running scripts from untrusted sources

Development

Building

bash
bun run build        # Build with Bun
bun run build:node   # Build with Node.js/TypeScript

Development Mode

bash
bun run dev          # Run with Bun + MCP Inspector
bun run dev:node     # Run with Node.js + MCP Inspector

Linting

bash
bun run lint         # Check for issues
bun run lint:fix     # Fix auto-fixable issues

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Cài đặt

TypingMind
{
  "mcpServers": {
    "mcp-bun": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-bun@latest"
      ]
    }
  }
}

Công cụ có sẵn

  • run-bun-script-file

    Execute a JavaScript/TypeScript script file with Bun runtime and optimizations

  • run-node-script

    Execute a Node.js script file locally

  • run-node-eval

    Execute JavaScript code directly with Node.js eval. Optionally specify a directory to execute in.

  • run-bun-script

    Execute a script from package.json with bun

  • run-bun-install

    Execute bun install to install all dependencies or a specific package

  • get-bun-version

    Get the version of Bun the scripts will be executed with

  • run-bun-eval

    Execute JavaScript/TypeScript code directly with Bun eval with optimizations

  • run-bun-build

    Build and optimize JavaScript/TypeScript projects with Bun

  • run-bun-test

    Execute tests with Bun's fast test runner

  • analyze-bun-performance

    Analyze project performance characteristics with Bun

  • list-bun-versions

    Get available Bun versions if using a version manager

  • benchmark-bun-script

    Benchmark a script's performance with different Bun optimization flags

  • select-bun-version

    Select a specific Bun version to use for subsequent script executions

  • start-bun-server

    Start a Bun server that continues running in the background with optimizations

  • start-node-server

    Start a Node.js server that continues running in the background

  • list-servers

    List all running Node.js servers started via MCP

  • stop-server

    Stop a running Node.js server

  • get-server-logs

    Get the last N lines of logs from a running server

Dùng MCP MCP Bun Server với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối MCP Bun Server, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm MCP Bun Server làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của MCP Bun Server.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "mcp-bun": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-bun"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của MCP Bun Server, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của MCP Bun Server.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng MCP Bun Server giúp tôi làm việc này không?
MCP Bun Server
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng MCP Bun Server.

Câu hỏi thường gặp

Máy chủ MCP MCP Bun Server dùng để làm gì?

MCP Bun Server là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP MCP Bun Server với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng MCP Bun Server với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP MCP Bun Server với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối MCP Bun Server, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP MCP Bun Server với TypingMind?

MCP Bun Server hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP MCP Bun Server cung cấp những công cụ nào trong TypingMind?

MCP Bun Server cung cấp 18 công cụ MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP MCP Bun Server không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu MCP Bun Server yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

bun-scripts

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇