mcpField
T
timps-swarm

timps-swarm

本地服务
github.com/Sandeeprdy1729AI 与智能体18 周前更新

关于 timps-swarm

timps-swarm 面向编码 Agent,整合 161 个专业 Agent、MCP 工具和命令行工作流。安装器可配置检测到的编码工具,并将 Agent 注册为并行子 Agent;也支持本地 Ollama 和外部 LLM 提供方。

主要功能

  1. 01九类共 161 个专业 Agent
  2. 02为检测到的工具安装 MCP 配置
  3. 03将 Agent 注册为并行子 Agent
  4. 04运行代码库安全审计
  5. 05使用 Ollama 或已配置的 LLM 提供方

适用场景

  1. 01审计代码库中的密钥、CVE 和 SAST 问题
  2. 02并行调度专业 Agent 处理编码任务
  3. 03生成 API 设计和数据库架构
  4. 04运行多阶段软件开发流程

MCP 相关

提供包含专业 Agent 工具的 stdio MCP 服务。`install-mcp` 可为检测到的工具写入服务配置,也能将 Agent 注册为原生子 Agent;Node.js 代理可将调用转发至可访问的 FastAPI 服务。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"sandeeprdy1729-timps-swarm": {
"command": "npx",
"args": [
"-y",
"timps-swarm"
],
"env": {
"GEMINI_API_KEY": "<GEMINI_API_KEY>",
"ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>",
"OPENAI_API_KEY": "<OPENAI_API_KEY>",
"GROQ_API_KEY": "<GROQ_API_KEY>",
"OLLAMA_HOST": "<OLLAMA_HOST>",
"TIMPS_MODEL_PATH": "<TIMPS_MODEL_PATH>",
"TIMPS_MAX_AGENT_WORKERS": "<TIMPS_MAX_AGENT_WORKERS>",
"REDIS_URL": "<REDIS_URL>",
"TIMPS_AUTH": "<TIMPS_AUTH>",
"LOG_LEVEL": "<LOG_LEVEL>"
}
}
}
}
启动命令npx -y timps-swarm
需要配置的环境变量
GEMINI_API_KEY密钥Gemini API key (recommended free tier)
ANTHROPIC_API_KEY密钥Anthropic API key
OPENAI_API_KEY密钥OpenAI API key
GROQ_API_KEY密钥Groq API key
OLLAMA_HOSTOllama host URL
TIMPS_MODEL_PATHTIMPS model path for Ollama
TIMPS_MAX_AGENT_WORKERSMax concurrent agent workers
REDIS_URLRedis URL for state persistence
TIMPS_AUTH密钥Enable API key authentication
LOG_LEVELLog level (DEBUG, INFO, WARNING, ERROR)

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npmtimps-swarm2.2.3

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

TIMPS 群组

只需一条 install-mcp 命令,即可将 161 位 AI 专家部署到你使用的所有编码工具中——作为并行子 Agent,而不仅仅是 MCP 工具。

npm License: MIT Python 3.11+ MCP Protocol Discord

快速开始 · 子 Agent · 161 位 Agent · MCP 配置 · CLI · 架构


TIMPS 群组并行 Agent 演示 并行派遣 4 个 Agent 与顺序执行相比,速度提升 3 倍(64 秒对比 192 秒)

功能

  • 30 秒内审计任意代码库 — npx timps-swarm audit ./ 可查找 CVE、硬编码密钥和 OWASP 问题。无需后端、无需配置、无需 API 密钥。
  • 在所有 AI 工具中使用 161 位专家 Agent — 一条 install-mcp 命令即可为 9 款 IDE(Claude Code、Cursor、Windsurf、Continue、Aider、Cline、Zed、VS Code、Gemini、Codex、Amp、Warp)写入 MCP 配置,并且将每个 Agent 注册为原生子 Agent,让 Claude Code / Cursor / Codex 能通过 Task(subagent_type=...) 并行派遣它们。
  • 本地优先,自带密钥(BYOK) — 使用 Ollama 运行,API 费用为零;需要更强性能时,可接入 Gemini/Anthropic/OpenAI/Groq。
  • 无需 Python 后端也能运行 — npm install -g timps-swarm 会提供 Node.js MCP stdio 代理(cli/lib/mcp-proxy.js),可连接到任意正在运行的 FastAPI 服务(本地服务或通过 TIMPS_API_URL 指定的远程服务)。Python 代码库为可选项。

