TC

TCSAS MCP Server for Tencent Mini Program

Deploy the TCSAS MCP server for Tencent Mini Program, built on Tencent's Mini Program framework and powered by Tencent Cloud Super App as a Service.

Quick Install
npx -y @TCMPP-Team/tcsas-devtools-mcp-server

Overview

TCSAS MCP Server for Tencent Mini Program is a lightweight server implementation of the Model Context Protocol (MCP) specifically adapted to Tencent Mini Program applications. It sits between a Mini Program frontend and model/service backends, managing conversation context, routing client requests, and exposing a stable HTTP API that mini programs can call. The project is built on Tencent’s Mini Program framework and designed to take advantage of Tencent Cloud Super App-as-a-Service capabilities.

This server is useful when you need a predictable middle layer to handle model context, session lifecycle, and authentication for LLM-driven features inside a Tencent Mini Program. Rather than embedding model keys or complex orchestration logic in the client, you run the MCP server to centralize policy, logging, caching, and integrations with cloud services.

Repository: https://github.com/TCMPP-Team/tcsas-devtools-mcp-server

Features

  • Implements MCP-style context management for Mini Program clients
  • Session and conversation lifecycle handling (create / update / expire)
  • Simple HTTP API compatible with Mini Program network calls
  • Environment-based configuration and extensible middleware
  • Docker-friendly for container deployment
  • Intended to integrate with Tencent Cloud Super App services and Mini Program SDKs

Installation / Configuration

Requirements: Node.js (LTS) and npm/yarn, or Docker.

Clone the repository and install dependencies:

git clone https://github.com/TCMPP-Team/tcsas-devtools-mcp-server.git
cd tcsas-devtools-mcp-server
npm install

Create an environment configuration file (.env). Example:

# .env
PORT=3000
NODE_ENV=production
MCP_SECRET=replace_with_secure_secret
TENCENT_APPID=your_miniprogram_appid
TENCENT_SECRET=your_miniprogram_secret
MODEL_BACKEND_URL=https://model-backend.example.com
SESSION_TTL=3600

Start in development:

npm run dev

Start production:

npm start

Docker build and run:

docker build -t tcsas-mcp-server .
docker run -d -p 3000:3000 \
  -e PORT=3000 \
  -e MCP_SECRET=replace_with_secure_secret \
  tcsas-mcp-server

Note: Exact env var names and script names may vary with upstream updates. Check the repository README for the latest options.

Environment variables (common)

VariablePurposeExample
PORTHTTP port the server listens on3000
MCP_SECRETShared secret for client-server authenticationsupersecret
TENCENT_APPIDMini Program AppIDwx1234567890abcdef
TENCENT_SECRETMini Program secret for server-side callsabcd1234
MODEL_BACKEND_URLURL of model or inference backendhttps://api.example.com/llm

Available Resources

  • GitHub repository: https://github.com/TCMPP-Team/tcsas-devtools-mcp-server
  • Issue tracker and pull requests on the repo for community support
  • Example Mini Program clients (look for sample directories or companion repos linked from the main repo)
  • Dockerfile and npm scripts to support common deployment flows
  • API reference (embedded in repo or generated by tools like Swagger/OpenAPI if included)

If the repository includes a docs or wiki folder, review it for up-to-date API paths and sample client code.

API Example

A typical interaction pattern between a Mini Program and the MCP server is:

  1. Client starts session (POST /mcp/sessions)
  2. Client sends user message (POST /mcp/sessions/:id/messages)
  3. Server forwards to model backend and returns model response
  4. Server persists context and returns status/result

Example curl to send a message:

curl -X POST "http://localhost:3000/mcp/sessions/123/messages" \
  -H "Authorization: Bearer $MCP_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"role":"user","content":"Hello, who are you?"}'

Adjust paths and headers to match the server release you deploy.

Use Cases

  • Chat assistant inside a Mini Program: centralize model calls and context so the client remains thin and secure.
  • Multi-turn dialogs: persist conversation state server-side for consistent model prompts and session expiration.
  • Content moderation pipeline: route incoming user content through moderation backends before forwarding to models or persisting.
  • Function orchestration: mediate calls between Mini Program clients and multiple backend services (knowledge bases, retrieval systems, model inference endpoints).
  • Analytics & logging: collect usage metrics and audit trails for each session without exposing raw keys in the client.

Quick Tips

  • Keep MCP_SECRET and cloud credentials off the client; store them only on the server and in secure deployment environments.
  • Use HTTPS and proper authentication for production deployments.
  • Review rate limits and cost implications when integrating with external model backends.
  • Check the repo for examples of client-side integration patterns that match Tencent Mini Program networking APIs.

For full details, consult the repository and open issues for community guidance and updates.