home / skills / tencentcloudbase / cloudbase-mcp / cloudbase-agent-ts

This skill helps you build and deploy AI agents using the CloudBase AG-UI protocol in TypeScript, including adapters, servers, and web UI.

npx playbooks add skill tencentcloudbase/cloudbase-mcp --skill cloudbase-agent-ts

Review the files below or copy the command above to add this skill to your agents.

Files (8)
SKILL.md
3.0 KB
---
name: cloudbase-agent-ts
description: "Build and deploy AI agents with Cloudbase Agent (TypeScript), a TypeScript SDK implementing the AG-UI protocol. Use when: (1) deploying agent servers with @cloudbase/agent-server, (2) using LangGraph adapter with ClientStateAnnotation, (3) using LangChain adapter with clientTools(), (4) building custom adapters that implement AbstractAgent, (5) understanding AG-UI protocol events, (6) building web UI clients with @ag-ui/client, (7) building WeChat Mini Program UIs with @cloudbase/agent-ui-miniprogram."
alwaysApply: false
---

# Cloudbase Agent (TypeScript)

TypeScript SDK for deploying AI agents as HTTP services using the AG-UI protocol.

> **Note:** This skill is for **TypeScript/JavaScript** projects only.

## When to use this skill

Use this skill for **AI agent development** when you need to:

- Deploy AI agents as HTTP services with AG-UI protocol support
- Build agent backends using LangGraph or LangChain frameworks
- Create custom agent adapters implementing the AbstractAgent interface
- Understand AG-UI protocol events and message streaming
- Build web UI clients that connect to AG-UI compatible agents
- Build WeChat Mini Program UIs for AI agent interactions

**Do NOT use for:**
- Simple AI model calling without agent capabilities (use `ai-model-*` skills)
- CloudBase cloud functions (use `cloud-functions` skill)
- CloudRun backend services without agent features (use `cloudrun-development` skill)

## How to use this skill (for a coding agent)

1. **Choose the right adapter**
   - Use LangGraph adapter for stateful, graph-based workflows
   - Use LangChain adapter for chain-based agent patterns
   - Build custom adapter for specialized agent logic

2. **Deploy the agent server**
   - Use `@cloudbase/agent-server` to expose HTTP endpoints
   - Configure CORS, logging, and observability as needed
   - Deploy to CloudRun or any Node.js hosting environment

3. **Build the UI client**
   - Use `@ag-ui/client` for web applications
   - Use `@cloudbase/agent-ui-miniprogram` for WeChat Mini Programs
   - Connect to the agent server's `/send-message` or `/agui` endpoints

4. **Follow the routing table below** to find detailed documentation for each task

## Routing

| Task | Read |
|------|------|
| Deploy agent server (@cloudbase/agent-server) | [server-quickstart](server-quickstart.md) |
| Use LangGraph adapter | [adapter-langgraph](adapter-langgraph.md) |
| Use LangChain adapter | [adapter-langchain](adapter-langchain.md) |
| Build custom adapter | [adapter-development](adapter-development.md) |
| Understand AG-UI protocol | [agui-protocol](agui-protocol.md) |
| Build UI client (Web or Mini Program) | [ui-clients](ui-clients.md) |
| Deep-dive @cloudbase/agent-ui-miniprogram | [ui-miniprogram](ui-miniprogram.md) |

## Quick Start

```typescript
import { run } from "@cloudbase/agent-server";
import { LanggraphAgent } from "@cloudbase/agent-adapter-langgraph";

run({
  createAgent: () => ({ agent: new LanggraphAgent({ workflow }) }),
  port: 9000,
});
```

Overview

This skill provides a TypeScript SDK for building and deploying AI agents using the AG-UI protocol. It focuses on running agents as HTTP services, integrating with LangGraph and LangChain adapters, and delivering web or WeChat Mini Program UIs. Use it when you need a complete agent stack in TypeScript from backend to client.

How this skill works

The SDK exposes an agent-server that serves AG-UI endpoints and streams protocol events over HTTP. Adapters wrap different agent frameworks (LangGraph, LangChain) or let you implement AbstractAgent for custom logic. Clients connect with @ag-ui/client or the Mini Program UI package to send messages, receive streamed responses, and react to AG-UI events.

When to use it

  • Deploying TypeScript/Node agents as HTTP services with AG-UI protocol support
  • Building stateful workflows with the LangGraph adapter
  • Implementing chain-based agents using the LangChain adapter
  • Creating a custom adapter by implementing AbstractAgent for bespoke behavior
  • Connecting web or WeChat Mini Program UIs to an AG-UI-compatible agent server

Best practices

  • Choose the adapter that matches your architecture: LangGraph for state graphs, LangChain for chains, or custom for special flows
  • Expose clear /send-message or /agui endpoints and enable streaming to support progressive UI updates
  • Configure CORS, logging, and observability before deploying to CloudRun or other Node hosts
  • Keep agent state and side effects decoupled from the transport layer by implementing AbstractAgent cleanly
  • Test AG-UI events locally with @ag-ui/client to validate streaming and protocol behavior

Example use cases

  • Deploy an agent server that orchestrates multi-step workflows using LangGraph and streams progress to a web UI
  • Wrap an LLM chain in a LangChain adapter to expose it as an AG-UI compatible HTTP agent
  • Build a WeChat Mini Program chat interface that connects to the agent-server via the Mini Program UI package
  • Create a custom domain-specific agent by implementing AbstractAgent to handle specialized tools and actions
  • Integrate agent observability and request tracing before moving to production on CloudRun or similar

FAQ

Is this skill suitable for non-TypeScript projects?

No. This SDK targets TypeScript/JavaScript environments and relies on TypeScript types and Node tooling.

Can I deploy the agent server anywhere?

Yes. The server runs on Node.js and can be deployed to CloudRun, other container hosts, or any Node host; ensure network and CORS settings allow client connections.