快速开始

npm i -g timps-swarm

将此代码库交给任意编码 Agent,它就会自动完成配置。 SETUP.md 是一组操作指令(而非单纯的文档)——当用户 克隆代码库并告诉 Claude Code、opencode、Codex、Cursor、Windsurf, 或任何其他 Agent“读取 SETUP.md 并帮我完成配置”时,该 Agent 会安装 后端,为其正在运行的工具注册 timps-swarm MCP 服务, 并开始并行派遣 161 位专家 Agent。

接下来,将其接入你的编码 Agent:

npx timps-swarm install-mcp

install-mcp 会自动检测你机器上的所有 AI 工具,并执行以下操作:

  1. 将 timps-swarm MCP 服务条目写入每个检测到的 IDE 配置(并通过显式的 env: 块传递 ANTHROPIC_API_KEY、OPENAI_API_KEY、GEMINI_API_KEY、GROQ_API_KEY、TIMPS_API_URL、OLLAMA_HOST、REDIS_URL)。
  2. 为每个 TIMPS 工具创建一个子 Agent .md 文件,写入 ~/.claude/agents/、./.claude/agents/ 和 ~/.codex/agents/。

重启工具后,161 个 Agent 将同时作为 MCP 工具和并行子 Agent 出现。

无需安装即可运行(零配置):

npx timps-swarm audit ./          # security scan any repo — works immediately

install 实际执行的操作

install-mcp 是唯一需要运行的命令:

npx timps-swarm install-mcp                  # default: configure all detected tools
npx timps-swarm install-mcp --no-sub-agents  # MCP config only, skip the .md files
npx timps-swarm install-mcp --tool cursor    # configure one tool
npx timps-swarm install-mcp --dry-run        # preview without writing
npx timps-swarm uninstall-mcp                # remove all of the above

默认情况下,它会写入:

  • MCP 服务条目:写入 9 个 IDE 配置文件(每个 IDE 一个条目,均指向 npx timps-swarm mcp)。
  • 161 个子 Agent .md 文件:写入 ~/.claude/agents/、./.claude/agents/、~/.codex/agents/(每个 MCP 工具对应一个),这样 Claude Code 的 Task(subagent_type="timps_kubernetes_navigator")、Cursor Composer 和 Codex 就能并行派遣它们。

所有写入操作都具有幂等性(重新运行会更新现有文件),并且可通过 uninstall-mcp 撤销(它只会移除 timps-swarm 键和 timps-*.md 文件,不会修改其他配置)。


核心命令

# Security audit — secrets + CVEs + SAST, no backend, no API key
npx timps-swarm audit ./

# Full 10-agent SDLC pipeline on any codebase
npx timps-swarm fix ./src --language python

# Generate a complete OpenAPI spec from plain English
npx timps-swarm api-design "billing API with metered usage and Stripe webhooks"

# Design a DB schema with DDL, ER diagram, and migrations
npx timps-swarm db-design "multi-tenant SaaS with usage-based billing"

# Diagnose your machine (12 specialist agents)
npx timps-swarm health

MCP 集成

npx timps-swarm install-mcp            # auto-detect and configure all installed tools
npx timps-swarm install-mcp --tool cursor    # single tool only
npx timps-swarm install-mcp --dry-run        # preview without writing files
工具写入的配置
Claude Code~/.claude/mcp.json
Cursor~/.cursor/mcp.json
Windsurf~/.windsurf/mcp.json
Continue~/.continue/config.json
Zed~/.config/zed/settings.json
Aider~/.aider.conf.yml
Goose~/.config/goose/config.yaml
Gemini CLI~/.gemini/settings.json
Codex CLI~/.codex/config.json
Amp~/.amp/mcp.json
Warp~/.warp/mcp_servers.json
VS Code / Cline / Copilot.vscode/mcp.json(工作区)
手动配置片段(所有工具)

install-mcp 会将以下片段写入各 IDE 配置中。env: 块会转发你在 shell 中设置的 API 密钥;此项为可选(IDE 通常会继承环境变量,但显式配置对沙箱主机更稳妥)。

Claude Code — ~/.claude/mcp.json

{
  "mcpServers": {
    "timps-swarm": {
      "command": "npx",
      "args": ["timps-swarm", "mcp"],
      "env": {
        "GEMINI_API_KEY": "...",
        "ANTHROPIC_API_KEY": "..."
      }
    }
  }
}

Cursor / Windsurf / Gemini CLI / Codex CLI / Amp — 格式与上面相同,路径不同。

VS Code / Cline / Roo Code / GitHub Copilot — .vscode/mcp.json

{
  "mcp": {
    "servers": {
      "timps-swarm": { "type": "stdio", "command": "npx", "args": ["timps-swarm", "mcp"] }
    }
  }
}

Continue — ~/.continue/config.json

{ "mcpServers": [{ "name": "timps-swarm", "command": "npx", "args": ["timps-swarm", "mcp"] }] }

Aider — ~/.aider.conf.yml

mcp-servers:
  timps-swarm:
    command: npx
    args: [timps-swarm, mcp]
    type: stdio

Zed — ~/.config/zed/settings.json

{
  "assistant": {
    "mcp_servers": {
      "timps-swarm": { "command": "npx", "args": ["timps-swarm", "mcp"] }
    }
  }
}

Goose — ~/.config/goose/config.yaml

extensions:
  - name: timps-swarm
    type: stdio
    cmd: npx timps-swarm mcp
    enabled: true

GitHub Actions — 可复用工作流

jobs:
  generate:
    uses: Sandeeprdy1729/timps-swarm/.github/workflows/timps-swarm.yml@main
    with:
      task: "Build a microservice for JWT authentication"
      language: python
    secrets:
      GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}

LLM 提供商

按优先级顺序尝试提供商,并使用第一个可用的提供商。

优先级提供商环境变量备注
1MCP Sampler(自动)使用宿主工具的模型
2Gemini 2.5 FlashGEMINI_API_KEY推荐 — 速度快,免费额度充足
3Anthropic ClaudeANTHROPIC_API_KEY最适合复杂推理
4OpenAI GPT-4oOPENAI_API_KEY
5Groq Llama 3.3 70BGROQ_API_KEYAPI 推理速度最快
6Ollama(自动检测)完全离线,无需 API 密钥
7TIMPS-Coder 0.5B(内置)始终可用
export GEMINI_API_KEY=...      # free tier, fastest start
export ANTHROPIC_API_KEY=...   # optional

161 个 Agent — 完整列表

MCP 服务提供 9 个类别的 161 个专业 Agent。每个 Agent 也都注册为原生的 Claude Code / Cursor / Codex 子 Agent。

类别数量示例
优先级68research_agent, ab_testing_agent, abdm_agent, agent_composer, browser_automation, churn_predictor, demand_forecaster, dependency_agent, digilocker_agent, dpdp_act_auditor, federated_learning, finetuning_agent, fssai_compliance_agent, gst_compliance, indiehacker_agent, model_evaluator, model_perf_monitor, podcast_show_notes_writer, prompt_injection_scanner, quantum_ready, rag_designer, rag_evaluator, red_team_agent, release_manager, sbom_generator, security_remediation, service_mesh_configurator, sprint_planning_agent, storybook_story_generator, threat_intel_analyst, upi_agent, vector_db_agent, voice_agent_designer, wearable_health_coach, web3_agent, win_loss_analyst, …
专家诊断51dependency_rebel, kubernetes_navigator, docker_compose_architect, pipeline_healer, compliance_auditor, incident_response_coordinator, accessibility_tester, mcp_server_generator, observability_cost_optimizer, license_compliance_scanner, container_image_scanner, adr_writer, contract_reviewer, court_case_summarizer, data_pipeline, db_migration_pilot, disaster_recovery, game_day_facilitator, git_workflow_automator, graphql_agent, iac_drift_detector, load_testing, local_rag_builder, log_pattern_analyzer, phishing_simulator, postmortem_agent, test_intelligence, visual_regression_detective, web_scraping, web_search, …
计算机健康12system_optimizer, file_organizer, environment_doctor, security_guard, network_medic, battery_analyst, update_manager, log_interpreter, privacy_cleaner, media_librarian, backup_sentinel, context_switcher
开发者工作流12issue_triager, boilerplate_architect, pr_reviewer, dependency_sentinel, unit_test_writer, docstring_generator, log_detective, sql_optimizer, sprint_reporter, flaky_test_hunter, api_contract_auditor, content_multiplier
知识工作者7inbox_gatekeeper, meeting_condenser, research_scout, trend_monitor, data_wrangler, competitor_tracker, agri_commodity_forecaster
元6list_agents, dispatch, full_checkup, list_providers, connect_tools, tool_status
上下文 / 内核3context_briefing, delegate, kernel_status
SDLC 流水线1run_task(10 节点的 LangGraph 编排器:PM → Architect → Code → Review → QA → Security → Perf → Docs → DevOps)
# Trigger the full SDLC pipeline
python3 give_work.py "Build a rate-limited REST API for user authentication"
# PM → Architect → Code → Review → QA → Security → Perf → Docs → DevOps

# Run a computer health checkup
npx timps-swarm health
python3 give_work.py "My laptop fan is always running"

# Delegate a multi-step goal
npx timps-swarm delegate "fix the auth bug and ensure 80% test coverage"

# Call any of the 161 directly from the CLI
npx timps-swarm mcp   # then use any MCP client

Self-Critic Agent 最有价值 — 它会为任何输出打 1–10 分,并重新运行生成该输出的 Agent,直到达到阈值,从而闭合整个 Agent 群的质量环路。

161 个 Agent 包括 Phase 3(12 个优先级 Agent)、Phase 5(新增 7 个)、Phase 6 nextgen(21 个 — 安全 / DevOps / MLOps / 新兴领域)、Phase 7(32 个 — 印度垂直领域、合规、内容、销售 / 语音、研究),以及用于并行委派的 timps_batch。src/tool_connectors 模块有一个独立的 TOOLS 字典(24 个 IDE 配置快捷方式 — claude_code、cursor 等),由 timps_connect_tools 和 timps_tool_status 在运行时使用;这些不属于这 161 个 Agent。


CLI

npm install -g timps-swarm   # or: npx timps-swarm <command>
COMMANDS
  audit <path>           Security audit — secrets + CVEs + SAST (works offline)
  fix <path>             Run the full 10-agent SDLC pipeline
  research <topic>       Research a topic before writing code
  api-design <desc>      Generate an OpenAPI 3.1 spec from plain English
  db-design <desc>       Design a database schema with DDL + ER diagram
  n8n <desc>             Generate a complete n8n workflow JSON
  refactor [path]        Detect code smells + produce refactored version
  test-data <schema>     Generate realistic seed / fixture data
  monitor <service>      Prometheus + Grafana + alerting config
  ui <desc>              UI component spec + code + accessibility audit
  cost <arch>            Cloud cost estimate + savings recommendations
  critique <content>     Score output 1-10, auto-improve until threshold
  health                 Computer health checkup (12 agents)
  providers              Show configured LLM providers
  install-mcp            Auto-configure TIMPS in 9 AI tools + 161 sub-agents
  uninstall-mcp          Remove the MCP config and 161 sub-agent .md files
  start [--repo <path>]  Start the TIMPS Swarm API server (port 8000)
  mcp   [--repo <path>]  Start the MCP stdio server (Python or Node.js fallback)

FLAGS (install-mcp)
  --tool <id>            Only configure one IDE (claude-code, cursor, codex-cli, …)
  --no-sub-agents        Skip writing 161 sub-agent .md files (MCP config only)
  --dry-run              Preview without writing anything
  --silent               Suppress output (postinstall)

ENV VARS
  TIMPS_API_URL          API server URL (default http://localhost:8000)
                         Set to a remote URL to point every tool call at it.
  TIMPS_REPO             Explicit path to the Python repo for backend commands
  GEMINI_API_KEY         Free tier — fastest start
  ANTHROPIC_API_KEY      Optional
  OPENAI_API_KEY         Optional
  GROQ_API_KEY           Optional
  OLLAMA_HOST            Default http://localhost:11434
  REDIS_URL              Default redis://localhost:6379/0

如果调用 timps-swarm mcp 时磁盘上没有 Python 仓库,它会透明地回退到打包的 cli/lib/mcp-proxy.js——这是一个 Node.js JSON-RPC 2.0 stdio 代理,会将每次工具调用转发到 ${TIMPS_API_URL}/mcp/tools/call。因此,只要能够访问 FastAPI 服务,执行 npm install -g timps-swarm 就足以运行 MCP 服务。


架构

                          User / AI coding tool
                          (Claude Code, Cursor, Codex, …)
                                       │
              ┌────────────────────────┼────────────────────────┐
              │ stdio JSON-RPC 2.0     │                        │
              ▼                        ▼                        ▼
  ┌──────────────────────┐   ┌──────────────────────┐   ┌────────────────────┐
  │ mcp_server/server.py │   │ cli/lib/mcp-proxy.js │   │     src/main.py    │
  │  Python — 161 tools, │   │  Node.js fallback    │   │  FastAPI + WS      │
  │  full MCP sampling   │   │  (npm-only path)     │   │  /swarm/run,       │
  │                      │   │                       │   │  /agents/*,        │
  │                      │   │                       │   │  /mcp/tools,       │
  │                      │   │                       │   │  /mcp/tools/call,  │
  │                      │   │                       │   │  /health, /ws      │
  └──────────┬───────────┘   └──────────┬───────────┘   └──────────┬─────────┘
             │                          │                          │
             │      TOOLS / dispatch   │   POST /mcp/tools/call    │
             │ ◀───────────────────────┴──────────────────────────▶│
             │                                                     │
             │      mcp_server/server._TOOL_HANDLERS              │
             │              (161 tools, in-process)                │
             └─────────────────────────┬───────────────────────────┘
                                       │
                              Swarm Bridge
                                       │
       ┌───────────────────┬──────────┴──────────┬───────────────────┐
       ▼                   ▼                     ▼                   ▼
  SDLC DAG          Health Graph          Specialist Agents      Context / Kernel
  (10 nodes)        (12 nodes)            (120 direct calls)     (3 nodes)
       │                   │                     │                   │
       └───────────────────┴─────────────────────┴───────────────────┘
                                       │
                                  LLM Router
       ┌─────────────┬─────────────────┼─────────────┬───────────────┐
       ▼             ▼                 ▼             ▼               ▼
   Gemini        Anthropic         OpenAI         Groq          Ollama
   2.5 Flash      Claude           GPT-4o       Llama 3.3       (local)
                                                            + TIMPS-Coder 0.5B

三种传输路径汇聚到同一个分发表:

  1. Python MCP stdio(mcp_server/server.py)——完整支持 MCP 采样,在进程内运行,包含 161 个工具。Python 仓库在磁盘上时使用。
  2. Node.js MCP stdio 代理(cli/lib/mcp-proxy.js)——纯 stdio JSON-RPC 2.0 代理,将 tools/list + tools/call 转发到正在运行的 FastAPI 服务。只安装了 npm 软件包(没有 Python 仓库)时使用。
  3. FastAPI REST + WebSocket(src/main.py)——/swarm/run、/agents/*、/health、/ws,以及桥接端点 /mcp/tools(目录)和 /mcp/tools/call(分发)。

第 1 层——Computer Manager(src/layer1_computer_manager.py)——隔离工作目录,并为每个 Agent 限制 CPU、内存和磁盘用量。

第 2 层——Swarm Bridge(src/layer2_swarm_bridge.py)——Agent 生命周期管理:生成、组队、执行 LangGraph DAG、收集结果。

第 3 层——CLI(src/layer3_swarm_cli.py)——give_work.py 和 npm CLI。


REST API

curl http://localhost:8000/health
curl http://localhost:8000/health/full   # deep check with provider status

curl -X POST http://localhost:8000/swarm/run \
  -H "Content-Type: application/json" \
  -d '{"request": "Fix SQL injection in my FastAPI endpoint", "language": "python"}'

curl -X POST http://localhost:8000/agents/refactor \
  -d '{"code": "...", "language": "python", "goals": ["reduce_complexity"]}'

curl http://localhost:8000/providers

# MCP bridge (used by cli/lib/mcp-proxy.js)
curl http://localhost:8000/mcp/tools                                       # full 161-tool catalogue
curl -X POST http://localhost:8000/mcp/tools/call \
  -H "Content-Type: application/json" \
  -d '{"name": "timps_list_agents", "arguments": {}}'                      # call any tool over HTTP

wscat -c ws://localhost:8000/ws   # real-time stream

服务运行时,可在 http://localhost:8000/docs 查看完整的交互式文档。


训练自定义适配器

代码生成器使用 TIMPS-Coder——一个 0.5B 模型,配备 20 个 LoRA 适配器,每种错误类型对应一个。添加示例并推送后,GitHub Actions 会自动训练新的适配器。

cp my_bugs.jsonl datasets/custom/
git add datasets/custom/my_bugs.jsonl
git commit -m "feat: 40 new Python async bug examples"
git push origin main

在仓库机密中设置 HF_TOKEN 和 HF_REPO_ID。流水线会合并你的数据,在 Apple Silicon(MLX)上并行训练 20 个适配器,进行基准测试,并发布到 HuggingFace。

20 种错误类型适配器: java_npe · java_ioob · java_concurrent · python_keyerror · python_typeerror · python_recursion · python_async · python_logic · javascript_null · javascript_scope · javascript_async · cpp_memory · cpp_bounds · go_routine · rust_borrow · sql_injection · xss_vuln · auth_bypass · performance_slow · api_design


硬件

配置RAM备注
最低配置8 GB一次运行一个 Ollama 模型
推荐配置16 GB同时加载所有模型
微调8 GB Apple Silicon在 M1/M2/M3/M4 上使用 MLX

安全

默认关闭 API 密钥身份验证。团队共享时请启用:

TIMPS_AUTH=1 make up-local
python3 give_work.py --keygen "sandeep-laptop"   # generate key (shown once)
python3 give_work.py --revoke timps-sk-xxxx       # revoke a key

密钥以 SHA-256 哈希形式存储在 ~/.timps/.secrets 中(chmod 600)。


贡献

欢迎向 main 提交 PR。请使用 Conventional Commits。

git clone https://github.com/Sandeeprdy1729/timps-swarm
cd timps-swarm && pip install -e ".[dev]"
make up-local    # starts the FastAPI server on :8000

make test 目前不起作用——tests/ 目录为空。现有可运行的测试脚本位于顶层(python3 mcp_server/test_server.py、python3 test_computer_allocation.py)。在依赖 pytest 之前,请添加 tests/ 目录并将其接入 pyproject.toml。

Lint:ruff check .(在 pyproject.toml 中配置,没有 make lint 目标)。未配置类型检查。Python ≥ 3.10,CI 固定使用 3.11。


基于 TIMPS-Coder 构建——一个经过微调的 0.5B 模型,使用 20 个 LoRA 适配器处理特定错误模式。

MIT 许可证 · Discord · npm

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。