fix: add WithHttpTransport() for HTTP mode and add k8s manifests
HTTP transport mode was missing the required WithHttpTransport() call, causing MapMcp() to fail. Also adds Kubernetes manifests for deployment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,7 @@ else
|
|||||||
|
|
||||||
builder.Services
|
builder.Services
|
||||||
.AddMcpServer()
|
.AddMcpServer()
|
||||||
|
.WithHttpTransport()
|
||||||
.WithToolsFromAssembly();
|
.WithToolsFromAssembly();
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
@@ -45,7 +46,7 @@ else
|
|||||||
var port = app.Configuration.GetValue<int?>("Mcp:Port")
|
var port = app.Configuration.GetValue<int?>("Mcp:Port")
|
||||||
?? (Environment.GetEnvironmentVariable("MCP_PORT") is string portStr && int.TryParse(portStr, out var p) ? p : 5000);
|
?? (Environment.GetEnvironmentVariable("MCP_PORT") is string portStr && int.TryParse(portStr, out var p) ? p : 5000);
|
||||||
|
|
||||||
app.MapMcp("/mcp");
|
app.MapMcp();
|
||||||
|
|
||||||
app.Logger.LogInformation("PaperlessMCP server starting on port {Port}", port);
|
app.Logger.LogInformation("PaperlessMCP server starting on port {Port}", port);
|
||||||
app.Logger.LogInformation("MCP endpoint available at: http://localhost:{Port}/mcp", port);
|
app.Logger.LogInformation("MCP endpoint available at: http://localhost:{Port}/mcp", port);
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: paperless-mcp
|
||||||
|
labels:
|
||||||
|
app: paperless-mcp
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: paperless-mcp
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: paperless-mcp
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: ghcr-secret
|
||||||
|
containers:
|
||||||
|
- name: paperless-mcp
|
||||||
|
image: ghcr.io/barryw/paperlessmcp:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 5000
|
||||||
|
protocol: TCP
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: paperless-mcp
|
||||||
|
env:
|
||||||
|
- name: PAPERLESS_API_TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: paperless-token
|
||||||
|
key: token
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: "128Mi"
|
||||||
|
cpu: "100m"
|
||||||
|
limits:
|
||||||
|
memory: "256Mi"
|
||||||
|
cpu: "500m"
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /mcp
|
||||||
|
port: 5000
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 30
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /mcp
|
||||||
|
port: 5000
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: paperless-mcp
|
||||||
|
labels:
|
||||||
|
app: paperless-mcp
|
||||||
|
spec:
|
||||||
|
ingressClassName: traefik
|
||||||
|
rules:
|
||||||
|
- host: paperless-mcp.lan
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: paperless-mcp
|
||||||
|
port:
|
||||||
|
number: 5000
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- secret.yaml
|
||||||
|
- deployment.yaml
|
||||||
|
- service.yaml
|
||||||
|
- ingress.yaml
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: paperless-mcp
|
||||||
|
labels:
|
||||||
|
app: paperless-mcp
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
PAPERLESS_BASE_URL: "https://docs.barrywalker.io"
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: paperless-mcp
|
||||||
|
labels:
|
||||||
|
app: paperless-mcp
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: paperless-mcp
|
||||||
|
ports:
|
||||||
|
- port: 5000
|
||||||
|
targetPort: 5000
|
||||||
|
protocol: TCP
|
||||||
|
name: http
|
||||||
Reference in New Issue
Block a user