Skip to main content
Glama
10CG

nexusm-mcp-server

by 10CG

nexusm-mcp-server

Nexusm MCP Server — generic MCP server exposing Nexusm core capabilities (memory, conversation, knowledge, feedback, context) to MCP clients via @modelcontextprotocol/sdk stdio + Streamable HTTP transports.

Published to npm as @nexusm/mcp-server.

Tracked in Nexusm main repo: packages/nexusm-mcp-server (US-037 v7.0).

Configuration

Set via environment (e.g. the env block of your client's .mcp.json):

Env var

Required

Purpose

NEXUS_API_URL

yes

Base URL of the Nexus REST API. The server auto-appends /v1 if absent, so a bare origin (http://localhost:8787) or a local proxy URL works — you don't need to add the suffix manually. Canonical form: https://your-nexus-host/v1.

NEXUS_API_TOKEN

yes

Nexus API key (the product auth contract)

NEXUS_TENANT_ID

yes

Tenant id for the compound-id isolation

NEXUS_DEFAULT_USER_ID

no

Single-user pin. When set to a non-empty value, the server uses it as user_id for every tool call, overriding whatever user_id the LLM supplies. Leave unset for multi-user deployments where each tool call provides its own user_id. Recommended for personal / dogfood setups where the LLM picks inconsistent IDs across sessions. ⚠️ Do NOT set this on a shared / multi-user server — every user's memories and context would be written and retrieved under this single id, silently collapsing all users into one (cross-user memory bleed).

NEXUS_METRICS_PORT

no

Opt-in Prometheus /metrics port. Off by default in stdio mode — the scrape endpoint is a server-side concern, and a local stdio client (Claude Code / Cursor / Windsurf) has no scraper. Set this only when you actually scrape metrics. (NEXUS_MCP_TRANSPORT=http also enables it.)

The Nexus API auth contract is NEXUS_API_TOKEN. Any deployment-edge access control in front of the API (e.g. a reverse proxy / gateway / Cloudflare Access) is not this client's concern — handle it transparently at the network/transport layer (point NEXUS_API_URL at a local proxy) so the client stays deployment-agnostic. When pointing at a local proxy, set NEXUS_API_URL to the proxy origin (e.g. http://localhost:8787); the server will append /v1 automatically and log a one-line diagnostic to stderr confirming the normalization.

Related MCP server: synapse-mcp

Status

Wave 2 done (2026-05-22): 4 tools fully wired to @nexusm/sdk (context_retrieve / memory_search / memory_create / memory_feedback) + full §M-3 HTTP→MCP error mapping (mapHttpStatusToMcpError + 2 new error codes Unauthorized/RateLimited) + Prometheus metrics with cardinality guard + cross-substory + E2E + schema_sync integration tests. Wave 3 (nexus-claude-plugin Anthropic marketplace) pending — see proposal.

Known Wave 2 limitations: (1) CI red until Gate-1 — @nexusm/sdk@1.3.0 npm publish pending (user action; SDK rename merged at 1fbdd69 in nexus-sdk-js main); (2) integration tests env-gated (require NEXUS_TEST_API_URL/TOKEN/TENANT_ID Forgejo secrets, currently dormant); (3) Python backend mcp.py metrics defined but emit-site wiring deferred to Wave 3 (FU-MCP-BACKEND-EMIT-WIRING); (4) HTTP transport per-request server.connect() is scaffold-only — Wave 3 entry condition (FU-MCP-HTTP-SESSION) before plugin TASK-019 E2E runs.

Available Tools

4 tools
nexus.context_retrieveA

Use when user asks anything that might need context from prior sessions, prior conversations, or stored facts. Single call returns relevant memories, recent conversation turns, and knowledge entities together. Prefer this over nexus.memory_search when query is open-ended.

ParametersJSON Schema
NameRequiredDescriptionDefault
user_idYesUser identifier within tenant scope. Required per-call.
queryYes
limitNo
as_ofNoISO 8601 with timezone, max 90 days in the past. Default: NULL (current valid memories, no anchor inheritance from previous calls). Do NOT infer as_of from conversation context — user must explicitly express time intent.

Output Schema

ParametersJSON Schema
NameRequiredDescription
retrieve_idYesPASS THIS to nexus.memory_feedback to rate this retrieval. Save it before continuing the conversation.
memoriesYes
conversation_turnsYes
knowledge_entitiesYes
errorsNoNon-empty if partial degradation (dict[str,str] type, key=layer, value=error message). Null when all layers healthy. HTTP 200 + errors!=null indicates partial result.
_warningsNoPartial-result warning channel; populated when one or more retrieval layers degraded.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses that a single call returns multiple data types and gives specific behavioral guidance for the 'as_of' parameter, including the restriction against inferring time context from conversation. This adds valuable transparency beyond the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise: three sentences that convey the purpose, usage guideline, and a key behavioral note. Every sentence earns its place without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the existence of an output schema (not shown but indicated), the description appropriately avoids explaining return values. It covers the key combination of data types and the critical 'as_of' constraint. Minor gap: no mention of error conditions or performance, but overall sufficient for a retrieval tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 50%, so the description should compensate. It adds meaningful detail for the 'as_of' parameter (e.g., max 90 days, no inference from context), but does not elaborate on user_id, query, or limit beyond what the schema provides. This meets the baseline but does not elevate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: retrieving context from prior sessions, conversations, or stored facts. It specifies that it returns 'memories, recent conversation turns, and knowledge entities together,' and distinguishes from sibling nexus.memory_search by stating 'Prefer this over nexus.memory_search when query is open-ended.'

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear condition for use ('when user asks anything that might need context from prior sessions...') and suggests an alternative for more specific queries (nexus.memory_search). However, it does not explicitly list when not to use this tool or other exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

nexus.memory_createA

Persist a new memory. Use when user explicitly asks to 'remember X' or when storing structured facts (preferences, decisions, code snippets with language tag). Set memory_type to 'episodic' for events, 'semantic' for facts, 'procedural' for how-tos.

ParametersJSON Schema
NameRequiredDescriptionDefault
user_idYes
contentYes
memory_typeNosemantic
metadataNoFree-form structured tags (e.g., {language: 'python', tags: ['snippet', 'react-hooks']}). Use ≤ 10 keys, value length ≤ 200 chars (proposal §ai R2 D-8 cap; over-cap → InvalidParams).
valid_untilNo
valid_until_sourceNov6 US-035 temporal validity (backend ValidUntilSource Literal, 5 values, locked in proposal §R2.1). MCP client typically passes 'sdk_provided' (user-declared) or omits to let backend worker auto-extract. Any value outside the 5-enum is rejected at args parse stage with InvalidParams.
agent_idNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
memory_idYes
created_atYes
conflict_resolutionNoIf v6 US-036 ConflictResolver is enabled (per-tenant feature flag), resolution_status echoed here. NULL when feature flag disabled. status enum locked to 9 values (migration 020 CHECK).

TDQS

A3.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description must carry full behavioral burden. It only mentions persistence (a write operation) but lacks details on side effects, authentication, rate limits, or content restrictions beyond metadata constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the core action. No unnecessary words; every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers core purpose and key parameters adequately, but lacks details on content length limits, valid_until semantics, and expected return values despite output schema existence.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 29%, meaning most parameters lack descriptions. The description adds value for memory_type (episodic/semantic/procedural mapping) and metadata (free-form tags), but does not elaborate on user_id, content, valid_until, or agent_id.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states 'Persist a new memory' and provides concrete usage scenarios (e.g., storing preferences, facts, code snippets). It distinguishes from siblings (retrieve, feedback, search) by focusing on creation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear guidance on when to use (e.g., 'when user explicitly asks to remember X') and maps memory_type to use cases. It does not explicitly exclude other scenarios, but the sibling list implies alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

nexus.memory_feedbackA

Submit per-memory feedback on a previous nexus.context_retrieve call. Pass retrieve_id from earlier output. Rating 1-5, plus per-memory useful flag with optional reason. v5 feedback loop drives quality_score reranking.

ParametersJSON Schema
NameRequiredDescriptionDefault
user_idYesMCP server **internal** audit/logging field, **not forwarded** to backend FeedbackRequest body. Backend derives user_id from retrieve_log (route is PUT /v1/feedback/{retrieve_id}). This field is only used for MCP server-side structlog + metric label.
retrieve_idYesFrom earlier nexus.context_retrieve output. MCP server uses this value as PUT URL path parameter.
ratingYes
item_feedbackNoPer-memory useful flag with optional reason. Maps to backend FeedbackRequest.item_feedback[].
expected_missingNoFree-text on what relevant memories were missing from retrieval. (PII-filtered before storage by backend)
contextNoFree-form context for feedback (e.g., {client: 'claude-code', session_id: '...'}).

Output Schema

ParametersJSON Schema
NameRequiredDescription
feedback_idYes
retrieve_idYes
statusYesSubmission status (currently always 'accepted', enum reserved for future expansion)
created_atYes

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, description carries burden. It discloses that user_id is internal and not forwarded, and that feedback drives quality_score reranking. Missing side effects, idempotency, or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with action, no fluff. Efficiently conveys core purpose and usage.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers key aspects: purpose, input requirements, per-memory feedback, and feedback loop impact. Lacks explanation of output schema, but that is acceptable since an output schema exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is high (83%); description adds marginal value by explaining user_id's internal nature and item_feedback's structure, but largely repeats schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states this tool submits per-memory feedback on a previous nexus.context_retrieve call, specifying key parameters (retrieve_id, rating, useful flag). It distinguishes from siblings (retrieve, create, search) by focusing on feedback.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly instructs to pass retrieve_id from earlier output, implying usage after retrieval. Does not list exclusions or alternatives, but context is clear given sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv0.1.1
    • First observednexus.context_retrieve
    • First observednexus.memory_create
    • First observednexus.memory_feedback
    • First observednexus.memory_search

TDQS

A3.9/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: context_retrieve for broad context, memory_create for storing, memory_feedback for feedback, memory_search for targeted search. No overlap.

Naming Consistency4/5

All tools follow nexus_verb_noun pattern with snake_case. Slight inconsistency: two use 'memory_' prefix, one uses 'context_', but this reflects functional difference.

Tool Count5/5

Four tools cover core memory operations perfectly: creation, two retrieval modes, and feedback. No redundancy, each tool earns its place.

Completeness3/5

CRUD surface is incomplete: update and delete for memories are missing. Feedback partially addresses quality improvement, but lifecycle management has gaps.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers