Includes Docker support for containerization, making it easy to deploy alongside existing services.
Built with Express.js to provide a lightweight and performant bridge between LLMs and GraphQL APIs.
Exposes any GraphQL API as a set of tools consumable by LLMs, automatically discovering queries and mutations through introspection and translating LLM tool calls into valid GraphQL operations.
Provides Kubernetes manifests for seamless deployment in container orchestration environments.
Conduit 🌉
Unchain your GraphQL API for Large Language Models.
Conduit is a lightweight, automated bridge that exposes any GraphQL API as a set of tools consumable by Large Language Models (LLMs) via the Model Context Protocol (MCP).
It's a "set-it-and-forget-it" microservice. Simply point it at your GraphQL endpoint, and it handles the rest. Whenever you update your API, Conduit automatically discovers the new queries and mutations and exposes them to your AI agents with zero maintenance required.
✨ Features
- Zero-Maintenance: Automatically discovers your API's capabilities using introspection. No manual tool definition is needed.
- Protocol Compliant: Implements the core MCP endpoints (
/listTools
,/getToolSchema
,/executeTool
) out of the box. - Dynamic Execution: Translates LLM tool calls into valid GraphQL queries/mutations and executes them against your API.
- Smart Port Management: Automatically detects port conflicts and finds available alternatives with detailed error reporting.
- WebSocket Support: Optional WebSocket server for real-time MCP communication alongside HTTP transport.
- Enhanced Logging: Comprehensive logging system with configurable levels and formatted output for better debugging.
- Container-Ready: Comes with a
Dockerfile
and Kubernetes manifests for easy deployment alongside your existing services. - Lightweight & Fast: Built with Express.js for a minimal footprint and reliable performance.
🏗️ Architecture
The Conduit bridge is a stateless microservice that sits between your LLM client and your GraphQL API.
🚀 Quick Start
Prerequisites
- Node.js 18+
- Yarn or npm
- A GraphQL API endpoint
Installation & Setup
- Clone and install dependencies:
- Configure your environment:
- Start the development server:
The server will automatically:
- Check for port availability
- Find alternative ports if needed
- Set up HTTP and optionally WebSocket servers
- Provide detailed startup information
⚙️ Configuration
Environment Variables
Create a .env
file based on .env.example
:
Port Management Features
Conduit includes intelligent port management to handle the common "Port is already in use" error:
- Automatic Detection: Checks if preferred ports are available before starting
- Smart Alternatives: Automatically finds alternative ports within a configurable range
- Process Information: Shows which processes are using conflicting ports
- Detailed Logging: Provides clear error messages and troubleshooting suggestions
Handling Port Conflicts
When a port conflict occurs, Conduit will:
- Check the preferred port (from
PORT
environment variable) - Show conflicting processes with PID information
- Search for alternatives in the specified range
- Provide helpful suggestions:
🔌 WebSocket Support
Conduit supports both HTTP and WebSocket transports for MCP communication:
Enabling WebSocket
WebSocket Features
- Automatic Port Management: Finds available ports for WebSocket server
- Real-time Communication: Persistent connections for better performance
- Full MCP Protocol Support: All MCP methods work over WebSocket
- Connection Monitoring: Detailed logging of client connections and disconnections
- Error Handling: Graceful handling of connection issues
Usage Examples
HTTP Transport:
WebSocket Transport:
📊 Enhanced Logging
Conduit provides comprehensive logging with multiple levels and formatted output:
Log Levels
- ERROR: Critical errors and failures
- WARN: Warnings and non-critical issues
- INFO: General information and status updates
- DEBUG: Detailed debugging information
Log Categories
Each log entry is categorized for easy filtering:
[SERVER]
- HTTP server events[WS]
- WebSocket server events[MCP]
- MCP protocol messages[PORT]
- Port management operations
Example Output
🔧 Troubleshooting
Common Issues
"WebSocket server error: Port is already in use"
This error occurs when the WebSocket server cannot bind to its configured port.
Solutions:
- Check what's using the port:
- Use a different port:
- Let Conduit auto-assign a port:
- Disable WebSocket if not needed:
"GraphQL API not responding"
Check your configuration:
Enable debug logging for detailed information:
Port Conflict Prevention
To avoid port conflicts:
- Use non-standard ports: Start with ports like 8000+ instead of common ones
- Check running services: Use
lsof -i
ornetstat
to see what's running - Use port ranges: Configure
PORT_RANGE
to search a wider range - Environment-specific ports: Use different ports per environment
🚦 Server Status Information
When Conduit starts successfully, you'll see:
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A bridge that exposes any GraphQL API as tools consumable by Large Language Models via the Model Context Protocol (MCP), automatically discovering and translating API capabilities with zero maintenance required.
Related MCP Servers
- AsecurityAlicenseAqualityMCP for working with GraphQL servers.Last updated -2470242TypeScriptMIT License
- -securityAlicense-qualityA high-performance FastAPI server supporting Model Context Protocol (MCP) for seamless integration with Large Language Models, featuring REST, GraphQL, and WebSocket APIs, along with real-time monitoring and vector search capabilities.Last updated -9PythonMIT License
- -securityAlicense-qualityA Model Context Protocol server that enables LLMs to interact with GraphQL APIs by providing schema introspection and query execution capabilities.Last updated -4701MIT License
- -securityFlicense-qualityA Model Context Protocol server that enables LLMs to interact with GraphQL APIs by providing schema introspection and query execution capabilities.Last updated -1TypeScript