# Claude Tools Mcp

> MCP server that exposes Claude Code's file and shell tools (bash, read, write, edit, glob, grep) over HTTP for remote use by any MCP client

- **Type:** MCP server
- **Install:** `agentstack add mcp-mathematic-inc-claude-tools-mcp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [mathematic-inc](https://agentstack.voostack.com/s/mathematic-inc)
- **Installs:** 0
- **Category:** [Cloud & Infrastructure](https://agentstack.voostack.com/c/cloud-infrastructure)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [mathematic-inc](https://github.com/mathematic-inc)
- **Source:** https://github.com/mathematic-inc/claude-tools-mcp

## Install

```sh
agentstack add mcp-mathematic-inc-claude-tools-mcp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Claude Tools MCP Server

An MCP (Model Context Protocol) server that exposes Claude Code's file and shell manipulation tools over HTTP, allowing any MCP client to use these tools remotely.

## Features

This server provides the following tools:

- **bash**: Execute shell commands with timeout support and background execution
- **bash_output**: Retrieve output from background shell processes
- **kill_shell**: Terminate background shell processes
- **read**: Read files with line offset/limit support
- **write**: Write files to disk
- **edit**: Perform exact string replacements in files
- **glob**: Find files using glob patterns
- **grep**: Search file contents using ripgrep (regex support, multiple output modes)

## Installation

### From Source

```bash
go build -o claude-tools-mcp ./cmd/claude-tools-mcp
```

### With Docker

```bash
docker build -t claude-tools-mcp .
docker run -p 8080:8080 claude-tools-mcp
```

#### Docker Build Optimization

The Docker image uses a pre-built runtime base image (`Dockerfile.runtime`) that contains all development tools and dependencies. This runtime image is automatically built and published to GitHub Container Registry (GHCR) whenever `Dockerfile.runtime` or the workflow file changes.

**Benefits:**
- Significantly faster builds (only compiles Go binary, not installing all tools)
- Consistent runtime environment across deployments

**Building the runtime image locally:**
```bash
# Build the runtime base image
docker build -f Dockerfile.runtime -t claude-tools-runtime .

# Build the main image using local runtime
docker build -t claude-tools-mcp .
```

The published runtime image is available at: `ghcr.io/mathematic-inc/claude-tools-mcp-runtime:latest`

## Usage

### Starting the Server

```bash
# Default (localhost:8080)
./claude-tools-mcp

# Custom address
./claude-tools-mcp --addr localhost:9000
```

### With Docker

```bash
# Default port (8080)
docker run -p 8080:8080 claude-tools-mcp

# Custom port
docker run -e PORT=9000 -p 9000:9000 claude-tools-mcp
```

### Configuration

The server runs in stateless mode, allowing each HTTP request to be handled independently. This enables horizontal scaling and simpler deployment.

### Security Features

- **Timeout protection**: Prevents slowloris attacks with ReadHeaderTimeout and IdleTimeout
- **Graceful shutdown**: Responds to SIGINT/SIGTERM, allowing in-flight requests to complete
- **Path validation**: Rejects relative paths to prevent directory traversal
- **File size limits**: 10MB max file size, ~100k token max output
- **Result limits**: Maximum 1000 lines for grep/glob results

## Architecture

The server uses the [MCP Go SDK](https://github.com/modelcontextprotocol/go-sdk) to expose tools over HTTP. All tools are stateless except for:

- **File modification tracking**: Detects when files are edited externally
- **Background shell management**: Tracks long-running bash processes

See [CLAUDE.md](./CLAUDE.md) for detailed architecture documentation.

## Development

### Running Tests

```bash
# All tests
go test ./...

# Specific package
go test ./internal/tools

# Specific test
go test -run TestFunctionName ./internal/tools
```

### Dependencies

- Go 1.25.1+
- [MCP Go SDK](https://github.com/modelcontextprotocol/go-sdk)
- [Cobra](https://github.com/spf13/cobra) for CLI
- [mimetype](https://github.com/gabriel-vasile/mimetype) for file type detection
- ripgrep (`rg`) must be installed for the grep tool

## Repository

[github.com/mathematic-inc/claude-tools-mcp](https://github.com/mathematic-inc/claude-tools-mcp)

## License

Apache-2.0 License. Copyright (c) Mathematic Inc. See [LICENSE](./LICENSE) for details.

> This project is free and open-source work by a 501(c)(3) non-profit. If you find it useful, please consider [donating](https://github.com/sponsors/mathematic-inc).

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [mathematic-inc](https://github.com/mathematic-inc)
- **Source:** [mathematic-inc/claude-tools-mcp](https://github.com/mathematic-inc/claude-tools-mcp)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-mathematic-inc-claude-tools-mcp
- Seller: https://agentstack.voostack.com/s/mathematic-inc
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
