Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/green-snakes-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mcp-controller': patch
---

Fix the published CLI distribution so installs fetch the right platform binary from GitHub Releases and add the release, update, and verification flow that supports the new packaging model.
41 changes: 0 additions & 41 deletions .github/workflows/ci.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test

on:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Run type checking
run: bun run typecheck

- name: Run lint
run: bun run lint

- name: Build release binaries
run: bun run build

- name: Make executables runnable
run: |
chmod +x ./bin/mcp-controller
chmod +x ./dist/mcp-controller-linux-x64/bin/mcp-controller

- name: Verify CLI wrapper works
run: ./bin/mcp-controller || [ $? -eq 1 ]

- name: Run tests
run: bun run test
57 changes: 48 additions & 9 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
name: Version

on:
push:
workflow_run:
workflows: ['Test']
branches: [main]
types: [completed]

jobs:
version:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: oven-sh/setup-bun@v2

Expand All @@ -24,18 +29,52 @@ jobs:
- name: Install dependencies
run: bun install

- name: Build
run: bun run build

- name: Test
run: bun run test

- name: Create Release Pull Request or Publish
uses: changesets/action@v1
with:
version: bunx changeset version
publish: bunx changeset publish
version: bun run version
publish: bun run release --publish-only
title: 'chore: version packages'
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true

- name: Check if release needs binaries
id: check-release
run: |
VERSION="v$(jq -r .version package.json)"
if gh release view "$VERSION" &>/dev/null; then
ASSET_COUNT=$(gh release view "$VERSION" --json assets --jq '.assets | length')
if [ "$ASSET_COUNT" -eq 0 ]; then
echo "Release exists with no binaries, will upload"
echo "needs_binaries=true" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
else
echo "Release already has $ASSET_COUNT assets, skipping"
echo "needs_binaries=false" >> $GITHUB_OUTPUT
fi
else
echo "No release found for $VERSION"
echo "needs_binaries=false" >> $GITHUB_OUTPUT
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload binaries to release
if: steps.check-release.outputs.needs_binaries == 'true'
run: |
cp dist/mcp-controller-linux-x64/bin/mcp-controller mcp-controller-linux-x64
cp dist/mcp-controller-linux-arm64/bin/mcp-controller mcp-controller-linux-arm64
cp dist/mcp-controller-darwin-x64/bin/mcp-controller mcp-controller-darwin-x64
cp dist/mcp-controller-darwin-arm64/bin/mcp-controller mcp-controller-darwin-arm64
cp dist/mcp-controller-windows-x64/bin/mcp-controller.exe mcp-controller-windows-x64.exe
gh release upload "${{ steps.check-release.outputs.version }}" \
mcp-controller-linux-x64 \
mcp-controller-linux-arm64 \
mcp-controller-darwin-x64 \
mcp-controller-darwin-arm64 \
mcp-controller-windows-x64.exe \
--clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ node_modules/
bun.lockb

# Build output
mcp-controller
dist/

# TypeScript
*.tsbuildinfo
Expand Down Expand Up @@ -38,4 +38,9 @@ coverage/

# Temporary files
*.tmp
*.temp
*.temp

# Update state
.mcp-controller-update-state
bin/mcp-controller-downloaded
bin/mcp-controller-downloaded.exe
68 changes: 42 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A Model Context Protocol (MCP) server that acts as a proxy between MCP clients a
## Key Features

- **🔧 Tool Filtering**: Selectively enable or disable specific tools from target MCP servers
- **🔍 Transparent Proxying**: Forwards all other MCP protocol messages without modification
- **🔍 Transparent Proxying**: Forwards all other MCP protocol messages without modification
- **⚡ Zero Configuration**: Works with any existing MCP server without changes
- **🛡️ Access Control**: Control which tools clients can access for security and usability
- **📦 Command Line Interface**: Start any MCP server through command arguments
Expand All @@ -15,8 +15,13 @@ A Model Context Protocol (MCP) server that acts as a proxy between MCP clients a
## Installation

```bash
bun install
bun run build
curl -fsSL https://raw.githubusercontent.com/eli0shin/mcp-controller/main/install.sh | bash
```

Or install via npm:

```bash
npm install -g mcp-controller
```

## Usage
Expand All @@ -25,16 +30,16 @@ bun run build

```bash
# Proxy to a local MCP server
./mcp-controller bun run my-server.ts
mcp-controller bun run my-server.ts

# Proxy to an npm-distributed MCP server
./mcp-controller @modelcontextprotocol/server-sequential-thinking
mcp-controller @modelcontextprotocol/server-sequential-thinking

# Proxy to a Python MCP server
./mcp-controller python -m my_mcp_server
mcp-controller python -m my_mcp_server

# Proxy to any executable MCP server
./mcp-controller node server.js --port 3000
mcp-controller node server.js --port 3000
```

