can not configure envoy ai gateway with mcp and connected open-ai compatible provider? #1768
Replies: 3 comments 4 replies
-
|
Can you share the configuration you're using to deploy context7 and the AIGW config you're using to configure it? |
Beta Was this translation helpful? Give feedback.
-
|
Have you tried using the public context7 MCP server? It is free and already in the AIGW examples: https://github.com/envoyproxy/ai-gateway/blob/main/examples/mcp/mcp_example.yaml#L31-L34 |
Beta Was this translation helpful? Give feedback.
-
|
Hey @nacx from https://github.com/envoyproxy/ai-gateway/blob/main/examples/mcp/mcp_example.yaml#L31-L34 I have this deployment manifest ################################################################################
# 1. MCPRoute: Routes /mcp to remote context7 MCP server
################################################################################
apiVersion: aigateway.envoyproxy.io/v1alpha1
kind: MCPRoute
metadata:
name: mcp-route
namespace: default
spec:
parentRefs:
- name: aigw-run
kind: Gateway
group: gateway.networking.k8s.io
path: "/mcp"
backendRefs:
- name: context7 # our remote Context7 backend
kind: Backend
group: gateway.envoyproxy.io
path: "/mcp"
# optional: restrict which tools go to context7
# toolSelector: <if desired, define regex here>
securityPolicy:
apiKey:
secretRef:
name: context7-secrets
################################################################################
# 2. Backend: remote Context7 MCP server
################################################################################
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: Backend
metadata:
name: context7
namespace: default
spec:
endpoints:
- fqdn:
hostname: api.context7.com
port: 443
################################################################################
# 3. BackendTLS Policy: validate TLS for remote endpoints
################################################################################
apiVersion: gateway.networking.k8s.io/v1alpha3
kind: BackendTLSPolicy
metadata:
name: context7-tls
namespace: default
spec:
targetRefs:
- group: "gateway.envoyproxy.io"
kind: Backend
name: context7
validation:
wellKnownCACertificates: "System"
hostname: api.context7.com
################################################################################
# 4. GatewayClass / Gateway definitions (ensure these exist just once)
################################################################################
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
name: aigw-run
spec:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: aigw-run
namespace: default
spec:
gatewayClassName: aigw-run
listeners:
- name: http
protocol: HTTP
port: 1975
infrastructure:
parametersRef:
group: gateway.envoyproxy.io
kind: EnvoyProxy
name: envoy-ai-gatewayi get this repsonse curl -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"id":1,
"method":"initialize",
"params":{
"protocolVersion":"2024-11-05",
"capabilities":{},
"clientInfo":{"name":"curl-test","version":"1.0"}
}
}'
upstream connect error or disconnect/reset before headers. reset reason: remote connection failure, transport failure reason: delayed connect error: Connection refused% and the secret exists |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have deployed the envoy stack from https://aigateway.envoyproxy.io/docs/getting-started/basic-usage and deployed an open-ai compatible backend and curl requests return 200 OK

I have tried to deploy context7 mcp server and use it to query some tools and also to inject context into llm requests but the ai gateway doc says llittle about this.
I face difficulties in achieving this. Can someone document this for me pls?
Beta Was this translation helpful? Give feedback.
All reactions