diff --git a/context7/.helmignore b/context7/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/context7/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/context7/Chart.yaml b/context7/Chart.yaml new file mode 100644 index 00000000..c151b3a8 --- /dev/null +++ b/context7/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: context7 +description: Up-to-date code documentation for LLMs and AI code editors (MCP Server). + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: '1.0.3' + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "2.1.4" diff --git a/context7/OlaresManifest.yaml b/context7/OlaresManifest.yaml new file mode 100644 index 00000000..c3b69843 --- /dev/null +++ b/context7/OlaresManifest.yaml @@ -0,0 +1,82 @@ +olaresManifest.version: '0.11.0' +olaresManifest.type: app +metadata: + name: context7 + icon: https://app.cdn.olares.com/appstore/context7/icon.png + description: Up-to-date code documentation for LLMs and AI code editors + appid: context7 + title: Context7 + version: '1.0.3' + categories: + - Developer Tools + - Productivity_v112 +permission: + appData: true + appCache: true +spec: + versionName: '2.1.4' + fullDescription: | + Context7 brings up-to-date, version-specific documentation and code examples directly into your AI coding assistant. That means no more outdated code or hallucinated APIs. + + Works in two modes: + - CLI + Skills — installs a skill that guides your agent to fetch docs using CLI commands (no MCP required)ctx7 + - MCP — registers a Context7 MCP server so your agent can call documentation tools natively + + Features + - Real-time Documentation Access: Provides AI models with access to current documentation for thousands of libraries and frameworks + - Automatic Library Resolution: Automatically finds and retrieves relevant documentation based on user queries + - Up-to-date Content: Always provides the latest documentation from official sources + - Easy Integration: Simple setup with no additional configuration required + - Seamless VS Code Integration: Works directly with VS Code's built-in AI features + + developer: Upstash + website: https://context7.com/ + sourceCode: https://github.com/upstash/context7 + submitter: Olares + locale: + - en-US + - zh-CN + doc: https://context7.com/docs + license: + - text: MIT + url: https://github.com/upstash/context7/blob/master/LICENSE + requiredMemory: 500Mi + limitedMemory: 2Gi + requiredDisk: 512Mi + limitedDisk: 1Gi + requiredCpu: 0.2 + limitedCpu: 1.5 + supportArch: + - amd64 + - arm64 +options: + apiTimeout: 0 + allowedOutboundPorts: + - 80 + - 443 + dependencies: + - name: olares + type: system + version: '>=1.12.3-0' +entrances: +- name: context7 + port: 8080 + host: context7ingress + title: Context7 Terminal + icon: https://app.cdn.olares.com/appstore/context7/icon.png + openMethod: window + authLevel: private +- name: mcpapi + port: 8081 + host: context7ingress + title: Context7 MCP + icon: https://app.cdn.olares.com/appstore/context7/icon.png + invisible: true + openMethod: window + authLevel: internal +envs: + - envName: CONTEXT7_API_KEY + required: false + applyOnChange: true + type: string + editable: true \ No newline at end of file diff --git a/context7/i18n/en-US/OlaresManifest.yaml b/context7/i18n/en-US/OlaresManifest.yaml new file mode 100644 index 00000000..b6490fd1 --- /dev/null +++ b/context7/i18n/en-US/OlaresManifest.yaml @@ -0,0 +1,17 @@ +metadata: + title: Context7 + description: Up-to-date code documentation for LLMs and AI code editors +spec: + fullDescription: | + Context7 brings up-to-date, version-specific documentation and code examples directly into your AI coding assistant. That means no more outdated code or hallucinated APIs. + + Works in two modes: + - CLI + Skills — installs a skill that guides your agent to fetch docs using CLI commands (no MCP required)ctx7 + - MCP — registers a Context7 MCP server so your agent can call documentation tools natively + + Features + - Real-time Documentation Access: Provides AI models with access to current documentation for thousands of libraries and frameworks + - Automatic Library Resolution: Automatically finds and retrieves relevant documentation based on user queries + - Up-to-date Content: Always provides the latest documentation from official sources + - Easy Integration: Simple setup with no additional configuration required + - Seamless VS Code Integration: Works directly with VS Code's built-in AI features diff --git a/context7/i18n/zh-CN/OlaresManifest.yaml b/context7/i18n/zh-CN/OlaresManifest.yaml new file mode 100644 index 00000000..04d88e52 --- /dev/null +++ b/context7/i18n/zh-CN/OlaresManifest.yaml @@ -0,0 +1,17 @@ +metadata: + title: Context7 + description: 为 LLM 和 AI 代码编辑器提供最新代码文档的 MCP 服务器 +spec: + fullDescription: | + Context7 让最新、特定版本的代码文档和代码示例直接集成到你的 AI 编程助手中。这意味着不再有过时的代码或“臆想”API。 + + 支持两种模式: + - CLI + Skills — 安装一个 Skill,通过 CLI 命令引导你的 Agent 获取文档(无需 MCP) + - MCP — 注册 Context7 MCP 服务器,使你的 Agent 能够原生调用文档工具 + + 功能特点 + - 实时文档访问:为 AI 模型提供数千个库和框架的最新官方文档 + - 自动库解析:根据用户查询自动查找并获取相关文档 + - 始终保持最新:始终提供来自官方来源的最新文档内容 + - 易于集成:简单设置,无需额外配置 + - 无缝 VS Code 集成:可直接与 VS Code 内置 AI 功能协同使用 diff --git a/context7/owners b/context7/owners new file mode 100644 index 00000000..d8e1be55 --- /dev/null +++ b/context7/owners @@ -0,0 +1,8 @@ +owners: +- 'LittleLollipop' +- 'TShentu' +- 'hysyeah' +- 'pengpeng' +- 'harveyff' +- 'zdf-org' +- 'lovehunter9' diff --git a/context7/templates/context7.yaml b/context7/templates/context7.yaml new file mode 100644 index 00000000..c647940c --- /dev/null +++ b/context7/templates/context7.yaml @@ -0,0 +1,106 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: context7 + namespace: "{{ .Release.Namespace }}" + labels: + io.kompose.service: context7 +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: context7 + strategy: + type: Recreate + template: + metadata: + creationTimestamp: null + labels: + io.kompose.network/chrome-default: "true" + io.kompose.service: context7 + bytetrade.io/terminal: context7 + spec: + initContainers: + - name: init-tools + image: "docker.io/beclab/upstash-context7-mcp:2.1.4" + securityContext: + runAsUser: 0 + command: ["/bin/sh", "-c"] + args: + - | + apk add --no-cache bash + npm install -g ctx7 + cp -a /usr/local/* /mnt/tools/ + cp /bin/bash /mnt/tools/bin/bash + resources: + requests: + cpu: 50m + memory: 128Mi + limits: + cpu: 500m + memory: 512Mi + volumeMounts: + - name: usr-local + mountPath: /mnt/tools + containers: + - name: context7 + image: "docker.io/beclab/upstash-context7-mcp:2.1.4" + securityContext: + runAsUser: 1000 + env: + - name: MCP_TRANSPORT + value: "http" + - name: PORT + value: "8080" + {{- if .Values.olaresEnv.CONTEXT7_API_KEY }} + - name: CONTEXT7_API_KEY + value: "{{ .Values.olaresEnv.CONTEXT7_API_KEY }}" + {{- end }} + resources: + limits: + cpu: 500m + memory: 512Mi + requests: + cpu: 50m + memory: 128Mi + ports: + - containerPort: 8080 + protocol: TCP + volumeMounts: + - name: usr-local + mountPath: /usr/local + livenessProbe: + tcpSocket: + port: 8080 + initialDelaySeconds: 30 + periodSeconds: 15 + timeoutSeconds: 5 + readinessProbe: + tcpSocket: + port: 8080 + initialDelaySeconds: 15 + periodSeconds: 10 + timeoutSeconds: 5 + volumes: + - name: usr-local + emptyDir: {} + restartPolicy: Always + +--- +apiVersion: v1 +kind: Service +metadata: + name: context7 + namespace: "{{ .Release.Namespace }}" + labels: + io.kompose.service: context7 +spec: + ports: + - name: mcp + port: 8080 + targetPort: 8080 + selector: + io.kompose.service: context7 +status: + loadBalancer: {} diff --git a/context7/templates/ingress.yaml b/context7/templates/ingress.yaml new file mode 100644 index 00000000..becabf47 --- /dev/null +++ b/context7/templates/ingress.yaml @@ -0,0 +1,157 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-config + namespace: {{ .Release.Namespace }} +data: + nginx.conf: | + # Terminal (primary entrance) + server { + listen 8080; + access_log /opt/bitnami/openresty/nginx/logs/access.log; + error_log /opt/bitnami/openresty/nginx/logs/error.log; + + client_max_body_size 10m; + + proxy_connect_timeout 30s; + proxy_send_timeout 300s; + proxy_read_timeout 300s; + proxy_set_header host $host; + proxy_set_header x-forwarded-host $http_host; + proxy_set_header x-real-ip $remote_addr; + proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; + + proxy_http_version 1.1; + proxy_set_header upgrade $http_upgrade; + proxy_set_header connection "upgrade"; + + location / { + proxy_pass http://terminal:80; + proxy_connect_timeout 60s; + proxy_read_timeout 300s; + proxy_send_timeout 300s; + } + } + + # MCP API (secondary entrance) + server { + listen 8081; + access_log /opt/bitnami/openresty/nginx/logs/access.log; + error_log /opt/bitnami/openresty/nginx/logs/error.log; + + client_max_body_size 10m; + + proxy_connect_timeout 60s; + proxy_send_timeout 1800s; + proxy_read_timeout 1800s; + proxy_set_header host $host; + proxy_set_header x-forwarded-host $http_host; + proxy_set_header x-real-ip $remote_addr; + proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; + + proxy_http_version 1.1; + proxy_set_header upgrade $http_upgrade; + proxy_set_header connection "upgrade"; + + location /healthz { + return 200 'ok'; + add_header Content-Type text/plain; + } + + location / { + proxy_pass http://context7:8080; + proxy_next_upstream error timeout http_500 http_502 http_503 http_504; + proxy_connect_timeout 60s; + proxy_read_timeout 1800s; + proxy_send_timeout 1800s; + client_max_body_size 10m; + } + } + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + creationTimestamp: null + labels: + io.kompose.service: context7ingress + name: context7ingress + namespace: '{{ .Release.Namespace }}' +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: context7ingress + strategy: + type: Recreate + template: + metadata: + creationTimestamp: null + labels: + io.kompose.network/chrome-default: "true" + io.kompose.service: context7ingress + spec: + volumes: + - name: nginx-config + configMap: + name: nginx-config + defaultMode: 438 + items: + - key: nginx.conf + path: nginx.conf + containers: + - name: nginx + image: "docker.io/beclab/aboveos-bitnami-openresty:1.25.3-2" + ports: + - containerPort: 8080 + protocol: TCP + - containerPort: 8081 + protocol: TCP + env: + - name: OPENRESTY_CONF_FILE + value: /etc/nginx/nginx.conf + startupProbe: + tcpSocket: + port: 8080 + failureThreshold: 30 + periodSeconds: 10 + livenessProbe: + tcpSocket: + port: 8080 + initialDelaySeconds: 30 + periodSeconds: 60 + timeoutSeconds: 5 + resources: + limits: + cpu: 100m + memory: 256Mi + requests: + cpu: 10m + memory: 64Mi + volumeMounts: + - name: nginx-config + mountPath: /etc/nginx/nginx.conf + subPath: nginx.conf + - name: nginx-config + mountPath: /opt/bitnami/openresty/nginx/conf/server_blocks/nginx.conf + subPath: nginx.conf +--- +apiVersion: v1 +kind: Service +metadata: + name: context7ingress + namespace: {{ .Release.Namespace }} +spec: + type: ClusterIP + selector: + io.kompose.service: context7ingress + ports: + - name: terminal + protocol: TCP + port: 8080 + targetPort: 8080 + - name: mcp + protocol: TCP + port: 8081 + targetPort: 8081 diff --git a/context7/templates/terminal.yaml b/context7/templates/terminal.yaml new file mode 100644 index 00000000..3244711a --- /dev/null +++ b/context7/templates/terminal.yaml @@ -0,0 +1,133 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: terminal-account + namespace: {{ .Release.Namespace }} + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: pod-exec-manager + namespace: {{ .Release.Namespace }} +rules: + - apiGroups: [""] + resources: ["pods"] + verbs: ["get", "list", "create", "delete"] + - apiGroups: [""] + resources: ["pods/exec"] + verbs: ["create"] + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: pod-exec-binding + namespace: {{ .Release.Namespace }} +subjects: + - kind: ServiceAccount + name: terminal-account + namespace: {{ .Release.Namespace }} +roleRef: + kind: Role + name: pod-exec-manager + apiGroup: rbac.authorization.k8s.io + + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + creationTimestamp: null + labels: + io.kompose.service: terminal + name: terminal + namespace: '{{ .Release.Namespace }}' +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: terminal + strategy: {} + template: + metadata: + creationTimestamp: null + labels: + io.kompose.network/chrome-default: "true" + io.kompose.service: terminal + spec: + serviceAccountName: terminal-account + containers: + - name: nginx + image: "docker.io/beclab/terminal:v0.0.7" + env: + - name: PGID + value: "1000" + - name: PUID + value: "1000" + - name: TZ + value: Etc/UTC + command: + - nginx + - -g + - "daemon off;" + securityContext: + privileged: false + resources: + limits: + cpu: 50m + memory: 100Mi + requests: + cpu: 5m + memory: 50Mi + ports: + - name: http + containerPort: 80 + protocol: TCP + - name: terminal + image: "docker.io/beclab/terminal:v0.0.7" + env: + - name: PGID + value: "1000" + - name: PUID + value: "1000" + - name: TZ + value: Etc/UTC + - name: DISPLAY + value: ":0" + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + command: + - apiserver + args: + - --namespace={{ .Release.Namespace }} + - --pod=bytetrade.io/terminal=context7 + - --container=context7 + - --v=3 + securityContext: + privileged: false + resources: + limits: + cpu: 500m + memory: 512Mi + requests: + cpu: 5m + memory: 100Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: terminal + namespace: {{ .Release.Namespace }} +spec: + type: ClusterIP + selector: + io.kompose.service: terminal + ports: + - name: terminal + protocol: TCP + port: 80 + targetPort: 80 diff --git a/context7/values.yaml b/context7/values.yaml new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/context7/values.yaml @@ -0,0 +1 @@ +