Skip to main content
Glama

MCP-Hub-MCP-Server

Ein Hub-Server, der eine Verbindung zu anderen MCP-Servern (Model Context Protocol) herstellt und diese verwaltet.

Überblick

Dieses Projekt erstellt einen MCP-Hub-Server, der sich mit anderen MCP-Servern verbinden, deren Tools auflisten und ausführen kann. Es ist besonders nützlich, um das 40-Tools-MCP-Limit von Cursor zu umgehen. Auch außerhalb von Cursor hilft es, KI-Fehler zu reduzieren, indem selten verwendete Tools ausgeblendet werden.

Related MCP server: MCP Hub MCP Server

Hauptmerkmale

  • Automatische Verbindung zu anderen MCP-Servern über eine Konfigurationsdatei

  • Auflisten der verfügbaren Tools auf verbundenen Servern

  • Rufen Sie Tools auf verbundenen Servern auf und geben Sie Ergebnisse zurück

Konfiguration

Fügen Sie dies zu Ihrer mcp.json hinzu:

Verwenden von npx

{
  "mcpServers": {
    "mcp-hub": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-hub-mcp",
        "--config-path",
        "/path/to/your/mcp-hub-config.json"
      ]
    }
  }
}

Verwendung von Node (z. B. für lokale Entwicklung oder direkte Ausführung)

Wenn npx Ihre lokalen Änderungen nicht übernimmt oder Sie den erstellten Server lieber direkt ausführen möchten, können Sie ihn wie folgt konfigurieren:

{
  "mcpServers": {
    "mcp-hub": {
      "command": "node",
      "args": [
        "/path/to/your/mcp-hub-mcp/dist/index.js",
        "--config-path",
        "/path/to/your/mcp-hub-config.json"
      ]
    }
  }
}

Hinweis: Stellen Sie sicher, dass Sie das Projekt erstellt haben (z. B. npm run build oder pnpm build ), sodass dist/index.js vorhanden ist.

Systemaufforderung (oder Cursorregeln)

Before processing a user's request, you must use the "list_all_tools" command to identify which tools are available.

Dadurch wird sichergestellt, dass der KI-Assistent immer die verfügbaren Tools überprüft, bevor er versucht, sie zu verwenden.

Installation und Ausführung

Anforderungen

  • Node.js 18.0.0 oder höher

  • npm, yarn oder pnpm

Installation

# Clone repository
git clone <repository-url>
cd mcp-hub-mcp

# Install dependencies
npm install
# or
yarn install
# or
pnpm install

Bauen

npm run build
# or
yarn build
# or
pnpm build

Laufen

npm start
# or
yarn start
# or
pnpm start

Entwicklungsmodus

npm run dev
# or
yarn dev
# or
pnpm dev

Konfigurationsdatei

Der MCP-Hub-MCP-Server verwendet eine Konfigurationsdatei im Claude-Desktop-Format, um automatisch eine Verbindung zu anderen MCP-Servern herzustellen. Sie können die Konfigurationsdatei wie folgt angeben:

  1. Umgebungsvariable: Legen Sie die Umgebungsvariable MCP_CONFIG_PATH auf den Pfad der Konfigurationsdatei fest

  2. Befehlszeilenargument: Verwenden Sie die Option --config-path um den Pfad der Konfigurationsdatei anzugeben

  3. Standardpfad: Verwenden Sie die Datei mcp-config.json im aktuellen Verzeichnis

Konfigurationsdateiformat:

{
  "mcpServers": {
    "serverName1": {
      "command": "command",
      "args": ["arg1", "arg2", ...],
      "env": { "ENV_VAR1": "value1", ... }
    },
    "serverName2": {
      "command": "anotherCommand",
      "args": ["arg1", "arg2", ...]
    }
  }
}

Beispiel:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/username/Desktop",
        "/Users/username/Downloads"
      ]
    },
    "other-server": {
      "command": "node",
      "args": ["path/to/other-mcp-server.js"]
    }
  }
}

Verwendung

Der MCP-Hub-MCP-Server bietet die folgenden Tools:

1. list-all-tools

Gibt eine Liste der Tools von allen verbundenen Servern zurück.

{
  "name": "list-all-tools",
  "arguments": {}
}

2. call-tool

Ruft ein Tool auf einem bestimmten Server auf.

  • serverName : Name des MCP-Servers, von dem aus das Tool aufgerufen werden soll

  • toolName : Name des aufzurufenden Tools

  • toolArgs : An das Tool zu übergebende Argumente

{
  "name": "call-tool",
  "arguments": {
    "serverName": "filesystem",
    "toolName": "readFile",
    "toolArgs": {
      "path": "/Users/username/Desktop/example.txt"
    }
  }
}

Konvention für Commit-Nachrichten

Dieses Projekt folgt konventionellen Commits für die automatische Versionierung und CHANGELOG-Generierung.

Format: <type>(<scope>): <description>

Beispiele:

  • feat: add new hub connection feature

  • fix: resolve issue with server timeout

  • docs: update API documentation

  • chore: update dependencies

Typen:

  • feat : Neue Funktion (kleine Versionsverbesserung)

  • fix : Fehlerbehebung (PATCH-Versionserhöhung)

  • docs : Änderungen nur in der Dokumentation

  • style : Änderungen, die die Bedeutung des Codes nicht beeinflussen

  • refactor : Codeänderung, die weder einen Fehler behebt noch eine Funktion hinzufügt

  • perf : Codeänderung, die die Leistung verbessert

  • test : Fehlende Tests hinzufügen oder vorhandene Tests korrigieren

  • chore : Änderungen am Build-Prozess oder an Hilfswerkzeugen

Wichtige Änderungen: Fügen Sie BREAKING CHANGE: in die Commit-Fußzeile ein, um einen WICHTIGEN Versionssprung auszulösen.

Technologie-Stack

  • Node.js

  • Typoskript

  • @modelcontextprotocol/sdk (Version: ^1.9.0)

  • zod (Version: ^3.22.4)

Lizenz

MIT

Available Tools

2 tools
call-toolC

Call a specific tool from a specific server

Inputs: serverName (required), toolName (required), toolArgs (required).

list-all-toolsA

List all available tools from all connected servers. Before starting any task based on the user's request, always begin by using this tool to get a list of any additional tools that may be available for use.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have completely distinct purposes with no overlap: one is for calling specific tools from servers, while the other is for listing all available tools. An agent can easily tell them apart as they serve different functions in the tool management workflow.

    Naming Consistency4/5

    The tool names follow a consistent verb_noun pattern (call-tool, list-all-tools) with clear actions and objects. The hyphenated style is used consistently, though 'list-all-tools' includes a modifier ('all') which is a minor deviation from a pure verb_noun structure.

    Tool Count2/5

    With only 2 tools, the server feels thin for its apparent purpose of managing MCP tools across servers. While it covers basic operations (call and list), more comprehensive tool management (e.g., discover servers, configure connections) is missing, making the scope underdeveloped.

    Completeness2/5

    The tool surface is severely incomplete for managing an MCP hub. It lacks essential operations such as discovering or connecting to servers, managing server configurations, or handling errors. The two tools provide only minimal functionality, leaving significant gaps that will hinder agent workflows.

    Related MCP Connectors

    Related MCP Servers