Skip to content

MagicBeansAI/magictunnel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MagicTunnel

Smart MCP Proxy - One intelligent tool that discovers the right tool for any request.

MagicTunnel

The Problem

MCP clients get overwhelmed with 50+ tools. Users can't find the right tool for their task.

The Solution

MagicTunnel provides one smart tool that:

  1. Analyzes your natural language request
  2. Finds the best tool automatically
  3. Maps parameters and executes it
  4. Returns the result

Quick Start

Full Stack Setup (Recommended)

# Clone and build
git clone https://github.com/your-org/magictunnel.git
cd magictunnel

# Quick setup with smart discovery (Ollama + development mode)
make build-release-semantic && make pregenerate-embeddings-ollama MAGICTUNNEL_ENV=development

# Run MagicTunnel with Web Dashboard & Supervisor
./magictunnel-supervisor

# Access Web Dashboard
open http://localhost:5173/dashboard

# Test smart discovery via API
curl -X POST http://localhost:3001/v1/mcp/call \
  -H "Content-Type: application/json" \
  -d '{
    "name": "smart_tool_discovery", 
    "arguments": {"request": "ping google.com"}
  }'

Lightweight Setup (MCP Server Only)

# Run standalone MCP server (no web dashboard)
./magictunnel

Setup with Smart Discovery (Recommended)

For the best experience with local semantic searc (Requires Ollama embedding model):

# Install Ollama (optional - for local semantic search)
curl -fsSL https://ollama.ai/install.sh | sh
ollama pull nomic-embed-text

# Build with semantic search support
make build-release-semantic

# Pre-generate embeddings for faster startup
make pregenerate-embeddings-ollama

# Run with smart discovery
make run-release-ollama

πŸ“š Complete Setup Guide - Detailed 5-minute tutorial with web dashboard and all options

Example Usage

Instead of knowing which specific tool to use:

// ❌ Before: Need to know exact tool names
{"name": "network_ping", "arguments": {"host": "google.com"}}
{"name": "filesystem_read", "arguments": {"path": "/etc/hosts"}}
{"name": "database_query", "arguments": {"sql": "SELECT * FROM users"}}

Just describe what you want:

// βœ… After: Natural language requests
{"name": "smart_tool_discovery", "arguments": {"request": "ping google.com"}}
{"name": "smart_tool_discovery", "arguments": {"request": "read the hosts file"}}  
{"name": "smart_tool_discovery", "arguments": {"request": "get all users from database"}}

Configuration

Create magictunnel-config.yaml:

server:
  host: "127.0.0.1"
  port: 8080

registry:
  paths: ["./capabilities"]

smart_discovery:
  enabled: true
  tool_selection_mode: "rule_based"  # or "llm_based"

Web Dashboard

MagicTunnel includes a comprehensive web dashboard for management and monitoring:

Access Dashboard

# Start with supervisor (includes web dashboard)
./target/release/magictunnel-supervisor

# Open in browser
open http://localhost:5173/dashboard

Dashboard Features

  • πŸ“Š Real-time Monitoring: System status, performance metrics, and uptime tracking
  • πŸ”§ Tool Management: Browse, test, and manage all available MCP tools
  • πŸ“ˆ Tool Analytics: Track tool usage patterns, execution metrics, and discovery rankings
  • πŸ“‹ Configuration Management: Edit configuration files with validation and backup
  • πŸ“ Live Logs: Real-time log viewer with filtering, search, and export
  • πŸ” MCP Testing: Interactive JSON-RPC command testing interface
  • βš™οΈ Service Control: Start, stop, and restart services via web interface

Add Your Tools

Manual Tool Creation

Create capabilities/my-tools.yaml:

tools:
  - name: "ping"
    description: "Test network connectivity to a host"
    input_schema:
      type: object
      properties:
        host:
          type: string
          description: "Hostname or IP address to ping"
    routing:
      type: "command"
      command: "ping"
      args: ["-c", "4", "{host}"]

Generate Tools from APIs

Automatically generate tools from your existing APIs:

# Generate from OpenAPI/Swagger
./target/release/openapi-generator \
  --spec https://api.example.com/openapi.json \
  --output capabilities/api-tools.yaml \
  --base-url https://api.example.com \
  --auth-type bearer --auth-token $API_TOKEN

# Generate from gRPC services  
./target/release/grpc-generator \
  --proto service.proto \
  --output capabilities/grpc-tools.yaml \
  --endpoint localhost:50051

# Generate from GraphQL schemas
./target/release/graphql-generator \
  --schema schema.graphql \
  --endpoint https://api.example.com/graphql \
  --output capabilities/graphql-tools.yaml

# Unified CLI for all formats
./target/release/magictunnel-cli openapi --spec openapi.json --base-url https://api.example.com --output tools.yaml

πŸ“– Complete API Generation Guide - Detailed CLI documentation with all options and examples

Features

  • βœ… Smart Discovery: AI-powered tool selection with natural language interface
  • πŸ–₯️ Web Dashboard: Real-time monitoring, tool management, and configuration
  • πŸ”§ Supervisor Architecture: Process management with automatic restart and health monitoring
  • βœ… MCP Compatible: Works with Claude, GPT-4, any MCP client
  • 🌐 Protocol Gateway: HTTP, SSE, WebSocket protocol translation for network MCP services
  • βœ… Easy Setup: Single binary, YAML configuration
  • βœ… Extensible: Add tools without coding

Documentation

Core Documentation

Advanced Documentation

Development Documentation

πŸ“š View All Documentation

License

MIT License - see LICENSE for details.

MagicTunnel Dashboards MagicTunnel Dashboards MagicTunnel Dashboards MagicTunnel Dashboards MagicTunnel Dashboards MagicTunnel Dashboards MagicTunnel Dashboards MagicTunnel Dashboards MagicTunnel Dashboards MagicTunnel Dashboards

More Images

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published