Skip to content

fix: correct standalone MCP invocation to use --package flag#121

Merged
rohitg00 merged 4 commits intorohitg00:mainfrom
JasonLandbridge:fix/standalone-mcp-npx-command
Apr 13, 2026
Merged

fix: correct standalone MCP invocation to use --package flag#121
rohitg00 merged 4 commits intorohitg00:mainfrom
JasonLandbridge:fix/standalone-mcp-npx-command

Conversation

@JasonLandbridge
Copy link
Copy Markdown
Contributor

@JasonLandbridge JasonLandbridge commented Apr 13, 2026

Problem

npx agentmemory-mcp fails with a 404 from the npm registry because there is no standalone npm package named agentmemory-mcp. The agentmemory-mcp binary is registered inside the @agentmemory/agentmemory package (dist/standalone.mjs).

Running npx agentmemory-mcp as documented causes:

npm error 404 Not Found - GET https://registry.npmjs.org/agentmemory-mcp

Fix

The correct invocation is:

npx --package @agentmemory/agentmemory agentmemory-mcp

And in MCP config JSON:

{
  "mcpServers": {
    "agentmemory": {
      "command": "npx",
      "args": ["--package", "@agentmemory/agentmemory", "agentmemory-mcp"]
    }
  }
}

Changes

Updated all documentation examples to use the correct --package flag:

  • README.md — standalone MCP section, quick-start table, and agent-specific prompts (OpenClaw, Hermes, Cursor, OpenCode, Gemini CLI, Codex CLI, Claude Desktop)
  • integrations/openclaw/README.md
  • integrations/hermes/README.md

Verification

Confirmed working locally:

$ echo '{"jsonrpc":"2.0","id":1,"method":"initialize",...}' | npx --package @agentmemory/agentmemory agentmemory-mcp
[agentmemory-mcp] Standalone MCP server v0.8.1 starting...
{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2024-11-05",...,"serverInfo":{"name":"agentmemory","version":"0.8.1"}}}

closes #120

Summary by CodeRabbit

  • Documentation
    • Refreshed MCP server configuration examples with updated OpenCode schema and setup instructions.
    • Added dedicated section documenting OpenCode agent configuration options.

npx agentmemory-mcp fails because there is no standalone npm package
named 'agentmemory-mcp'. The binary is registered inside the
@agentmemory/agentmemory package and must be invoked with:

  npx --package @agentmemory/agentmemory agentmemory-mcp

Updated all documentation examples across README.md and integration
guides (openclaw, hermes) to use the correct invocation. This fixes
MCP clients that followed the docs and got an npm 404 error.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 13, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: db2b2572-1cf9-4a25-8ac3-5274c37d3591

📥 Commits

Reviewing files that changed from the base of the PR and between 54c32c7 and 2665981.

📒 Files selected for processing (1)
  • README.md

📝 Walkthrough

Walkthrough

Updated README.md to document new OpenCode MCP server configuration examples. Changed the configuration schema from .opencode/config.json using mcpServers object to opencode.json using mcp object with updated command structure. Added a dedicated OpenCode configuration section alongside existing agent documentation.

Changes

Cohort / File(s) Summary
README Documentation
README.md
Updated OpenCode MCP server setup examples to use new opencode.json configuration schema with mcp object, type: local, command array format, and added dedicated OpenCode (opencode.json) section.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 The config now flows in cleaner lines,
With opencode.json's fresh designs,
Command arrays hop in perfect array,
Documentation hops brighter today! 🌱

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: correcting the standalone MCP invocation to use the --package flag, which is the primary objective of this PR.
Linked Issues check ✅ Passed All code changes directly address issue #120 by updating documentation and examples to use the correct npx invocation with --package flag instead of the failing direct command.
Out of Scope Changes check ✅ Passed All changes are in-scope: README.md documentation updates and integration guides reflecting the corrected MCP server invocation to resolve the npm E404 error.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

JasonLandbridge and others added 3 commits April 13, 2026 11:48
OpenCode uses a different MCP config format than other tools:
- Config file is opencode.json (not .opencode/config.json)
- Uses "type": "local" with "command" array (not mcpServers format)
- Does not use separate "command"/"args" fields

Also added an OpenCode-specific config block in the Standalone MCP
section alongside the generic JSON example so it's easy to find.
…x-command

# Conflicts:
#	README.md
#	integrations/hermes/README.md
#	integrations/openclaw/README.md
#	src/cli.ts
@rohitg00
Copy link
Copy Markdown
Owner

Thanks for catching this + the research on OpenCode's config format — that was the valuable bit I missed in #123.

Merging with a small conflict resolution: #123 landed first with a structurally different fix for the same 404 (published a real agentmemory-mcp shim package + added a canonical npx -y @agentmemory/agentmemory mcp CLI subcommand), so npx agentmemory-mcp now Just Works without the --package flag. The --package lines from your diff are reverted to the shim form.

Your OpenCode correction is preserved, though — the row in the agents table and the dedicated OpenCode block you added in the Standalone MCP section both stay, with only the command swapped to npx -y agentmemory-mcp. Main previously had .opencode/config.json + mcpServers which you correctly identified as wrong; it's now opencode.json + mcp + type: local + command array format, thanks to your research.

Landing in the next patch bump alongside #122.

@rohitg00 rohitg00 merged commit 61bdcf2 into rohitg00:main Apr 13, 2026
2 of 3 checks passed
rohitg00 added a commit that referenced this pull request Apr 13, 2026
Two community contributions on top of 0.8.3 land as a patch release so
they reach users immediately and so `npx agentmemory-mcp` ships to the
npm registry for the first time (closing out #120 on the live release).

- #122 (Jason Landbridge): memory_save persists to disk immediately
  after every call, not just on SIGINT/SIGTERM, so memories survive
  SIGKILL from agent sessions ending forcefully
- #121 (Jason Landbridge): OpenCode MCP config format corrected —
  opencode.json with mcp/type:local/command array instead of the
  wrong .opencode/config.json with mcpServers

Version bumped across package.json, src/version.ts, types.ts,
export-import supportedVersions, plugin.json, shim package.json and
its dependency on the main package (~0.8.4). package-lock.json
regenerated. 684 tests passing, clean build.
@rohitg00 rohitg00 mentioned this pull request Apr 13, 2026
5 tasks
@JasonLandbridge
Copy link
Copy Markdown
Contributor Author

Yes great compromise on getting this in. thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP Install Failed

2 participants