# MS-Agent — Lightweight Agent Framework with MCP > MS-Agent is a lightweight agent framework with MCP configs; install via pip and start with an LLMAgent example wired to Streamable HTTP MCP endpoints. ## Install Save as a script file and run: ## Quick Use 1. Install: ```bash pip install ms-agent # or: pip install 'ms-agent[research]' ``` 2. Set your ModelScope key: ```bash export MODELSCOPE_API_KEY={your_modelscope_api_key} ``` 3. Run the MCP-wired example from the README (LLMAgent + `mcpServers`). ## Intro MS-Agent is a lightweight agent framework with MCP configs; install via pip and start with an LLMAgent example wired to Streamable HTTP MCP endpoints. - **Best for:** teams who want an agent runner that can consume MCP configs without building a custom harness - **Works with:** Python; ModelScope API (per README); Streamable HTTP MCP endpoints - **Setup time:** 15–35 minutes ## Practical Notes - Quant: install is `pip install ms-agent` with an optional `[research]` extra per README. - Quant: validate MCP wiring by calling one tool via an MCP endpoint and logging the round-trip latency (baseline for regressions). ## How to use it as a harness (not a demo) The README example is a good start, but production usage needs guardrails: 1. **Pin MCP server configs** per environment (dev/staging/prod) and store them in version control. 2. **Separate credentials** from configs: env vars only, no secrets checked into repos. 3. **Replayability**: keep a small set of “golden tasks” you can re-run after upgrades to detect regressions. If your goal is evaluation/security, wrap runs with: - input/output logging, - tool-call allow-lists, - and a cost/latency budget per task. ### FAQ **Q: Does it support MCP?** A: Yes. The README includes an example `mcpServers` config wired into LLMAgent. **Q: How do I keep runs reproducible?** A: Pin configs + keep golden tasks + log tool calls and outputs. **Q: What should I do first?** A: Wire one simple MCP server endpoint and run a single task end-to-end before adding more tools. ## Source & Thanks > Source: https://github.com/modelscope/ms-agent > License: Apache-2.0 > GitHub stars: 4,244 · forks: 496 --- ## 快速使用 1. 安装: ```bash pip install ms-agent # 或:pip install 'ms-agent[research]' ``` 2. 配置 ModelScope Key: ```bash export MODELSCOPE_API_KEY={your_modelscope_api_key} ``` 3. 按 README 示例运行(LLMAgent + `mcpServers` 配置)。 ## 简介 MS-Agent 是轻量级 Agent 框架,可通过 MCP 配置接入工具;用 pip 安装后,按示例把 Streamable HTTP 的 MCP endpoint 写入配置即可跑通 LLMAgent。 - **适合谁:** 想直接消费 MCP 配置、又不想自建一套 agent harness 的团队 - **可搭配:** Python;ModelScope API(见 README);Streamable HTTP 的 MCP endpoint - **准备时间:** 15–35 分钟 ## 实战建议 - 量化信息:README 给出 `pip install ms-agent`,并提供可选的 `[research]` extra。 - 量化信息:先用一个 MCP endpoint 调通一次工具,并记录往返延迟,作为后续回归基线。 ## 把它当 harness 用,而不是一次性 demo README 示例能跑通,但要上生产还需要护栏: 1. **按环境固化 MCP 配置**(dev/staging/prod)并纳入版本管理。 2. **凭证与配置分离**:只用环境变量注入,不把 secret 写进仓库。 3. **可复现**:维护一小组“金标准任务”,升级后重复跑,快速发现回归。 如果目标是评测/安全,建议额外加: - 输入输出日志, - tool-call allow-list, - 每任务的成本/延迟预算。 ### FAQ **它支持 MCP 吗?** 答:支持。README 给出了 `mcpServers` 配置并接入 LLMAgent 的示例。 **如何保证可复现?** 答:配置固定 + 金标准任务 + 记录 tool calls 与输出。 **第一步做什么?** 答:先接一个简单 MCP endpoint 跑通单任务闭环,再逐步加工具面。 ## 来源与感谢 > Source: https://github.com/modelscope/ms-agent > License: Apache-2.0 > GitHub stars: 4,244 · forks: 496 --- Source: https://tokrepo.com/en/workflows/ms-agent-lightweight-agent-framework-with-mcp Author: Agent Toolkit