### Tool Filtering
Expand All @@ -43,13 +48,13 @@ Control which tools from the target server are exposed to clients:

```bash
# Only allow specific tools (whitelist mode)
./mcp-controller --enabled-tools file-read,file-write,search bun run my-server.ts
mcp-controller --enabled-tools file-read,file-write,search bun run my-server.ts

# Block specific tools (blacklist mode)
./mcp-controller --disabled-tools dangerous-tool,admin-commands python -m my_server
# Block specific tools (blacklist mode)
mcp-controller --disabled-tools dangerous-tool,admin-commands python -m my_server

# Multiple tools (comma-separated, no spaces around commas)
./mcp-controller --enabled-tools tool1,tool2,tool3 node server.js
mcp-controller --enabled-tools tool1,tool2,tool3 node server.js
```

### Filtering Rules
Expand All @@ -63,30 +68,33 @@ Control which tools from the target server are exposed to clients:
## Use Cases

### Security & Access Control

```bash
# Production environment - only allow safe read-only tools
./mcp-controller --enabled-tools read-file,search,list-files my-server
mcp-controller --enabled-tools read-file,search,list-files my-server

# Development environment - block dangerous operations
./mcp-controller --disabled-tools delete-file,format-disk,restart-system my-server
mcp-controller --disabled-tools delete-file,format-disk,restart-system my-server
```

### Client-Specific Customization

```bash
# For a documentation client - only text processing tools
./mcp-controller --enabled-tools text-search,summarize,translate content-server
mcp-controller --enabled-tools text-search,summarize,translate content-server

# For an admin interface - block user-facing tools
./mcp-controller --disabled-tools user-chat,send-email,post-social admin-server
# For an admin interface - block user-facing tools
mcp-controller --disabled-tools user-chat,send-email,post-social admin-server
```

### Testing & Development

```bash
# Test specific functionality by isolating tools
./mcp-controller --enabled-tools database-query,cache-get test-server
mcp-controller --enabled-tools database-query,cache-get test-server

# Debug by excluding problematic tools
./mcp-controller --disabled-tools flaky-api,slow-process debug-server
mcp-controller --disabled-tools flaky-api,slow-process debug-server
```

## How it Works
Expand All @@ -107,15 +115,15 @@ MCP Client ↔ MCP Controller ↔ Target MCP Server
### Message Flow

1. **Client → Controller → Target**: All requests forwarded transparently
2. **Target → Controller → Client**:
2. **Target → Controller → Client**:
- `tools/list` responses are filtered based on configuration
- All other responses pass through unchanged

### What Gets Filtered

- ✅ **`tools/list` responses** - Tool arrays are filtered according to your settings
- ❌ **Tool calls** - Individual tool invocations pass through (filtered tools simply won't be available)
- ❌ **Resources** - Resource lists and access remain unchanged
- ❌ **Resources** - Resource lists and access remain unchanged
- ❌ **Prompts** - Prompt functionality unaffected
- ❌ **Other messages** - Initialization, capabilities, etc. pass through

Expand All @@ -124,6 +132,8 @@ MCP Client ↔ MCP Controller ↔ Target MCP Server
```bash
Usage: mcp-controller [--enabled-tools <tool1,tool2,...>] [--disabled-tools <tool1,tool2,...>] <command> [args...]

mcp-controller update

Options:
--enabled-tools <tools> Comma-separated list of tools to allow (whitelist mode)
--disabled-tools <tools> Comma-separated list of tools to block (blacklist mode)
Expand All @@ -140,15 +150,15 @@ The controller validates arguments at startup and will exit with helpful error m

```bash
# Missing command
$ ./mcp-controller --enabled-tools read
$ mcp-controller --enabled-tools read
Error: No target command specified

# Both filtering modes
$ ./mcp-controller --enabled-tools read --disabled-tools write bun server.ts
$ mcp-controller --enabled-tools read --disabled-tools write bun server.ts
Error: --enabled-tools and --disabled-tools are mutually exclusive

# Missing tool list
$ ./mcp-controller --enabled-tools bun server.ts
$ mcp-controller --enabled-tools bun server.ts
Error: --enabled-tools requires a value
```

Expand All @@ -158,15 +168,21 @@ Error: --enabled-tools requires a value
# Install dependencies
bun install

# Build the executable
# Build release binaries
bun run build

# Run in development mode
# Run via wrapper against the local release build
./bin/mcp-controller bun run tests/fixtures/mcp-server.ts

# Run in development mode
bun run dev <target-command>

# Run tests (includes tool filtering tests)
bun test

# Update installed binary from GitHub Releases
mcp-controller update

# Lint and format
bun run lint
bun run format
Expand All @@ -177,4 +193,4 @@ bun run typecheck

## License

MIT
MIT
Loading
Loading