Skip to contentSkip to content
Cosmic Stackcosmicstack.ai

mercury agent

A terminal-native coding agent for serious engineers.

Open-source AI coding agent with 40+ tools, Autopilot mode, persistent Second Brain memory, a typed Skills system, and a provider-agnostic runtime. Built for engineers who treat their terminal as a primary surface.

stars2.5kversionv1.1.12tools40+skills128 · 23forks260licenseMIT

install

One command. Then you're working.

install
$ npm i -g @cosmicstack/mercury-agent
run
$ mercury

Requires Node 20+. First-run prompts for your model provider credentials and stores them in your OS keychain. No telemetry, no account, no cloud component required.

capabilities

Six things Mercury does that other agents don't.

autopilot

Run multi-hour workflows unattended.

Autopilot mode lets Mercury plan, execute, and recover from failures across hundreds of turns without supervision. Set a goal, walk away, return to a clean diff.

second brain

Persistent memory that survives sessions.

The Second Brain stores decisions, conventions, and project knowledge in a structured, queryable form. Mercury remembers what you taught it last week — and what it learned about your codebase last month.

skills

A typed library of reusable capabilities.

Skills are versioned, parameterized procedures that Mercury can invoke. Built-in skills cover refactoring, code review, and migrations. Your own skills extend the agent without rewriting it.

provider agnostic

Bring your own model — or six.

Mercury speaks OpenAI, Anthropic, Cohere, Mistral, xAI, and OpenRouter natively. Route different tools to different providers; fail over automatically when one is degraded.

40+ tools

A real tool surface, not a chat box.

Filesystem, shell, git, web fetch, browser, code search, AST refactor, structured edits, MCP — the tool set is the product. Each tool is sandboxed, auditable, and individually testable.

open source

MIT-licensed. Read every line.

The runtime, tools, and skills library are all open source under MIT. Use it commercially. Fork it. Ship a managed offering. We'd rather you build than ask.

providers

Six providers, one runtime.

Route different tools to different providers. Fail over automatically when one is degraded. Bring your own API keys — we never proxy your traffic.

  • OpenAI

    gpt-5, gpt-5-mini, o-series

    stable
  • Anthropic

    claude-opus-4.7, claude-sonnet-4.5, claude-haiku-4.5

    stable
  • xAI

    grok-4, grok-4-mini

    stable
  • Mistral

    mistral-large-3, codestral-2

    stable
  • Cohere

    command-a, command-r-plus-08

    stable
  • OpenRouter

    300+ models via unified gateway

    stable

channels

Three release cadences, your choice.

Stable

Bi-weekly releases

Production engineers. Default channel.

npm i -g @cosmicstack/mercury-agent

Beta

Weekly cut from main

Teams who want new tools first.

npm i -g @cosmicstack/mercury-agent@beta

Nightly

Built on every merge

Contributors and early adopters.

npm i -g @cosmicstack/mercury-agent@nightly

comparison

Where Mercury differs.

We try to be honest about this rather than puff it up. Read the source, verify the claims, then decide for yourself.

CapabilityMercury AgentCursor AgentClaude Code
Open source runtime
Provider-agnostic (6+ providers)Limited
Long-horizon autopilot modeLimited
Persistent project memorySecond BrainRules fileAGENTS.md
User-authored skills128 community + 23 built-in
Self-hostable
MCP support

get started

Install it. Ship something in 10 minutes.

No signup. No cloud component. No telemetry. Just an open-source agent and your terminal.