Stigmergy MCP logo

Stigmergy MCP

Community
calabamatex

MCP server implementing digital pheromone-based indirect coordination for AI coding agents

Publishercalabamatex
RepositoryStigmergy-mcp
LanguageTypeScript
Forks
52
Stars
53
Available tools
0
Transport typestdio
LicenseMIT
Links
  • Connect tools to AI workflows

    Stigmergy MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    53 stars and 52 forks from the linked repository.

Stigmergy-mcp

Stigmergy-MCP infographic: quadratic direct-message overhead, the linear trace hypothesis, and the four core MCP tools

The O(N) curve is a hypothesis: it holds while per-agent retrieval stays bounded. Phase 1 of the companion benchmark measured retrieved content per agent rising from about 0.6k to 3.7k tokens between 5 and 10 agents.

An MCP-compatible trace store for experimenting with indirect shared-state coordination among AI agents.

stigmergy-mcp is a coordination primitive rather than an agent framework, orchestrator, or runtime. Agents can deposit typed traces into a shared environment, retrieve traces near a task area, reinforce or weaken existing traces, and inspect high-intensity signals across a broader area.

Research Status

Trace-based coordination is a hypothesis under evaluation, not a proven solution to multi-agent scaling.

Under cumulative, non-summarizing, sequential handoff with approximately constant predecessor payloads, repeated context transfer can grow quadratically with agent count. Under bounded trace retrieval, bounded retrieved volume, and bounded operation frequency, trace-based coordination can grow approximately linearly. Those forms are conditional. Message passing can summarize, cache, prune, and route selectively, while trace size, retrieval breadth, mechanism overhead, and fidelity loss can grow with system scale.

The companion Stigmergy-mcp-benchmark provides exploratory measurements. The current evidence does not establish a general crossover, matched-fidelity superiority, or a mechanism-specific benefit from decay and reinforcement.

When the Primitive May Help

Trace coordination may be worth evaluating when:

  • task-relevant state is sparse and locally indexable;
  • downstream agents need selected state rather than full conversational replay;
  • trace payloads remain compact;
  • retrieval breadth remains bounded;
  • provenance and write controls can be enforced.

Direct handoff, bounded summarization, or a generic shared workspace may be preferable when:

  • complete context is required;
  • agent count is low;
  • cache reuse makes repeated prefixes inexpensive;
  • state cannot be safely compressed;
  • trace retrieval would approach a full-store scan;
  • shared-state security controls are unavailable.

What Is Stigmergy?

Stigmergy describes indirect coordination through state left in a shared environment. The implementation supports three trace types:

  • attraction — a positive signal associated with an area
  • danger — a warning associated with an area
  • info — a neutral annotation

Traces carry intensity, tags, metadata, and an exponential decay horizon. Other agents retrieve traces by area and effective intensity rather than by replaying a full transcript.

Quick Start

Install from npm

bash
npm install stigmergy-mcp

Build from source

bash
git clone https://github.com/calabamatex/Stigmergy-mcp.git
cd Stigmergy-mcp
npm install
npm run build

Add as an MCP server

bash
# From npm
claude mcp add stigmergy -- node node_modules/stigmergy-mcp/dist/src/index.js

# From source
claude mcp add stigmergy -- node dist/src/index.js

Verify

bash
npm run inspect

Database

Traces persist to ./stigmergy.db by default.

bash
STIGMERGY_DB_PATH=/path/to/traces.db
STIGMERGY_DB_PATH=:memory:

The database is created on first use.

MCP Tools

deposit_trace

Write a trace into the shared environment.

ParameterTypeDefaultDescription
areastringrequiredFile path, module, or task area
actionstringrequiredEvent or observation represented by the trace
agent_idstringrequiredOriginating agent identifier
trace_typeattraction, danger, or inforequiredSignal type
intensitynumber from 0 to 10.5Initial signal strength
decay_hoursnumber24Exponential decay horizon
tagsstring arrayemptySearchable labels
metadataobjectemptyAdditional structured data

sense_environment

Read traces near a specified area.

ParameterTypeDefaultDescription
areastringrequiredFile path or prefix
radiusinteger2Number of path levels included in matching
min_intensitynumber from 0 to 10.05Minimum effective intensity
trace_typeenumoptionalFilter by trace type
tagsstring arrayoptionalRequire all supplied tags
agent_idstringoptionalFilter by originating agent

Results are sorted by effective intensity.

reinforce_trace

Strengthen or weaken an existing trace.

ParameterTypeDescription
trace_idstringTrace identifier
deltanumber from -1 to 1Positive strengthens; negative weakens

get_gradient

Return the strongest traces across a broad area.

ParameterTypeDefaultDescription
areastringrequiredBroad area prefix
limitinteger5Maximum returned traces

Trace Lifecycle

Effective intensity follows:

text
effective = intensity * exp(-elapsed_hours / decay_hours)

With the default decay_hours=24, a trace retains approximately 37% of its original intensity after 24 hours and approximately 14% after 48 hours. Runs lasting only minutes are unlikely to exercise the decay mechanism materially. Claims about the value of decay or reinforcement therefore require long-horizon tests or explicit ablations.

Traces below the pruning threshold are removed during deposit operations and are excluded from reads below the applicable query threshold.

Example Workflow

text
Agent A:
  deposit_trace(area: "src/auth/session.ts",
                action: "found XSS in session handler",
                trace_type: "danger",
                intensity: 0.8,
                tags: ["security"])

Agent B:
  sense_environment(area: "src/auth/login.ts", radius: 1)
  reinforce_trace(trace_id: "...", delta: 0.15)

Agent C:
  get_gradient(area: "src/", limit: 5)

Programmatic Usage

typescript
import { TraceStore } from 'stigmergy-mcp/store';
import { createServer } from 'stigmergy-mcp/server';

const store = new TraceStore('/path/to/traces.db');
const server = createServer(store);

See ARCHITECTURE.md for implementation details.

Security and Governance

A writable shared trace store can become a prompt-injection, poisoning, and sensitive-data propagation surface. Production deployment should add controls appropriate to the environment, including:

  • authenticated writes and agent identity
  • provenance and append-only audit records
  • access control and tenant isolation
  • content validation and read-time sanitization
  • retention, deletion, and incident-response procedures
  • explicit trust labels for agent- and tool-generated state

The package should not be interpreted as a complete production security control plane.

Benchmarks

The exploratory benchmarking harness lives at calabamatex/Stigmergy-mcp-benchmark.

Development

bash
npm run build
npm run dev
npm test
npm run test:coverage
npm run loc
npm run inspect

License

MIT

Use Stigmergy MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Stigmergy MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Stigmergy MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Stigmergy MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "stigmergy-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Stigmergy MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Stigmergy MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Stigmergy MCP to help me with this task?
Stigmergy MCP
Sure. I read it.
Here is what I found using Stigmergy MCP.

Frequently asked questions

What is the Stigmergy MCP MCP server used for?

Stigmergy MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Stigmergy MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Stigmergy MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Stigmergy MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Stigmergy MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Stigmergy MCP MCP to TypingMind?

Stigmergy MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Stigmergy MCP MCP provide in TypingMind?

Stigmergy MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Stigmergy MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Stigmergy MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