MCP Server

MCP Server

Provides remote filesystem operations, git repository management, and process execution capabilities for AI agents through the Model Context Protocol.

Category
访问服务器

README

MCP Server

A high-performance Model Context Protocol (MCP) server providing remote filesystem, git, and process operations. Built with Mastra and Bun for fast execution and distributed as compiled binaries for easy deployment.

Features

Filesystem Operations

  • fs.exists - Check if file/directory exists
  • fs.mkdir - Create directories (with recursive option)
  • fs.readdir - Read directory contents (with file type information)
  • fs.readFile - Read files (text and binary data)
  • fs.stat - Get detailed file/directory statistics
  • fs.writeFile - Write files (text and binary data)
  • fs.fileSize - Get file size
  • fs.delete - Delete files/directories (with recursive option)

Git Operations

  • git.status - Get repository status (staged, modified, untracked files)
  • git.log - Get commit history with optional filtering
  • git.diff - Show differences between commits, branches, or working tree
  • git.branch - List branches and show current branch
  • git.remote - List configured remote repositories
  • git.tag - List all repository tags
  • git.init - Initialize a new git repository
  • git.clone - Clone remote repository (with optional depth and branch)
  • git.add - Add files to staging area
  • git.commit - Create commit with staged changes
  • git.push - Push local commits to remote
  • git.pull - Pull and merge changes from remote
  • git.checkout - Switch or create branches
  • git.merge - Merge changes from another branch
  • git.createTag - Create new tag at current commit

Process Operations

  • process.spawn - Spawn a process with arguments and capture output
  • process.exec - Execute shell commands

Key Capabilities

  • Binary data support via base64 encoding
  • Full TypeScript support with Zod schema validation
  • Built on MCP (Model Context Protocol) for AI agent integration
  • Server-Sent Events (SSE) for real-time communication
  • Cross-platform binary distribution (Linux x64/ARM64, macOS x64/ARM64)
  • NPM package for client library integration
  • Bun runtime for high performance

Installation

Option 1: Install Binary (Recommended)

Download and execute the install script:

curl -fsSL https://raw.githubusercontent.com/supervise-dev/mcp/master/install.sh | bash

Specify a custom install directory:

INSTALL_DIR=/usr/local/bin curl -fsSL https://raw.githubusercontent.com/supervise-dev/mcp/master/install.sh | bash

Install a specific version:

curl -fsSL https://raw.githubusercontent.com/supervise-dev/mcp/master/install.sh | bash -s v1.0.0

Common install directories:

  • /usr/local/bin - System-wide binary (requires sudo for some systems)
  • $HOME/.local/bin - User-specific binary (add to PATH if needed)
  • . - Current directory (default)

Security tip: Review the script before executing:

curl -fsSL https://raw.githubusercontent.com/supervise-dev/mcp/master/install.sh -o install.sh
cat install.sh  # Review the script
bash install.sh

Option 2: Install as NPM Package

npm install @supervise-dev/mcp
# or
bun install @supervise-dev/mcp

Option 3: Development Installation

For local development:

bun install
bun run build

Quick Start

Running the Server

Start the MCP server (default port: 1234):

# Using the binary
./dist/mcp

# Or with a custom port
SV_MCP_PORT=4000 ./dist/mcp

# Development mode with hot reload
bun run dev

The server will be available at:

  • SSE endpoint: http://localhost:1234/sse
  • Message endpoint: http://localhost:1234/message

Client Usage

import { MCPClient } from "@mastra/mcp";

const client = new MCPClient({
  url: "http://localhost:1234",
  ssePath: "/sse",
  messagePath: "/message",
});
await client.connect();

// Filesystem operations
await client.callTool("fs.writeFile", { path: "/file.txt", data: "Hello" });
const { data } = await client.callTool("fs.readFile", { path: "/file.txt" });
await client.callTool("fs.mkdir", { path: "/dir", recursive: true });
const { files } = await client.callTool("fs.readdir", { path: "/dir" });

// Git operations
await client.callTool("git.clone", { url: "https://github.com/user/repo.git", path: "/repo" });
const status = await client.callTool("git.status", { repoPath: "/repo" });
await client.callTool("git.add", { repoPath: "/repo", files: ["."] });
await client.callTool("git.commit", { repoPath: "/repo", message: "Update" });
await client.callTool("git.push", { repoPath: "/repo", remote: "origin", branch: "main" });

// Process operations
const output = await client.callTool("process.spawn", { command: ["ls", "-la"] });
console.log(output.stdout, output.exitCode);

API Reference

All tools are invoked via client.callTool(toolId, input). See the Features section above for complete tool listings.

Common Input Patterns:

  • Filesystem: { path: string, ...options }
  • Git: { repoPath: string, ...options }
  • Process: { command: string[], cwd?: string, env?: Record<string, string> }

Process Output:

interface ProcessOutput {
  stdout: string;
  stderr: string;
  exitCode: number;
  success: boolean;
}

Build & Development

Scripts

# Development
bun run dev                  # Run server with hot reload

# Build
bun run build               # Build default binary for current platform
bun run build:darwin-arm64  # Build macOS ARM64
bun run build:darwin-x64    # Build macOS x64
bun run build:linux-arm64   # Build Linux ARM64
bun run build:linux-x64     # Build Linux x64

# Code Quality
bun run format              # Format with Prettier
bun run lint                # Run ESLint
bun run typecheck           # Run TypeScript check

Architecture

Built with modular design: Server (src/index.ts) handles HTTP/SSE, with separate modules for filesystem (src/tools/fs/), git (src/tools/git/), and process (src/tools/process/) operations. Each module includes query/mutation handlers and Zod type definitions.

MCP Protocol

Implements the Model Context Protocol for AI agent integration, using Server-Sent Events (SSE) for real-time bidirectional communication with full type safety and schema validation.

Security Considerations

This MCP server provides unrestricted access to the server's filesystem, git repositories, and process operations. In production:

⚠️ Important

  • Implement authentication and authorization
  • Add path validation and sandboxing
  • Use HTTPS for encrypted communication
  • Implement rate limiting and request throttling
  • Add comprehensive request logging and auditing
  • Restrict network access to trusted clients only
  • Consider running in a containerized/isolated environment
  • Validate and sanitize all inputs
  • Use process isolation (e.g., seccomp, AppArmor)
  • Restrict git operations to specific repositories
  • Limit process execution to allowed commands

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选