THU Agent by CyberCraze

THU Agent by CyberCraze

An interactive coding agent and MCP server that provides access to various AI models via the Tsinghua University lab proxy API. It enables users to inspect files and execute shell commands within their local directory using models like DeepSeek, GLM, and Qwen.

Category
访问服务器

README

NO RATE LIMIT FOR THU STUDENT!! THU Agent by CyberCraze

Interactive terminal coding agent powered by the THU lab proxy OpenAI-compatible API.

The agent runs in your current terminal, works in your current directory, can inspect files, propose shell commands, and wait for your approval before running them.

Platform Use

Linux

Use the built executable:

./dist/thu-agent

Linux executable path:

dist/thu-agent

To run it globally, copy or symlink it into a directory on your PATH, for example:

sudo install -m 755 dist/thu-agent /usr/local/bin/thu-agent

Then run:

thu-agent

Windows

Use the Windows executable after building it on Windows:

.\dist\thu-agent.exe

Windows executable path:

dist\thu-agent.exe

To run it globally on Windows, add the repo dist directory to your PATH, or copy the executable into a directory already on PATH.

Example PowerShell command to add the current repo dist directory for your user:

[Environment]::SetEnvironmentVariable(
  "Path",
  $env:Path + ";C:\Users\USER\Downloads\THU-deepseek-glm-api-mcp-server\dist",
  "User"
)

Then open a new terminal and run:

thu-agent.exe

Build it from Windows with:

powershell -ExecutionPolicy Bypass -File .\build_agent_windows.ps1

macOS

There is no packaged macOS binary in this repo.

Run the Python entrypoint directly:

python3 agent.py

If you want a global command on macOS, create a small wrapper in /usr/local/bin or another directory on your PATH:

sudo ln -sf "/absolute/path/to/agent.py" /usr/local/bin/thu-agent.py

or run the repo-local command directly from a shell alias.

API Setup

The agent uses the THU lab proxy.

Create an API key first at:

https://lab.cs.tsinghua.edu.cn/ai-platform/c/new

Base URL:

https://lab.cs.tsinghua.edu.cn/ai-platform/api/v1

Set your key with an environment variable:

export THU_LAB_PROXY_API_KEY='your_proxy_key_here'
export THU_LAB_PROXY_BASE_URL='https://lab.cs.tsinghua.edu.cn/ai-platform/api/v1'

On Windows PowerShell:

$env:THU_LAB_PROXY_API_KEY='your_proxy_key_here'
$env:THU_LAB_PROXY_BASE_URL='https://lab.cs.tsinghua.edu.cn/ai-platform/api/v1'

You can also launch the agent and paste the key when prompted. The agent saves it into a per-user global config file for reuse.

Config location:

  • Linux and macOS: ~/.thu-cybercraze-agent/.env
  • Windows: %USERPROFILE%\.thu-cybercraze-agent\.env

Start the Agent

From the repo root:

./dist/thu-agent

Or with Python:

python3 agent.py

You can also pass the model and key directly:

python3 agent.py --model deepseek-v3.2 --api-key "$THU_LAB_PROXY_API_KEY"

Model Selection

The startup picker shows the models currently wired into the agent.

Default model:

deepseek-v3.2

Current supported models:

  • qwen3-max-thinking
  • qwen3-max
  • glm-5
  • glm-5-thinking
  • glm-4.7-thinking
  • kimi-k2.5
  • kimi-k2.5-thinking
  • minimax-m2.5
  • minimax-m2.5-thinking
  • qwen3.5-plus
  • qwen3.5-plus-thinking
  • qwen3.5-mini
  • deepseek-v3.2-thinking
  • deepseek-v3.2

In-Agent Commands

Slash commands available in the session:

  • /help
  • /model
  • /key
  • /pwd
  • /alwaysRun
  • /exit

While the agent is thinking or running a command, press Ctrl+C to cancel the current operation and return to the prompt without exiting the whole session.

Typical Workflow

  1. Start the agent.
  2. Choose a model or press Enter for the default.
  3. Reuse the saved API key or paste a new one.
  4. Type requests at the > prompt.
  5. Approve commands when the agent asks.

Example prompts:

  • list the files in this directory
  • write a hello world script in python
  • inspect this project and explain how to run it
  • create a small bash script that prints the current date

Command Approval

By default, the agent asks before running each command.

To auto-approve commands for the current session:

/alwaysRun

Use that carefully.

Build

Linux build

bash build_agent.sh

Result:

dist/thu-agent

This build uses the current Python environment and PyInstaller, with extra excludes plus strip/optimize enabled to keep the binary smaller.

Windows build

Run this on Windows, not inside WSL:

py -3 -m pip install pyinstaller
powershell -ExecutionPolicy Bypass -File .\build_agent_windows.ps1

Result:

dist\thu-agent.exe

macOS run path

macOS users should run the Python entrypoint directly:

python3 agent.py

Direct API Test

You can test the proxy directly:

curl --location --request POST \
  'https://lab.cs.tsinghua.edu.cn/ai-platform/api/v1/chat/completions' \
  --header 'Content-Type: application/json' \
  --header "authorization: Bearer $THU_LAB_PROXY_API_KEY" \
  --data-raw '{
    "model": "deepseek-v3.2",
    "messages": [{"role": "user", "content": "Reply with exactly: ok"}],
    "temperature": 0.2,
    "repetition_penalty": 1.1,
    "stream": false
  }'

Notes

  • The Linux binary is already buildable from this repo.
  • The Windows .exe must be built from a Windows Python environment.
  • macOS users should run agent.py directly unless they package it themselves.
  • The MCP server code in server.py still uses the older backend and is separate from the interactive agent in agent.py.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选