Skip to content

McNopper/MARS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌌 MARS β€” Multi-Agent Runtime System

MARS is an open multi-agent runtime where humans and heterogeneous AI agents share a live message bus, discover each other's skills, and collaborate β€” without central orchestration, hard-wired pipelines, or a single controlling LLM.


πŸ€– What is MARS?

Most "multi-agent" frameworks are glorified function-call chains: one orchestrator LLM decides which tool to call next, and every other "agent" is really just a named tool. MARS is different.

The key ideas:

  • Flat peer topology. Every participant β€” human, LLM agent, or service agent β€” connects via the same JSON-over-TCP protocol, registers its skills with a hello, and is addressable by any other participant. There is no master controller.
  • Natural language routing. LLM agents read the full room conversation and decide for themselves whether to respond. "Norbert: Hello Peter, what do you think?" β€” Peter responds because it understands the conversation, not because a router dispatched a function call to it.
  • Open service marketplace. Service agents (math, file I/O, profiler, URL fetch, …) advertise skills on the bus. Any LLM agent discovers them via list_skills and calls them as MCP tool calls β€” built-in and third-party servers (e.g. GitHub MCP) are handled identically.
  • Research grounding predating LLMs. The architecture traces directly to LARS (Nopper, 2000) and earlier work on mobile agents, platform-independence, and federated agent discovery. These papers define the roadmap; features are implemented as they become technically feasible, not before.

✨ What works today

Core platform

  • Rooms β€” humans and agents join named rooms; messages fan out to every member.
  • LLM agents β€” Anthropic Claude, GitHub Copilot, Ollama (local), or offline mock. All share one common provider interface.
  • THINKING spinner β€” braille animation in the TUI when an agent is processing.
  • Artifacts β€” create, read, and share binary or text files between agents.
  • CLI β€” three-pane terminal UI (mars / python -m mars.client.cli.main); connect to a server or run standalone.

Service marketplace β€” all auto-spawned at server start (MCP stdio):

Agent Skills Notes
clock time, location, datetime Returns current time and geolocation as JSON
profiler profiler, memory, cpu, performance CPU/RAM/process stats
status status, introspection, runtime Live platform snapshot
sympy math, solve, equation, algebra, calculus, … Exact symbolic math (SymPy)
scipy scipy, numerical, optimize, linalg, stats, ode, … Numerical math and statistics
file file, read, write, fileio, storage, filesystem Sandboxed file I/O in artifacts/fileio/
url url, fetch, http, web, get, post HTTP GET/POST any public URL
ollama-models models, list-models, ollama-models Lists locally installed Ollama models
launcher spawn_agent, launch, create_agent Agent-to-agent spawning via MCP tool
git git, diff, status, log, add, commit, branch, blame Git operations via gitpython
memory remember, recall, forget, memory_list Cross-session key-value memory (~/.mars/memory.json)
session save_session, load_session, list_sessions, session Save/restore conversations in ~/.mars/sessions/
filesystem (auto, needs Node.js) read_file, write_file, edit_file, list_directory, … Surgical local file access via npx @modelcontextprotocol/server-filesystem
shell (on-demand) shell, run, exec, bash, terminal Shell command execution (stdout/stderr/exit_code)
scheduler (on-demand) schedule_after, schedule_every, after, every One-shot and recurring prompt scheduling
github (on-demand) search_repositories, create_issue, list_pull_requests, … GitHub API β€” requires GITHUB_PERSONAL_ACCESS_TOKEN + binary

External MCP servers β€” any third-party MCP server (e.g. GitHub MCP) plugs in via agents.ini with zero Python code; multi-parameter tool schemas are forwarded verbatim.

CLI commands β€” full feature set, see USER.md for the cheat sheet:

Category Commands
Agents /spawn, /stop, /agents, /switch
Rooms /join, /part, /list
Conversation /new, /compact, /rewind, /ask, /plan
Workspace @file, !cmd, /copy, /context, /instructions, /share, /search
Rendering /echo, /theme, /verbose, /read, /avatar
Other /status, /version, /help, /quit

πŸ—ΊοΈ On the roadmap (from the papers, not yet implemented)

  • Multiline input β€” Ctrl+G to open $EDITOR for multi-line prompts.
  • LSP / code intelligence β€” live symbol lookup and diagnostics from a language server.
  • Scheduled prompt execution β€” the scheduler agent records schedules; automatic dispatch is not yet wired.
  • Domain scopes (active routing) β€” data model and CLI display exist; automatic agent assignment by skill is not yet implemented.
  • Agent FSM engine β€” platform-driven lifecycle transitions (idle β†’ active β†’ suspended β†’ migrating).
  • Federation β€” transparent message routing between MARS nodes; remote agents appear local.
  • Mobile agents (beaming) β€” migrate a live agent with its full state to a remote node and back.

πŸ“Š Feature comparison

MARS is designed as a provider-agnostic replacement for tools like GitHub Copilot CLI and Anthropic Claude CLI. The table below shows the current feature parity.

Daily-use CLI features

