Registry / ai-ml / context-matters

context-matters

JSON →
library0.2.23jsnpmunverified

Context-matters is a structured context store for AI agents, providing an MCP server with an SQLite backend. Version 0.2.23 is the latest stable release. It enables persistent, queryable context via the Model Context Protocol (MCP), differentiating from in-memory context solutions by offering durability and structured retrieval. The package supports semantic and keyword search, context segmentation, and time-based filtering. It is designed for use with Claude Desktop and other MCP-compatible AI agents, and is actively developed with regular releases.

npm install context-matters
INSTALL
IMPORT
SIG · CONTEXT-MATTERS
C
context-matters
ai-mljavascriptv0.2.23
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ContextServer
import { ContextServer } from 'context-matters'
const ContextServer = require('context-matters')
ESM-only; CJS require will fail.
ContextClient
import { ContextClient } from 'context-matters/client'
import { ContextClient } from 'context-matters'
Client is in subpath export 'client'.
createContextStore
import { createContextStore } from 'context-matters'
import createContextStore from 'context-matters'
Named export, not default.

Demonstrates starting an MCP context server, adding a context entry, and searching via the client.

import { ContextServer, ContextClient } from 'context-matters'; import { createContextStore } from 'context-matters'; const server = new ContextServer({ dbPath: './context.db' }); await server.start(); const client = new ContextClient({ serverUrl: 'http://localhost:9876' }); await client.addContext({ id: 'session-1', content: 'User prefers dark mode', tags: ['pref'] }); const results = await client.search({ query: 'dark mode' }); console.log(results); await server.stop();
Debug
Known issues
breakingv0.2.0 split server and client into separate exports; importing ContextClient from root now requires subpath.
fix
Use import { ContextClient } from 'context-matters/client'.
affects: >=0.2.0
deprecatedThe constructor option `dbPath` is deprecated in favor of `database` since v0.2.20
fix
Use `database` instead of `dbPath` in ContextServer constructor.
affects: >=0.2.20 <0.3
gotchaSQLite backend requires better-sqlite3 to be installed separately as a peer dependency.
fix
Run `npm install better-sqlite3` alongside context-matters.
affects: >=0.2.0
breakingNode.js <18 is not supported due to use of global fetch.
fix
Upgrade to Node.js 18+.
affects: <0.2.0
gotchaThe server starts on a random port by default; must specify `port` in constructor to know the URL.
fix
Pass `port: 9876` to ContextServer options.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'context-matters/client'
Package version <0.2.0 does not have client subpath export.
fix
Upgrade to 0.2.23+ and use import { ContextClient } from 'context-matters/client'.
TypeError: Class extends value undefined is not a constructor or null
Missing required MCP SDK peer dependency.
fix
Run `npm install @modelcontextprotocol/sdk`
Error: Cannot find module 'better-sqlite3'
SQLite backend dependency missing.
fix
Install better-sqlite3 via `npm install better-sqlite3`.
SQLITE_ERROR: table contexts has no column named content
Schema mismatch; database was created by an older version.
fix
Delete the .db file and restart the server to re-create schema.
Upgrade
Version history
0.2.23latest on npm
Audit
Dependencies
better-sqlite3optionalSQLite database backend for context storage
@modelcontextprotocol/sdkrequiredMCP protocol implementation
Agent activity
20 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
context-matters — npm install context-matters · libregistry