MCP Hotswap Agent C01affb7

MCPAI代理

提供方 Pradumn13

AI代理 stdio · 本地进程 会话登录 社区 / 第三方
查看接入方式

一个支持运行时工具热插拔、LLM驱动的路由和全栈可观测性的生产级AI代理平台,通过Model Context Protocol实现新功能的即时添加。

一句话选型结论

按资料字段整理

MCP Hotswap Agent C01affb7 属于AI代理类 MCP 服务器,stdio · 本地进程,会话登录,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类AI代理 传输方式stdio · 本地进程 鉴权会话登录 部署方式本地部署
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 15 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

AI代理
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量15暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

适用场景

AI代理Python本地部署热插拔工具本地运行LLM路由全栈可观测

安装与配置

stdio · 本地进程 会话登录
客户端在本机拉起子进程,数据不出本机
pip install -e ".[dev]"

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js 等运行时,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 15 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
给代理接外部能力

让代理在任务中途调用搜索、数据库等真实工具。

多步任务编排

把一串操作拆成步骤,由代理按顺序执行。

自动化重复流程

把固定流程交给代理跑,减少手工操作。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 15 个工具,覆盖面较广,能满足多种调用。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好会话登录对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
MCP Hotswap Agent C01affb7当前 15 stdio · 本地进程 本地部署 有 2026-05-17
Filesystem 560c4363 13 未标注 本地部署 无 2026-05-17
Server Everything (everything) 11 stdio · 本地进程 本地部署 有 2026-05-17
Time 7365cb6d 2 SSE · 服务端推送 远程部署 有 2026-05-18
Everything Claude Code 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Openmemory 557e1585 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

AI代理
字段来自项目仓库与公开索引,中文说明由本站标注
提供方Pradumn13上游标注的维护方 Pradumn13
分类AI代理本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式会话登录远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

10.8 KB
来自项目仓库与上游目录的原文,未做删改

MCP Hot-Swap Multi-Agent Assistant

Hot-pluggable AI tools via Model Context Protocol

A production-grade AI agent platform with runtime tool hot-swapping, LLM-powered routing, and full-stack observability. New capabilities can be added by dropping a Python file — no agent restarts, no code changes, no redeployment.

> 100% local. Runs entirely on your machine with Ollama. No API keys, no cloud costs.


Key Features

  • Hot-Pluggable Tool Architecture — Tool servers start dormant (AST-scanned, not running). They load on-demand, execute, and auto-detach after use — within a single query lifecycle.
  • Dynamic Tool Discovery — The router agent discovers MCP servers at startup and scans dormant plugins statically. New tools appear instantly on registration via REST API.
  • LLM-Powered Routing — Ollama (llama3.2) selects the right tool from natural language; supports parallel multi-tool dispatch via asyncio.gather().
  • Auto Parameter Correction — Positionally remaps LLM-generated wrong parameter names to schema-correct names when count matches — zero manual intervention.
  • Full Observability — 6 Prometheus metrics with a pre-built Grafana dashboard covering P50/P95/P99 latency, tool call rates, and error rate.
  • Conversation Memory — Per-session chat history persisted in Redis, isolated across sessions.
  • One-Command Deploy — bash scripts/start.sh brings up all 7 services, fully wired.

🏗 Architecture

How it works:
1. User sends a natural language query via Streamlit UI
2. FastAPI Router Agent sends the query + available tools list to Ollama
3. LLM decides which tools to call (zero, one, or many)
4. Dormant servers are hot-plugged on demand — loaded, executed, then auto-detached
5. Tools execute in parallel via MCP stdio sessions
6. Results are synthesized into a single response


Tech Stack

Layer Technology Purpose
LLM Ollama + llama3.2 Local inference, zero-cost tool routing
Agent FastAPI + asyncio Async router agent with parallel tool execution
Tool Protocol MCP SDK (stdio transport) Standardised tool discovery and execution
Hot-Swap Engine AST scanner + stop-events Dormant plug-in lifecycle management
Registry Redis Hashes + Sorted Sets Tool metadata, server mapping, script paths
Chat History Redis Lists (capped, 50 msgs) Per-session conversation persistence
UI Streamlit Chat interface + server management panel
Monitoring Prometheus + Grafana 6 instruments, P50/P95/P99 latency dashboards
Orchestration Docker Compose 7-service single-command deployment

MCP Tool Servers

Server Tools Description
Calculator (dormant — hot-plugged on demand) calculate, percentage, split_bill, unit_convert, loan_emi Math, conversions, finance
Web Research search_web, fetch_url, summarize_url DuckDuckGo search, page scraping
Notes Creator create_note, create_note_from_topic, list_notes, read_note Markdown notes with YAML frontmatter
YouTube get_transcript, summarize_video, ask_about_video Transcript extraction, video Q&A

14 tools total across 4 servers. Calculator stays dormant until needed — proving zero-downtime hot-swap.


Quick Start

Prerequisites

  • Docker Desktop (4 GB+ RAM allocated)
  • Ollama with llama3.2 pulled```bash
    ollama pull llama3.2

### Run```bash
git clone https://github.com/Pradumn13/mcp-hotswap-agent.git
cd mcp-hotswap-agent
bash scripts/start.sh

This starts all 7 services (API, frontend, Redis, Ollama, Prometheus, Grafana) and pulls the LLM model automatically.

Service URL
Chat UI http://localhost:8501
Agent API http://localhost:8000/docs
Grafana http://localhost:3000 (admin / admin)
Prometheus http://localhost:9090

Local Development```bash

Install dependencies

pip install -e ".[dev]"

Start Redis and Ollama

redis-server &
ollama serve &

Start the API

uvicorn agents.main:app --reload --port 8000

Start the frontend (separate terminal)

streamlit run frontend/app.py


---

## Hot-Swap Demo

See the core value proposition in action — calculator server is dormant at startup, then hot-plugged mid-session:

**Zero code changes. Zero restarts.**```bash
bash scripts/load_test.sh
``````
Servers at startup:
  - youtube_summary_server  (3 tools, active)
  - notes_creator_server    (4 tools, active)
  - web_research_server     (3 tools, active)

Dormant: calculator (calculate, percentage, split_bill, unit_convert, loan_emi)

Query 1: "search for latest AI news"     → search_web       hot-plug: NO
Query 2: "say hello in French"           → none (LLM)       hot-plug: NO
Query 4: "calculate 42 * 58"             → calculate        hot-plug: YES ⚡ calculator_server
Query 5: "search for python tutorials"   → search_web       hot-plug: NO  (calculator detached)
Query 8: "calculate 15% of 8500"         → calculate        hot-plug: YES ⚡ fresh plug again
Query 11: "split bill of 2400 for 3"     → split_bill       hot-plug: YES ⚡ third cycle

ALL TESTS PASSED ✓  (12/12)
Hot-plug cycles: attached 3× · detached 3× · perfect symmetry

API Endpoints

Method Endpoint Description
POST /query Send a query to the router agent
GET /tools List all registered tools
GET /servers List connected MCP servers
POST /servers/register Register a new MCP server
DELETE /servers/{name} Disconnect a server
GET /chat/history/{session_id} Get conversation history
DELETE /chat/history/{session_id} Clear session history
GET /health Health check (servers, tools, Redis)
GET /metrics Prometheus metrics

Monitoring

The auto-provisioned MCP Assistant Grafana dashboard includes:

Panel Metric
Total Queries sum(queries_total)
Active Servers active_servers_count
Available Tools available_tools_count
Error Rate queries_total{status="error"} / total × 100
Queries Per Minute rate(queries_total[1m]) * 60
Response Time P50/P95/P99 histogram_quantile over query_duration_seconds_bucket
Tool Calls by Server rate(tool_calls_total[5m]) by server
Tool Response Time histogram_quantile(0.95, ...) by tool

Access at http://localhost:3000 (admin / admin)

Grafana Screenshots


Chat UI


Adding a Custom Tool Server

Drop a Python file in servers/:```python

servers/my_tools_server.py

from mcp.server.fastmcp import FastMCP

mcp = FastMCP("my-tools")

@mcp.tool()
def greet(name: str) -> str:
"""Say hello to someone."""
return f"Hello, {name}!"

if name == "main":
mcp.run(transport="stdio")


Register it via the API — no restart required:```bash
curl -X POST http://localhost:8000/servers/register \
  -H "Content-Type: application/json" \
  -d '{"name": "my-tools", "script_path": "servers/my_tools_server.py"}'

The agent immediately starts routing queries to your new tools.