Feature Copilot CLI Claude CLI MARS
Multi-turn conversation βœ… βœ… βœ…
Thinking / working indicator βœ… βœ… βœ… animated spinner
@file β€” inline file context βœ… βœ… βœ…
!cmd β€” shell shortcut βœ… βœ… βœ…
/copy β€” copy reply to clipboard βœ… βœ… βœ…
/new β€” clear conversation βœ… βœ… βœ…
/context β€” token count estimate βœ… βœ… βœ…
/compact β€” summarise and compress βœ… βœ… βœ…
/rewind β€” undo last message pair βœ… βœ… βœ…
/share β€” export to Markdown β€” βœ… βœ…
/search β€” search history β€” βœ… βœ…
/ask β€” ephemeral side question β€” βœ… βœ…
/plan β€” request implementation plan βœ… βœ… βœ…
/instructions β€” load project rules βœ… (Copilot instructions) βœ… (CLAUDE.md) βœ… (AGENTS.md, CLAUDE.md, copilot-instructions.md)
Session save / restore βœ… βœ… βœ… session agent
Cross-session memory β€” βœ… βœ… memory agent
Git operations β€” β€” βœ… git agent
Shell execution βœ… βœ… βœ… shell agent
Scheduled prompts β€” β€” βœ… scheduler agent (records only; auto-dispatch not yet wired)
Multiline input (Ctrl+G / editor) βœ… βœ… ❌ planned
LSP / code intelligence β€” βœ… ❌ planned

MARS-exclusive capabilities

Feature Description
Multi-provider Anthropic Claude, GitHub Copilot, and Ollama simultaneously in the same session
Group chat rooms Humans and multiple agents in the same room, messaging each other naturally
Agent-to-agent spawning LLM agents can spawn other agents via the launcher MCP tool
Service marketplace Auto-discovered skill registry; agents call services by skill name, not hard-coded IDs
Science agents SymPy (exact symbolic) and SciPy (numerical) math, built-in and auto-spawned
External MCP servers Any MCP stdio server (GitHub, databases, …) plugs in via a one-line agents.ini entry
Zero API-SDK dependencies Only httpx + anthropic SDK; all providers use the same OpenAI-compatible HTTP path where possible
Federation (planned) Transparent multi-node routing so remote agents appear local

πŸš€ Getting started

  • SETUP.md β€” prerequisites, install, configure providers, start the server.
  • USER.md β€” CLI walkthrough: spawn agents, chat, artifacts.
  • ARCHITECTURE.md β€” runtime stack, service marketplace, providers.
  • BUILD.md β€” building, running tests, packaging a wheel, Git LFS.
  • AGENTS.md β€” service-agent catalogue and wire protocol.
  • CONTRIBUTING.md β€” project layout, coding conventions, how to add providers and tests.

⚑ Quick start

After pip install -e ".[dev]" (see SETUP.md):

# Standalone CLI β€” one provider
python -m mars.client.cli.main --provider mock                     # offline, no setup needed
python -m mars.client.cli.main --provider ollama                   # local Ollama, free, no API key
python -m mars.client.cli.main --provider copilot                  # GitHub Copilot (gh auth login once)
# Two providers side-by-side β€” Ollama + Copilot in the same session
# Terminal 1 β€” headless server
python -m mars.runtime.server.main

# Terminal 2 β€” spawn both agents, then chat with either one
python -m mars.client.cli.main --remote localhost:7432
# Inside the CLI:
/spawn ollama              # local llama3.2, unlimited, no key
/spawn copilot gpt-4o-mini # GitHub Copilot, fast model
# Switch between agents with /switch, or send to both in the same room
# Server + client (recommended for persistent runs)
# Terminal 1
python -m mars.runtime.server.main --provider ollama   # server starts with Ollama pre-spawned

# Terminal 2
python -m mars.client.cli.main --remote localhost:7432

The pip install -e ".[dev]" step also registers mars and mars-server console scripts. They work whenever your Python Scripts/ (Windows) or bin/ (Linux/macOS) directory is on PATH β€” but python -m … always works regardless of PATH configuration.

No API key? Use --provider ollama with Ollama installed locally β€” completely free, no rate limits. See SETUP.md for the full setup guide.

The server exposes TCP 7432 (JSON-line for CLI + agents), HTTP 7433 (REST), and WebSocket 7434 (browser UI). See USER.md for the full command cheat sheet.


πŸ“š References

The architecture is grounded in work by the author predating modern LLMs. These papers define the roadmap β€” features are added to MARS as they are implemented, not before.

Reference Relevance
Nopper, N. (1997). Intelligent Mobile Agents in the Intra/Internet. Diploma thesis, HFU. Mobile agent lifecycle and platform-independence β€” conceptual predecessor of MARS
Nopper, N. (2000). LARS β€” Living Agents Runtime System. AgentLink. Platform-independence, lifecycle, clustering, XML messaging
MΓΌller, Eymann, Nopper et al. (2004). EMIKA. Sensor-to-agent middleware, self-organising coordination
Lohmann, Nopper, Henning (1998). Agent-Based Counterparty Matching. Specialist agent discovery over a shared runtime
Nopper, Kammerer (2000). Location-Aware Agent Retrieval. European Patent. Federated, context-threaded agent retrieval
MΓΌller, Nopper et al. (~2003). Patient Technology. Governance framework for self-organising systems

About

Multi-Agent Runtime System

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors