MCP Tool AI

MCP Tool AI

A configurable MCP gateway that runs multiple Streamable HTTP MCP servers and exposes all their tools through a single endpoint, enabling tool aggregation and routing for MCP clients.

Category
Visit Server

README

MCP Tool AI

This repository contains a configurable Model Context Protocol (MCP) gateway. It runs multiple Streamable HTTP MCP servers and exposes all of their tools through one gateway endpoint that can be used from Cursor, Antigravity, or any other MCP client that supports Streamable HTTP.

Project Structure

  • mcp1.ts - MCP Server 1 on port 3000
    • add_number
    • subtract_number
  • mcp2.ts - MCP Server 2 on port 3001
    • multiply_number
    • divide_number
  • mcp-ai.ts - AI API MCP server on port 3002
    • list_ai_providers
    • list_ai_models
    • chat_with_model
    • openai_compatible_request
  • mcp-gateway.ts - Gateway server on port 8000
    • Lists tools from both backend servers.
    • Prefixes tool names with the backend id, such as 1/add_number or ai/chat_with_model.
    • Routes tool calls back to the correct MCP server.
  • config.ts - Shared environment configuration.
  • .env.example - Example environment configuration.

Requirements

  • Node.js 20 or newer
  • npm

Install

npm install

Create a .env file from .env.example and add your provider keys:

PowerShell:

Copy-Item .env.example .env

Bash:

cp .env.example .env

For NVIDIA hosted NIM, set:

AI_PROVIDERS=nvidia
AI_DEFAULT_PROVIDER=nvidia
AI_NVIDIA_BASE_URL=https://integrate.api.nvidia.com/v1
AI_NVIDIA_MODEL=openai/gpt-oss-120b
AI_NVIDIA_API_KEY=your-key-here

NVIDIA NIM exposes OpenAI-compatible endpoints such as POST /v1/chat/completions and GET /v1/models.

Run

Run everything in one terminal:

npm run all

Or open four terminals from the project folder.

Terminal 1:

npm run server1

Terminal 2:

npm run server2

Terminal 3:

npm run ai

Terminal 4:

npm run gateway

Endpoints:

  • Server 1: http://localhost:3000/mcp
  • Server 2: http://localhost:3001/mcp
  • AI Server: http://localhost:3002/mcp
  • Gateway: http://localhost:8000/mcp

Use the gateway URL in MCP clients:

http://localhost:8000/mcp

Type Check

npm run typecheck

Notes

The gateway uses Streamable HTTP clients to connect to the backend MCP servers. When a client lists tools from the gateway, the gateway fetches tools from each registered backend and returns unique names in the format:

<server-id>/<tool-name>

For example:

  • 1/add_number
  • 1/subtract_number
  • 2/multiply_number
  • 2/divide_number
  • ai/list_ai_providers
  • ai/list_ai_models
  • ai/chat_with_model
  • ai/openai_compatible_request

Environment Configuration

All ports, paths, gateway entries, and AI providers are controlled by env vars.

Core MCP settings:

MCP_LISTEN_HOST=127.0.0.1
MCP_PUBLIC_HOST=localhost
MCP_PATH=/mcp
MCP1_PORT=3000
MCP2_PORT=3001
MCP_AI_PORT=3002
MCP_GATEWAY_PORT=8000
MCP_GATEWAY_SERVERS=1,2,ai

AI provider settings:

AI_PROVIDERS=nvidia,my-local-api
AI_DEFAULT_PROVIDER=nvidia

AI_NVIDIA_BASE_URL=https://integrate.api.nvidia.com/v1
AI_NVIDIA_MODEL=openai/gpt-oss-120b
AI_NVIDIA_API_KEY=your-key-here

AI_MY_LOCAL_API_BASE_URL=http://localhost:11434/v1
AI_MY_LOCAL_API_MODEL=llama3.1
AI_MY_LOCAL_API_API_KEY=

Every provider is assumed to be OpenAI-compatible. The AI MCP server adds the configured key as an Authorization: Bearer ... header by default.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured