HUB
Sign inSign up

mppnp/tencent-mcp

By mppnp

•Updated 20 days ago

Tencent Cloud MCP gateway — 256+ APIs, deny-by-default safety, DLC SQL & WeData RCA over HTTP

Image
0

1.3K

mppnp/tencent-mcp repository overview

⁠Tencent MCP Gateway

A secure, single-container Model Context Protocol (MCP) gateway for 256+ Tencent Cloud services.


⁠Overview

mppnp/tencent-mcp is a unified single-image deployment container that bridges AI clients (like Claude Code or OpenCode) with 256 Tencent Cloud services (including COS, CVM, TKE, CLS, CAM, STS, DLC, WeData, and EMR).

To ensure complete operational visibility out-of-the-box, this image bundles the core MCP HTTP service alongside an internal Loki log aggregator and a pre-configured Grafana UI, eliminating the need for complex multi-container setups.

⁠What's Inside
  • Node.js 20 Alpine runtime running as a secure non-root user (tencentmcp:1000).
  • Tencent Cloud SDKs (tencentcloud-sdk-nodejs and cos-nodejs-sdk-v5).
  • Built-in Observability Stack: Loki (:3100 internal) + Grafana (:5000) with custom operations dashboards pre-loaded.

⁠Quick Start

⁠1. Prepare Environment and Credential Files

Create a local directory for your configuration, environment variables, and credentials:

mkdir -p tencent-mcp/creds tencent-mcp/config/skills
cd tencent-mcp

Create your credentials file with restricted file permissions (chmod 600):

echo '{"secretId":"AKID...","secretKey":"...","token":"..."}' > creds/credentials.json
chmod 600 creds/credentials.json

Create your metadata defaults file (config/metadata.md):

⁠Tencent MCP metadata

{
  "defaults": {"region": "ap-singapore"},
  "wedata": {"project_id": "p-xxxx","workflow_id": "wf-xxxx","region": "ap-singapore"},
  "dlc": {"data_engine_name": "my-engine","database": "analytics","catalog": "DataLakeCatalog","region": "ap-singapore"}
}


Create your .env file to manage secrets and passwords externally:

TENCENT_MCP_APPROVAL_USER=operator
TENCENT_MCP_APPROVAL_PASSWORD=change-me
GF_SECURITY_ADMIN_USER=admin
GF_SECURITY_ADMIN_PASSWORD=change-me

⁠2. Deployment via Docker Compose

Save the following configuration as docker-compose.yml:

name: tencent-mcp-single
services:
  tencent-mcp:
    image: mppnp/tencent-mcp:latest
    container_name: tencent-mcp
    restart: unless-stopped
    ports:
      - "127.0.0.1:8000:8000"
      - "127.0.0.1:5000:5000"
    environment:
      TENCENT_MCP_HTTP_PORT: "8000"
      TENCENT_MCP_HTTP_HOST: "0.0.0.0"
      TENCENT_MCP_HTTP_PATH: "/mcp"
      TENCENT_MCP_CRED_FILE: "/app/creds/credentials.json"
      TENCENT_MCP_METADATA_FILE: "/app/config/metadata.md"
      TENCENT_MCP_SKILLS_DIR: "/app/config/skills"
      TENCENT_MCP_KNOWLEDGE_DIR: "/app/skills"
      TENCENT_MCP_APPROVAL_USER: "${TENCENT_MCP_APPROVAL_USER}"
      TENCENT_MCP_APPROVAL_PASSWORD: "${TENCENT_MCP_APPROVAL_PASSWORD}"
      TENCENTCLOUD_REGION: "ap-singapore"
      TENCENT_MCP_LOKI_ENDPOINT: "http://localhost:3100"
      TENCENT_MCP_AUDIT_FILE: "/app/logs/audit.ndjson"
      TENCENT_MCP_LOG_FILE: "/app/logs/app.ndjson"
      GF_SECURITY_ADMIN_USER: "${GF_SECURITY_ADMIN_USER}"
      GF_SECURITY_ADMIN_PASSWORD: "${GF_SECURITY_ADMIN_PASSWORD}"
    volumes:
      - ./creds:/app/creds:ro
      - ./config:/app/config:ro
      - tencent_mcp_data:/var/lib/grafana
      - tencent_mcp_loki:/loki
      - tencent_mcp_logs:/app/logs
      - tencent_mcp_skills:/app/skills
    tmpfs:
      - /tmp:mode=1777,size=256m
    healthcheck:
      test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8000/healthz | grep -q ok && wget -qO- http://127.0.0.1:3100/ready | grep -q ready && wget -qO- http://127.0.0.1:5000/api/health | grep -q ok || exit 1"]
      interval: 15s
      timeout: 5s
      retries: 5
      start_period: 60s

volumes:
  tencent_mcp_data:
  tencent_mcp_loki:
  tencent_mcp_logs:
  tencent_mcp_skills:

Bring up the container stack:

docker compose up -d


⁠Port Mapping and Endpoints

PortEndpointDescription
8000http://localhost:8000/Index listing all available HTTP gateways
8000http://localhost:8000/mcpMain MCP Streamable HTTP endpoint (mcp-session-id)
8000http://localhost:8000/healthzSystem health status (?sts=1 includes STS check)
8000http://localhost:8000/stsSTS GetCallerIdentity verification
5000http://localhost:5000Grafana Operations Dashboard (admin / password from .env)

⁠Connecting MCP Clients

Configure your AI assistant clients to point to the remote streaming MCP endpoint:

  • OpenCode (opencode.json):
{
  "mcp": {
    "tencent-mcp": {
      "type": "remote",
      "url": "http://localhost:8000/mcp"
    }
  }
}

  • Claude Code (~/.claude.json):
{
  "mcpServers": {
    "tencent-mcp": {
      "type": "http",
      "url": "http://localhost:8000/mcp"
    }
  }
}


⁠Security and Safety Controls

  • Deny-by-Default Execution: Only safe read operations (Describe, Get, List, Head, Query) and explicitly allowlisted utility tasks are permitted by default.
  • Mutation Protection: Destructive operations (Delete, Drop, Terminate) are blocked out-of-the-box.
  • Atomic Credential Rotation: Credentials are read strictly from the mounted file (creds/credentials.json) rather than environment variables. Modifying the file dynamically updates the container without requiring a full restart.
  • Audit Trails: All requests go through policy enforcement checks, and every action is logged into NDJSON format for Loki consumption with automatic sensitive secret redaction.

⁠Image Tags

  • 0.1.1 — Stable release build (c750a1dc)
  • latest — Points to the most recent stable tag (0.1.1)

⁠License

Licensed under the MIT License.

Tag summary

Content type

Image

Digest

sha256:47858f36b…

Size

239.7 MB

Last updated

20 days ago

docker pull mppnp/tencent-mcp