Project Structure```

mcp-hotswap-agent/
├── agents/
│ ├── main.py # FastAPI app with all endpoints
│ ├── router_agent.py # LLM-powered tool routing + hot-swap logic
│ ├── mcp_client.py # MCP stdio session manager + AST plugin scanner
│ ├── tool_registry.py # Redis-backed tool storage (Hash + Sorted Set)
│ ├── chat_history.py # Session-isolated conversation persistence
│ ├── config.py # Settings (env vars)
│ └── metrics.py # Prometheus counters / histograms / gauges
├── servers/
│ ├── calculator_server.py # Math, finance, unit conversion (dormant)
│ ├── web_research_server.py # DuckDuckGo search, URL fetch
│ ├── notes_creator_server.py # Markdown notes with YAML frontmatter
│ └── youtube_summary_server.py # Transcript extraction, video Q&A
├── frontend/
│ └── app.py # Streamlit chat UI + server management
├── docker/
│ ├── Dockerfile
│ ├── Dockerfile.frontend
│ └── docker-compose.yml # 7-service orchestration
├── monitoring/
│ ├── prometheus.yml
│ ├── grafana-dashboard.json
│ ├── grafana-datasource.yml
│ └── grafana-dashboard-provider.yml
├── scripts/
│ ├── start.sh # One-command Docker startup
│ ├── load_test.sh # 12-query hot-swap verification test
│ └── e2e_smoke.sh # E2E smoke test against live stack
├── screenshots/
│ ├── architecture.png
│ └── grafana-metrics/
│ ├── metrics_1.png
│ ├── metrics_2.png
│ ├── metrics_3.png
│ └── metrics_4.png
├── tests/
│ ├── test_hotswap.py # Hot-plug lifecycle: attach → execute → detach → rescan
│ ├── test_integration.py # Full API flows (ASGI client + fakeredis)
│ ├── test_error_scenarios.py # Ollama offline, timeout, garbage JSON, tool errors
│ ├── test_param_correction.py # LLM param name correction edge cases
│ ├── test_chat_history.py # Session-isolated Redis chat history
│ └── test_tool_registry.py # Redis registry CRUD
└── pyproject.toml


---

## Testing```bash
# Run all 40+ tests
pytest tests/ -v

# Run specific modules
pytest tests/test_hotswap.py -v
pytest tests/test_integration.py -v
pytest tests/test_error_scenarios.py -v

# E2E smoke test (requires docker compose up)
bash scripts/e2e_smoke.sh

# Hot-swap load test (12 queries, 3 hot-plug cycles)
bash scripts/load_test.sh

Key Features (Detailed)

  • Hot-Swap Lifecycle — Dormant scan → hot-plug → execute → auto-detach → re-scan, verified with perfect attach/detach symmetry across 3 independent cycles.
  • Async Session Manager — Background asyncio.Task per server with stop-event signals for clean lifecycle; single-retry on connection failure; auto-reconnect on session loss.
  • Parallel Tool Execution — Multi-tool queries dispatch concurrently via asyncio.gather() with per-tool latency tracking.
  • Param Auto-Correction — Positional remapping of LLM key-name mismatches when param count matches schema — tested across 4 edge cases.
  • 5 Fault Modes Tested — Ollama offline, ReadTimeout, garbage JSON (retry + fallback), tool exception propagation, synthesis failure fallback to concatenation.
  • Redis Data Model — tools:{name} Hash, server_tools:{name} Set, tool_index Sorted Set, chat:{session_id} capped List — all ops via async pipeline for atomicity.

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
MCP Hotswap Agent C01affb7 怎么安装?

在客户端按下面的安装命令接入:pip install -e ".[dev]"。装完在客户端配置里引用同一个包或端点。

MCP Hotswap Agent C01affb7 怎么在客户端里配置?

它的传输方式未标注,在客户端 MCP 配置里按官方文档填写启动命令和参数,保存后重启客户端生效。

MCP Hotswap Agent C01affb7 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

MCP Hotswap Agent C01affb7 需要 API Key 吗?

资料标注需要会话登录认证,使用前准备好对应凭据,并按最小权限配置。

MCP Hotswap Agent C01affb7 能提供哪些能力?

资料显示约 15 个工具;能力标签包括 AI代理、本地运行、Python。具体工具清单以官方文档为准。

MCP Hotswap Agent C01affb7 需要什么运行环境?

属于本地进程,需要在本机装好运行环境。

MCP Hotswap Agent C01affb7 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。