A Docker Compose solution that exposes the Fabric AI REST API through the MCP Access Point protocol conversion gateway, enabling MCP clients like Cursor Desktop to interact with Fabric's AI pattern management capabilities.
This project provides a no-code solution for converting Fabric's REST API into MCP (Model Context Protocol) compatible services. It combines:
- Fabric Main REST API: The comprehensive AI pattern management system by Daniel Miessler
- MCP Access Point: A protocol conversion gateway that converts HTTP services to MCP services for MCP clients
graph TD
A[MCP Clients<br/>Cursor Desktop, MCP Inspector] --> |SSE/Streamable HTTP| B[MCP Access Point :9999]
B --> |HTTP Requests| C[Fabric REST API :9991]
C --> D[AI Models & Patterns]
E[OpenAPI Spec] --> B
F[Config Files] --> B
G[Docker Volumes] --> C
- Port: 9991 (mapped from internal 8080)
- Purpose: Core AI pattern management and LLM interaction
- Features:
- Chat completions with various LLM providers
- Pattern management (create, read, update, delete)
- Session management for conversation history
- Context management for additional data
- Configuration management
- Port: 9999 (mapped from internal 8080)
- Purpose: Protocol conversion gateway (HTTP β MCP)
- Features:
- Converts HTTP services to MCP-compatible services
- Supports SSE and Streamable HTTP protocols for MCP clients
- Multi-tenancy support for multiple services
- OpenAPI specification integration
- Load balancing and routing capabilities
Main configuration for the MCP Access Point service:
- MCP Services: Defines services accessible via MCP protocol
- Upstream Services: Backend HTTP service configuration
- Routing: Maps MCP operations to HTTP endpoints
- Headers: Authentication and request header management
Orchestrates both services with:
- Service Dependencies: Proper startup order and networking
- Volume Mounts: Persistent data storage for configurations and patterns
- Environment Variables: Secure API key management
- Port Mappings: External access configuration
OpenAPI 3.0 specification defining Fabric's REST API endpoints that will be converted to MCP operations.
- Docker and Docker Compose installed
- API key for Fabric service
-
Clone the repository:
git clone https://github.com/limcheekin/mcp-proxy-to-api-nocode.git cd mcp-proxy-to-api-nocode
-
Set your Fabric API key:
export FABRIC_API_KEY=your_actual_api_key_here
Or edit the
docker-compose.yaml
file and replaceyour_fabric_key_here
with your actual API key. -
Update the proxy configuration: Edit
config.yaml
and replaceyour_fabric_key_here
in the upstreams section:upstreams: - id: 1 headers: X-API-Key: "your_actual_api_key_here" nodes: "fabric:8080": 1
-
Start the services:
docker-compose up -d
-
Verify the deployment:
# Check service status docker-compose ps # Test with MCP Inspector npx @modelcontextprotocol/inspector # Connect to: http://localhost:9999/sse (SSE) or http://localhost:9999/mcp/ (Streamable HTTP)
- Cursor Desktop: Configure MCP server with
http://localhost:9999/sse
- MCP Inspector: Use for debugging and testing MCP operations
- SSE Protocol:
http://localhost:9999/sse
- Streamable HTTP:
http://localhost:9999/mcp/
- Service-specific:
http://localhost:9999/api/fabric/sse
orhttp://localhost:9999/api/fabric/mcp/
Based on the Fabric API, available MCP operations include:
- Chat Operations: Interact with AI models through chat completions
- Pattern Management: Create, read, update, and delete AI patterns
- Session Management: Manage conversation sessions
- Context Management: Handle additional context data
mcps:
- id: fabric
upstream_id: 1
path: config/fabric/openapi.json
upstreams:
- id: 1
headers:
X-API-Key: "your_fabric_api_key"
nodes:
"fabric:8080": 1
scheme: http
mcps:
- id: fabric-main
upstream_id: 1
path: config/fabric/openapi.json
- id: fabric-patterns
upstream_id: 1
routes:
- id: 1
operation_id: list_patterns
uri: /patterns/names
method: GET
meta:
name: List Available Patterns
description: Get all available AI patterns
upstreams:
- id: 1
headers:
X-API-Key: "your_fabric_api_key"
nodes:
"fabric:8080": 1
type: roundrobin
scheme: http
Configure API keys in the upstreams section of config.yaml
:
upstreams:
- id: 1
headers:
X-API-Key: "your_fabric_api_key"
Authorization: "Bearer your_token"
- MCP clients connect via SSE or Streamable HTTP protocols
- Internal Docker networking for service communication
- Configurable headers for upstream authentication
# Start MCP Inspector for debugging
npx @modelcontextprotocol/inspector
# Access at http://localhost:6274/
# Connect to your MCP Access Point:
# - SSE: http://localhost:9999/sse
# - Streamable HTTP: http://localhost:9999/mcp/
# Check container status
docker-compose ps
# View logs
docker-compose logs fabric
docker-compose logs mcp-access-point
# Test direct Fabric API
curl http://localhost:9991/patterns/names -H "X-API-Key: your_api_key"
-
MCP Client Connection Failures:
- Verify MCP Access Point is running on port 9999
- Check that the correct protocol endpoint is used (SSE vs Streamable HTTP)
- Ensure OpenAPI specification is properly loaded
-
Authentication Errors:
- Verify API keys are correctly configured in both services
- Check that upstream headers are properly set in config.yaml
-
Service Communication Issues:
- Ensure Fabric service is accessible from MCP Access Point
- Verify Docker networking and port configurations
# Check MCP Access Point configuration
docker-compose exec mcp-access-point cat /app/config/config.yaml
# Test upstream connectivity
docker-compose exec mcp-access-point wget -O- http://fabric:8080/patterns/names
# Restart with fresh configuration
docker-compose down && docker-compose up -d
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature
- Commit your changes:
git commit -am 'Add new feature'
- Push to the branch:
git push origin feature/new-feature
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Daniel Miessler for the Fabric project
- sxhxliang for the MCP Access Point protocol converter
- Cloudflare for the Pingora framework
- Model Context Protocol Specification
- Fabric Documentation
- MCP Access Point Documentation
- Cursor MCP Integration Guide
Note: This setup converts Fabric's REST API into MCP-compatible services for use with MCP clients like Cursor Desktop. Replace API keys with your actual values before deployment.