SmartCLI MCP Server
Provides web search functionality using DuckDuckGo's HTML search, returning titles, URLs, and summaries for search queries.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SmartCLI MCP ServerFind all TODO comments in this project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SmartCLI
SmartCLI 是一个为了深入学习和探索 AI Agent 核心机制而开发的终端智能编程助手,面向真实项目开发场景,支持读写文件、搜索代码、执行命令、联网检索、调用 MCP 工具、保存记忆、生成快照与恢复现场,并通过 Runtime API 对外提供线程、turn、事件和后台任务能力。
项目定位
项目围绕 ReAct 推理、任务规划、Multi-Agent 协作、MCP 工具扩展、Memory、RAG 与安全执行等能力展开,旨在通过完整的工程实践理解 AI Agent 从模型调用到自主任务执行的核心链路。

它不是一个空壳 Demo:核心路径有自动化测试覆盖,也经过本地 smoke 和真实终端运行验证。
Related MCP server: mcp-server
功能特性
交互式终端 Agent,基于 Rich 和 prompt-toolkit 渲染
单次 prompt 模式,适合脚本、管道和自动化调用
OpenAI-compatible 流式 LLM 客户端,默认面向 DeepSeek 配置
支持
DEEPSEEK_API_KEY等 provider-specific API KeyReAct 工具调用循环,支持 thinking、tool call、tool result、final output 和 usage 事件
Plan-and-Execute 模式,使用独立 Planner 生成 DAG,并按依赖批次执行可并行任务
Multi-Agent 协作模式,包含 Planner、Worker、Reviewer、依赖调度、并行 worker 和 review 重试
内置文件、Shell、grep、glob、记忆、网页搜索、网页抓取、代码搜索等工具
HITL 人工确认、命令/路径安全策略和 JSONL 审计日志
MCP client,支持 stdio 和 Streamable HTTP MCP server
Skill 系统,支持内置、用户级和项目级 skill,支持启用/禁用和
load_skill懒加载注入Chrome DevTools MCP 配置助手
SmartCLI 自身也可以作为 MCP server 暴露内置工具
Runtime API,支持线程、turn、事件日志和持久化后台任务
SQLite 长期记忆和本地代码索引
Agent run 前后自动创建快照,支持恢复现场
支持本地图片和远程图片输入,并根据模型能力自动降级
环境要求
Python 3.11 或更新版本
可选:
rg,用于更快的本地搜索可选:Chrome DevTools MCP 需要 Node.js 20.19.0 LTS 或更新版本、npm/npx 和 Chrome
快速开始
git clone https://github.com/jiahuiwu944-hash/SmartCLI.git
cd SmartCLI
uv sync --extra dev
uv run smartcli --help启动交互模式:
uv run smartcli单次查询:
uv run smartcli -p "帮我总结这个项目"检查当前环境:
uv run smartcli doctor --cwd .配置
SmartCLI 的配置优先级如下:
内置默认配置
~/.paicli/config.json项目级
.paicli/config.json项目级
.envCLI 参数
当前进程环境变量
可以像 Java 项目一样,把 DeepSeek Key 写到项目 .env 里:
PAICLI_PROVIDER=deepseek
PAICLI_MODEL=deepseek-v4-flash
DEEPSEEK_API_KEY=your_key_here也可以使用兼容的 PAICLI_API_KEY:
PAICLI_PROVIDER=deepseek
PAICLI_MODEL=deepseek-v4-flash
PAICLI_API_KEY=your_key_here当前支持的 provider-specific API Key 包括:
DEEPSEEK_API_KEYGLM_API_KEYSTEP_API_KEYKIMI_API_KEY
通过命令行临时覆盖 provider 和 model:
uv run smartcli --provider deepseek --model deepseek-v4-flash连接本地 OpenAI-compatible 服务:
PAICLI_PROVIDER=openai-compatible \
PAICLI_BASE_URL=http://127.0.0.1:11434/v1 \
PAICLI_MODEL=qwen2.5-coder \
uv run smartcli -p "解释这个仓库"交互命令
进入 uv run smartcli 后,可以使用这些 slash commands:
/help
/exit
/clear
/context
/memory
/memory search <query>
/memory clear
/save <fact>
/config
/tools
/hitl on|off|always|auto|never
/policy
/audit [N]
/index [path]
/search <query>
/plan <task>
/team <task>
/model
/skill
/skill list
/skill show <name>
/skill on <name>
/skill off <name>
/skill reload
/mcp
/task
/task add <task>
/task cancel <task_id>
/task log <task_id>
/snapshot
/snapshot clean
/restore <snapshot-id-or-index>内置工具
SmartCLI 内置了一组 Agent 可以调用的本地工具和联网工具:
read_filewrite_filelist_dirglob/glob_filesgrep/grep_codebash/execute_commandweb_searchweb_fetchsave_memoryload_skillsearch_coderevert_turn
写文件、执行命令、远程 MCP 写操作、恢复快照等危险动作,会经过 policy、HITL 和 audit 处理。
联网工具
web_search 使用 DuckDuckGo HTML 搜索,返回标题、URL 和摘要。
web_fetch 可以抓取公开 HTTP/HTTPS 页面,并做基础正文提取。它会拒绝 file://、loopback、私有网络和内网地址,降低 SSRF 风险。
如果需要登录态、浏览器状态或 JS 渲染页面,建议使用 Chrome DevTools MCP。
MCP
SmartCLI 可以连接 MCP server,并把远端工具动态注册为:
mcp__<server-name>__<tool-name>初始化项目级 Chrome DevTools MCP 配置:
uv run smartcli mcp init-chrome --scope project它会写入 .paicli/mcp.json,内容类似:
{
"mcpServers": {
"chrome-devtools": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"chrome-devtools-mcp@latest",
"--no-usage-statistics"
]
}
}
}连接已有 remote-debugging Chrome:
uv run smartcli mcp init-chrome \
--scope project \
--browser-url http://127.0.0.1:9222查看已配置的 MCP server:
uv run smartcli mcp list把 SmartCLI 自身作为 MCP server 暴露:
uv run smartcli mcp serve --transport stdio
uv run smartcli mcp serve --transport http --port 3000HTTP smoke:
curl -sS -X POST http://127.0.0.1:3000 \
-H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'Chrome DevTools MCP 会把浏览器页面和 DevTools 状态暴露给 Agent。不要随意把包含个人账号、敏感数据或生产后台的 Chrome 会话授权给 Agent。
Runtime API
SmartCLI 内置轻量 Runtime API,适合外部系统接入线程、turn、事件和后台任务。
启动服务:
PAICLI_RUNTIME_API_KEY=dev-key \
uv run smartcli serve --http --port 8080创建线程:
curl -sS -X POST http://127.0.0.1:8080/v1/threads \
-H 'x-api-key: dev-key'发送 turn:
curl -sS -X POST http://127.0.0.1:8080/v1/threads/<thread_id>/turns \
-H 'content-type: application/json' \
-H 'x-api-key: dev-key' \
-d '{"message":"总结这个项目"}'读取事件:
curl -sS http://127.0.0.1:8080/v1/threads/<thread_id>/events \
-H 'x-api-key: dev-key'创建并查看后台任务:
curl -sS -X POST http://127.0.0.1:8080/v1/tasks \
-H 'content-type: application/json' \
-H 'x-api-key: dev-key' \
-d '{"message":"后台总结这个仓库"}'
curl -sS http://127.0.0.1:8080/v1/tasks \
-H 'x-api-key: dev-key'图片输入
SmartCLI 支持在 prompt 里引用图片:
分析这张截图 @image:./screenshots/page.png也支持绝对路径和远程图片:
解释这张图 @image:/Users/me/Desktop/diagram.png
看看这个图片 @image:https://example.com/image.png本地图片会自动压缩、缩放,并在需要时把透明底铺成白底,再转为 data URL。如果当前 provider/model 不支持多模态输入,SmartCLI 会自动降级为文本元信息,不会把不支持的图片 payload 发给模型。
快照
每次 Agent run 都会尽力创建项目快照:
pre-turnpost-turn
快照保存在 ~/.paicli/snapshots/,不会写入项目 .git。
REPL 中可以使用:
/snapshot
/restore 1
/snapshot cleanSDK
from paicli.sdk import create_default_engine
engine = create_default_engine(cwd=".")
result = engine.ask_complete("解释这个项目")
print(result.text)
plan_result = engine.plan_complete("先读取 README,再总结项目结构")
team_result = engine.team_complete("让多个 Agent 并行检查核心模块")开发
安装开发依赖:
uv sync --extra dev运行检查:
uv run python -m ruff check .
uv run python -m ruff format --check .
uv run python -m pytest
uv build常用 smoke:
uv run smartcli --version
uv run smartcli --help
uv run smartcli doctor --cwd .
uv run smartcli --plain -p helloLicense
MIT. See LICENSE.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceExposes a set of CLI tools (test generation, documentation generation, linting, test running, code search) to AI assistants via MCP, allowing them to perform these tasks through natural language.Last updated3
- Alicense-qualityAmaintenanceExposes all CLI commands as MCP tools over stdio or HTTP transport.Last updated17Apache 2.0
- Flicense-qualityCmaintenanceExposes MCP tools that enable remote LLMs to query local Docker containers, OS processes, and system services in real time.Last updated
- Alicense-qualityCmaintenanceExposes internal tools from agent harnesses (Claude Code, Codex, etc.) as a standard MCP server by intercepting LLM API calls.Last updated1MIT
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jiahuiwu944-hash/SmartCLI'
If you have feedback or need assistance with the MCP directory API, please join our Discord server